diff --git a/.gitignore b/.gitignore index 0a33e5c7..5f5f4b33 100644 --- a/.gitignore +++ b/.gitignore @@ -13,4 +13,5 @@ !Makefile .idea core/version/version.go -.trash \ No newline at end of file +.trash +.claude diff --git a/Dockerfile b/Dockerfile index 32937aed..33139812 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,7 +21,9 @@ RUN echo "Cache busted at $(date): oc3 version: $(./dist/oc3 version)" FROM alpine:3.22.4 ARG BUILDTIME -RUN apk add --no-cache bash +# git keeps the history of the form definitions (forms revisions) and of +# the sysreports. +RUN apk add --no-cache bash git COPY --from=builder /opt/oc3/dist/oc3 /usr/bin/oc3 diff --git a/README.md b/README.md index 3c7afe39..730c6997 100644 --- a/README.md +++ b/README.md @@ -76,6 +76,7 @@ worker.fast: - "instance_action" - "node_disk" - "object_config" + - "san_switch" - "system" ``` diff --git a/cachekeys/main.go b/cachekeys/main.go index 0b8c1572..7d7646ae 100644 --- a/cachekeys/main.go +++ b/cachekeys/main.go @@ -20,6 +20,10 @@ const ( FeedNodeDiskQ = "oc3:q:feed_node_disk" FeedNodeDiskPendingH = "oc3:h:feed_node_disk_pending" + FeedSANSwitchH = "oc3:h:feed_san_switch" + FeedSANSwitchQ = "oc3:q:feed_san_switch" + FeedSANSwitchPendingH = "oc3:h:feed_san_switch_pending" + FeedObjectConfigForClusterIDH = "oc3:h:feed_object_config_for_cluster_id" FeedObjectConfigH = "oc3:h:feed_object_config" diff --git a/cdb/db_action_queue.go b/cdb/db_action_queue.go index 0a1f1ef4..0f605c4b 100644 --- a/cdb/db_action_queue.go +++ b/cdb/db_action_queue.go @@ -70,13 +70,19 @@ func (oDb *DB) UpdateActionStatus(ctx context.Context, id int64, status string, return nil } +// actionQueueJoins makes the "nodes." and "services." props selectable: a queued +// action carries only the ids, and a node action names no service (empty svc_id), +// hence the LEFT JOINs. Same approach as logJoins. +const actionQueueJoins = " LEFT JOIN nodes ON nodes.node_id = action_queue.node_id" + + " LEFT JOIN services ON services.svc_id = action_queue.svc_id" + func buildActionsQuery(p ListParams, idCond string, idArgs []any) (string, []any, error) { if len(p.SelectExprs) == 0 { return "", nil, fmt.Errorf("buildActionsQuery: no columns selected") } sb := &strings.Builder{} - fmt.Fprintf(sb, "SELECT %s\nFROM action_queue", strings.Join(p.SelectExprs, ", ")) + fmt.Fprintf(sb, "SELECT %s\nFROM action_queue%s", strings.Join(p.SelectExprs, ", "), actionQueueJoins) var conds []string var args []any @@ -92,7 +98,7 @@ func buildActionsQuery(p ListParams, idCond string, idArgs []any) (string, []any conds = append(conds, "1=0") } else { conds = append(conds, - "node_id IN ("+ + "action_queue.node_id IN ("+ "SELECT n.node_id FROM nodes n"+ " JOIN apps a ON n.app = a.app"+ " JOIN apps_responsibles ar ON ar.app_id = a.id"+ @@ -103,6 +109,12 @@ func buildActionsQuery(p ListParams, idCond string, idArgs []any) (string, []any } } + // Column filters of the request: the nodes and services joins are always in + // place here, so a filter on their names needs nothing more. + filterConds, filterArgs := p.FilterConditions() + conds = append(conds, filterConds...) + args = append(args, filterArgs...) + if len(conds) > 0 { sb.WriteString("\nWHERE " + strings.Join(conds, " AND ")) } @@ -147,3 +159,132 @@ func (oDb *DB) GetActionOne(ctx context.Context, id string, p ListParams) ([]map return scanRowsToMaps(rows, p.Props, p.TypeHints) } + +// NodeActionTarget is what building an agent action command needs from a node. +type NodeActionTarget struct { + NodeID string + Nodename string + OSName string + ActionType string + Collector string + ConnectTo string +} + +// NodeActionTargetByID returns the node fields the action queue entry is built from. +func (oDb *DB) NodeActionTargetByID(ctx context.Context, nodeID string) (*NodeActionTarget, error) { + const query = "SELECT node_id, COALESCE(nodename, ''), COALESCE(os_name, ''), COALESCE(action_type, '')," + + " COALESCE(collector, ''), COALESCE(connect_to, '') FROM nodes WHERE node_id = ?" + var t NodeActionTarget + err := oDb.DB.QueryRowContext(ctx, query, nodeID). + Scan(&t.NodeID, &t.Nodename, &t.OSName, &t.ActionType, &t.Collector, &t.ConnectTo) + switch { + case errors.Is(err, sql.ErrNoRows): + return nil, nil + case err != nil: + return nil, fmt.Errorf("nodeActionTargetByID: %w", err) + } + return &t, nil +} + +// NodeReachableAddress returns the address an action should connect to, mirroring +// get_reachable_name() of the python collector: the explicit connect_to, else the +// best routable address of the node, else its name. +func (oDb *DB) NodeReachableAddress(ctx context.Context, t *NodeActionTarget) (string, error) { + if t.ConnectTo != "" { + return t.ConnectTo, nil + } + const query = "SELECT addr FROM v_nodenetworks WHERE node_id = ?" + + " AND mask IS NOT NULL AND mask != '' AND flag_deprecated = 0" + + " AND net_gateway IS NOT NULL AND net_gateway != '' AND net_gateway != '0.0.0.0'" + + " ORDER BY prio DESC, type LIMIT 1" + var addr string + err := oDb.DB.QueryRowContext(ctx, query, t.NodeID).Scan(&addr) + switch { + case errors.Is(err, sql.ErrNoRows): + return t.Nodename, nil + case err != nil: + return "", fmt.Errorf("nodeReachableAddress: %w", err) + } + return addr, nil +} + +// EnqueueNodeAction posts a node action to the action queue and returns its id. +func (oDb *DB) EnqueueNodeAction(ctx context.Context, nodeID, actionType, command, connectTo string, userID *int64) (int64, error) { + const query = "INSERT INTO action_queue (node_id, svc_id, action_type, command, user_id, connect_to)" + + " VALUES (?, '', ?, ?, ?, ?)" + res, err := oDb.ExecContext(ctx, query, nodeID, actionType, command, userID, connectTo) + if err != nil { + return 0, fmt.Errorf("enqueueNodeAction: %w", err) + } + id, err := res.LastInsertId() + if err != nil { + return 0, fmt.Errorf("enqueueNodeAction lastInsertId: %w", err) + } + oDb.SetChange("action_queue") + return id, nil +} + +// ServiceLiveNode returns a node of the service seen alive in the last 15 minutes, +// as get_svc_live_nodes() does, plus the agent version an action command needs. +func (oDb *DB) ServiceLiveNode(ctx context.Context, svcID string) (*NodeActionTarget, string, error) { + const query = "SELECT nodes.node_id, COALESCE(nodes.nodename, ''), COALESCE(nodes.os_name, '')," + + " COALESCE(nodes.action_type, ''), COALESCE(nodes.collector, ''), COALESCE(nodes.connect_to, '')," + + " COALESCE(nodes.version, '')" + + " FROM svcmon JOIN nodes ON nodes.node_id = svcmon.node_id" + + " WHERE svcmon.svc_id = ? AND nodes.last_comm > NOW() - INTERVAL 15 MINUTE" + + " ORDER BY nodes.nodename LIMIT 1" + var t NodeActionTarget + var version string + err := oDb.DB.QueryRowContext(ctx, query, svcID). + Scan(&t.NodeID, &t.Nodename, &t.OSName, &t.ActionType, &t.Collector, &t.ConnectTo, &version) + switch { + case errors.Is(err, sql.ErrNoRows): + return nil, "", nil + case err != nil: + return nil, "", fmt.Errorf("serviceLiveNode: %w", err) + } + return &t, version, nil +} + +// NodeAgentVersion returns the agent version reported by a node, empty when unknown. +func (oDb *DB) NodeAgentVersion(ctx context.Context, nodeID string) (string, error) { + var version string + err := oDb.DB.QueryRowContext(ctx, "SELECT COALESCE(version, '') FROM nodes WHERE node_id = ?", nodeID).Scan(&version) + switch { + case errors.Is(err, sql.ErrNoRows): + return "", nil + case err != nil: + return "", fmt.Errorf("nodeAgentVersion: %w", err) + } + return version, nil +} + +// HasServiceInstance reports whether the service runs on that node. +func (oDb *DB) HasServiceInstance(ctx context.Context, svcID, nodeID string) (bool, error) { + var one int + err := oDb.DB.QueryRowContext(ctx, + "SELECT 1 FROM svcmon WHERE svc_id = ? AND node_id = ? LIMIT 1", svcID, nodeID).Scan(&one) + switch { + case errors.Is(err, sql.ErrNoRows): + return false, nil + case err != nil: + return false, fmt.Errorf("hasServiceInstance: %w", err) + } + return true, nil +} + +// EnqueueServiceAction posts a service action to the action queue and returns its id. +func (oDb *DB) EnqueueServiceAction(ctx context.Context, nodeID, svcID, actionType, command, connectTo string, userID *int64) (int64, error) { + const query = "INSERT INTO action_queue (node_id, svc_id, action_type, command, user_id, connect_to)" + + " VALUES (?, ?, ?, ?, ?, ?)" + res, err := oDb.ExecContext(ctx, query, nodeID, svcID, actionType, command, userID, connectTo) + if err != nil { + return 0, fmt.Errorf("enqueueServiceAction: %w", err) + } + id, err := res.LastInsertId() + if err != nil { + return 0, fmt.Errorf("enqueueServiceAction lastInsertId: %w", err) + } + oDb.SetChange("action_queue") + return id, nil +} diff --git a/cdb/db_apps.go b/cdb/db_apps.go index ce237a88..4da766c7 100644 --- a/cdb/db_apps.go +++ b/cdb/db_apps.go @@ -62,7 +62,7 @@ func scanApps(rows *sql.Rows) ([]App, error) { return apps, nil } -func buildAppsQuery(groups []string, isManager bool, selectExprs []string) (string, []any, error) { +func buildAppsQuery(groups []string, isManager bool, selectExprs []string, filters []ColumnFilter) (string, []any, error) { q := From(schema.TApps). Distinct(). RawSelect(selectExprs...) @@ -75,6 +75,9 @@ func buildAppsQuery(groups []string, isManager bool, selectExprs []string) (stri q = q.Where(schema.AppsID, ">", 0) } + // Column filters of the request, ANDed with the access control above. + q = q.WhereFilters(filters) + query, args, err := q.Build() if err != nil { return "", nil, fmt.Errorf("buildAppsQuery: %w", err) @@ -87,11 +90,11 @@ func buildAppsQueryAll(groups []string, isManager bool) (string, []any, error) { "apps.id", "apps.app", "COALESCE(apps.updated, '')", "COALESCE(apps.app_domain, '')", "COALESCE(apps.app_team_ops, '')", "COALESCE(apps.description, '')", - }) + }, nil) } func (oDb *DB) GetApps(ctx context.Context, p ListParams) ([]map[string]any, error) { - query, args, err := buildAppsQuery(p.Groups, p.IsManager, p.SelectExprs) + query, args, err := buildAppsQuery(p.Groups, p.IsManager, p.SelectExprs, p.Filters) if err != nil { return nil, err } @@ -366,7 +369,7 @@ func (oDb *DB) GetAppNodes(ctx context.Context, appIDOrName string, p ListParams } } - query, args, err := buildNodesQuery(p.Groups, p.IsManager, p.SelectExprs) + query, args, err := buildNodesQuery(p.Groups, p.IsManager, p.SelectExprs, p.Filters) if err != nil { return nil, err } @@ -407,7 +410,7 @@ func (oDb *DB) GetAppServices(ctx context.Context, appIDOrName string, p ListPar } } - query, args, err := buildServicesQuery(p.Groups, p.IsManager, p.SelectExprs) + query, args, err := buildServicesQuery(p.Groups, p.IsManager, p.SelectExprs, p.Filters) if err != nil { return nil, err } diff --git a/cdb/db_auth_group.go b/cdb/db_auth_group.go index 3c603d0c..9fecaad9 100644 --- a/cdb/db_auth_group.go +++ b/cdb/db_auth_group.go @@ -26,6 +26,11 @@ func (oDb *DB) GetGroups(ctx context.Context, p ListParams) ([]map[string]any, e args = append(args, stringsToAny(cleanG)...) } } + filterConds, filterArgs := p.FilterConditions() + for _, cond := range filterConds { + query += " AND " + cond + } + args = append(args, filterArgs...) if gb := p.GroupByClause(""); gb != "" { query += " " + gb } diff --git a/cdb/db_compliance.go b/cdb/db_compliance.go index 214d2dd2..646524c6 100644 --- a/cdb/db_compliance.go +++ b/cdb/db_compliance.go @@ -333,8 +333,8 @@ func (oDb *DB) CompNodeModulesets(ctx context.Context, nodeID string) (moduleset // CompServiceModulesets returns the modset ids attached to a service func (oDb *DB) CompServiceModulesets(ctx context.Context, svcID string, slave bool) (modulesets []int, err error) { - const query = `SELECT modset_id FROM comp_modulesets_services WHERE svc_id = ? AND slave = ?` - rows, err := oDb.DB.QueryContext(ctx, query, svcID, slave) + query := `SELECT modset_id FROM comp_modulesets_services WHERE svc_id = ? AND ` + compSlaveCond("slave", slave) + rows, err := oDb.DB.QueryContext(ctx, query, svcID) if err != nil { return nil, err } @@ -421,8 +421,8 @@ func (oDb *DB) CompServiceCandidateModulesets(ctx context.Context, svcID string, // CompServiceRulesets returns the ruleset ids attached to a service func (oDb *DB) CompServiceRulesets(ctx context.Context, svcID string, slave bool) (rulesets []int, err error) { - const query = `SELECT ruleset_id FROM comp_rulesets_services WHERE svc_id = ? AND slave = ?` - rows, err := oDb.DB.QueryContext(ctx, query, svcID, slave) + query := `SELECT ruleset_id FROM comp_rulesets_services WHERE svc_id = ? AND ` + compSlaveCond("slave", slave) + rows, err := oDb.DB.QueryContext(ctx, query, svcID) if err != nil { return nil, err } @@ -723,10 +723,10 @@ func (oDb *DB) CompServiceAttachedModulesets(ctx context.Context, svcID string, SELECT comp_moduleset.id, comp_moduleset.modset_name, comp_moduleset.modset_author, comp_moduleset.modset_updated FROM comp_moduleset JOIN comp_modulesets_services ON comp_moduleset.id = comp_modulesets_services.modset_id - WHERE comp_modulesets_services.svc_id = ? AND comp_modulesets_services.slave = ? + WHERE comp_modulesets_services.svc_id = ? AND ` + compSlaveCond("comp_modulesets_services.slave", slave) + ` ` - args := []any{svcID, slave} + args := []any{svcID} filter, filterArgs, err := QFilter(ctx, QFilterInput{ SvcField: "comp_modulesets_services.svc_id", IsManager: isManager, @@ -774,10 +774,10 @@ func (oDb *DB) CompServiceAttachedRulesets(ctx context.Context, svcID string, sl SELECT comp_rulesets.id, comp_rulesets.ruleset_name, comp_rulesets.ruleset_public, comp_rulesets.ruleset_type FROM comp_rulesets JOIN comp_rulesets_services ON comp_rulesets.id = comp_rulesets_services.ruleset_id - WHERE comp_rulesets_services.svc_id = ? AND comp_rulesets_services.slave = ? + WHERE comp_rulesets_services.svc_id = ? AND ` + compSlaveCond("comp_rulesets_services.slave", slave) + ` ` - args := []any{svcID, slave} + args := []any{svcID} filter, filterArgs, err := QFilter(ctx, QFilterInput{ SvcField: "comp_rulesets_services.svc_id", IsManager: isManager, @@ -974,10 +974,10 @@ func (oDb *DB) CompModulesetAttachNode(ctx context.Context, nodeID, modulesetID // CompModulesetSvcAttached checks if a moduleset is already attached to a service. func (oDb *DB) CompModulesetSvcAttached(ctx context.Context, svcID, modulesetID string, slave bool) (bool, error) { - const query = "SELECT EXISTS(SELECT 1 FROM comp_modulesets_services WHERE svc_id = ? AND modset_id = ? AND slave = ?)" + query := "SELECT EXISTS(SELECT 1 FROM comp_modulesets_services WHERE svc_id = ? AND modset_id = ? AND " + compSlaveCond("slave", slave) + ")" var exists bool - err := oDb.DB.QueryRowContext(ctx, query, svcID, modulesetID, slave).Scan(&exists) + err := oDb.DB.QueryRowContext(ctx, query, svcID, modulesetID).Scan(&exists) if err != nil { return false, fmt.Errorf("compModulesetSvcAttached: %w", err) } @@ -1019,7 +1019,7 @@ func (oDb *DB) CompModulesetSvcAttachable(ctx context.Context, svcID, modulesetI func (oDb *DB) CompModulesetAttachService(ctx context.Context, svcID, modulesetID string, slave bool) (int64, error) { const query = "INSERT INTO comp_modulesets_services (svc_id, modset_id, slave) VALUES (?, ?, ?)" - result, err := oDb.ExecContext(ctx, query, svcID, modulesetID, slave) + result, err := oDb.ExecContext(ctx, query, svcID, modulesetID, compSlaveFlag(slave)) if err != nil { return 0, fmt.Errorf("compModulesetAttachService: %w", err) } @@ -1035,9 +1035,9 @@ func (oDb *DB) CompModulesetAttachService(ctx context.Context, svcID, modulesetI // CompModulesetDetachService detaches a moduleset from a service. func (oDb *DB) CompModulesetDetachService(ctx context.Context, svcID, modulesetID string, slave bool) (int64, error) { - const query = "DELETE FROM comp_modulesets_services WHERE svc_id = ? AND modset_id = ? AND slave = ?" + query := "DELETE FROM comp_modulesets_services WHERE svc_id = ? AND modset_id = ? AND " + compSlaveCond("slave", slave) - result, err := oDb.ExecContext(ctx, query, svcID, modulesetID, slave) + result, err := oDb.ExecContext(ctx, query, svcID, modulesetID) if err != nil { return 0, fmt.Errorf("compModulesetDetachService: %w", err) } @@ -1057,10 +1057,10 @@ func (oDb *DB) CompModulesetDetachService(ctx context.Context, svcID, modulesetI // CompRulesetSvcAttached checks if a ruleset is already attached to a service. func (oDb *DB) CompRulesetSvcAttached(ctx context.Context, svcID, rulesetID string, slave bool) (bool, error) { - const query = "SELECT EXISTS(SELECT 1 FROM comp_rulesets_services WHERE svc_id = ? AND ruleset_id = ? AND slave = ?)" + query := "SELECT EXISTS(SELECT 1 FROM comp_rulesets_services WHERE svc_id = ? AND ruleset_id = ? AND " + compSlaveCond("slave", slave) + ")" var exists bool - err := oDb.DB.QueryRowContext(ctx, query, svcID, rulesetID, slave).Scan(&exists) + err := oDb.DB.QueryRowContext(ctx, query, svcID, rulesetID).Scan(&exists) if err != nil { return false, fmt.Errorf("compRulesetSvcAttached: %w", err) } @@ -1104,7 +1104,7 @@ func (oDb *DB) CompRulesetSvcAttachable(ctx context.Context, svcID, rulesetID st func (oDb *DB) CompRulesetAttachService(ctx context.Context, svcID, rulesetID string, slave bool) (int64, error) { const query = "INSERT INTO comp_rulesets_services (svc_id, ruleset_id, slave) VALUES (?, ?, ?)" - result, err := oDb.ExecContext(ctx, query, svcID, rulesetID, slave) + result, err := oDb.ExecContext(ctx, query, svcID, rulesetID, compSlaveFlag(slave)) if err != nil { return 0, fmt.Errorf("compRulesetAttachService: %w", err) } @@ -1120,9 +1120,9 @@ func (oDb *DB) CompRulesetAttachService(ctx context.Context, svcID, rulesetID st // CompRulesetDetachService detaches a ruleset from a service. func (oDb *DB) CompRulesetDetachService(ctx context.Context, svcID, rulesetID string, slave bool) (int64, error) { - const query = "DELETE FROM comp_rulesets_services WHERE svc_id = ? AND ruleset_id = ? AND slave = ?" + query := "DELETE FROM comp_rulesets_services WHERE svc_id = ? AND ruleset_id = ? AND " + compSlaveCond("slave", slave) - result, err := oDb.ExecContext(ctx, query, svcID, rulesetID, slave) + result, err := oDb.ExecContext(ctx, query, svcID, rulesetID) if err != nil { return 0, fmt.Errorf("compRulesetDetachService: %w", err) } @@ -1261,3 +1261,23 @@ func (oDb *DB) GetNodeComplianceStatus(ctx context.Context, nodeID string, p Lis return scanRowsToMaps(rows, p.Props, p.TypeHints) } + +// compSlaveFlag is the stored value of the slave flag of a service attachment: +// "T" or "F", as the historical collector's web2py boolean fields store it. +func compSlaveFlag(slave bool) string { + if slave { + return "T" + } + return "F" +} + +// compSlaveCond selects the service attachments of the given slave flag, stored +// "T" or "F" by the historical collector and, before this was fixed, 1 or 0 by +// oc3: comparing the varchar(1) column with a boolean would cast "T" and "F" to +// 0 alike. +func compSlaveCond(col string, slave bool) string { + if slave { + return col + " IN ('T', '1')" + } + return "(" + col + " IS NULL OR " + col + " NOT IN ('T', '1'))" +} diff --git a/cdb/db_compliance_api.go b/cdb/db_compliance_api.go new file mode 100644 index 00000000..7050f51e --- /dev/null +++ b/cdb/db_compliance_api.go @@ -0,0 +1,113 @@ +package cdb + +import ( + "context" + "database/sql" + "errors" + "fmt" +) + +// compPublishedNodesCond restricts a node_id column to the nodes the caller may +// see, as q_filter(node_field=...) of the historical collector: those whose app is +// published to one of the caller's groups; every node for a manager. +func compPublishedNodesCond(nodeCol string, groups []string, isManager bool) (string, []any) { + if isManager { + return "1=1", nil + } + clean := cleanGroups(groups) + if len(clean) == 0 { + return "1=0", nil + } + args := make([]any, len(clean)) + for i, g := range clean { + args[i] = g + } + return nodeCol + " IN (SELECT n.node_id FROM nodes n" + + " JOIN apps a ON a.app = n.app" + + " JOIN apps_publications ap ON ap.app_id = a.id" + + " JOIN auth_group ag ON ag.id = ap.group_id" + + " WHERE ag.role IN (" + Placeholders(len(clean)) + "))", args +} + +// compLogFrom joins the node and the service of a run, for their names. +const compLogFrom = "comp_log" + + " LEFT JOIN nodes ON nodes.node_id = comp_log.node_id" + + " LEFT JOIN services ON services.svc_id = comp_log.svc_id" + +// GetComplianceLogs lists the compliance module runs (check, fixable, fix) of the +// nodes the caller may see, the most recent first; one when id is set. A non-nil +// fsetNodeIDs restricts the runs to those nodes, the ones a filterset selects, +// as apply_filters_id() does on the node of a run. +func (oDb *DB) GetComplianceLogs(ctx context.Context, id *int64, fsetNodeIDs []string, p ListParams) ([]map[string]any, error) { + cond, args := compPublishedNodesCond("comp_log.node_id", p.Groups, p.IsManager) + conds := []string{cond} + if id != nil { + conds = append(conds, "comp_log.id = ?") + args = append(args, *id) + } + if fsetNodeIDs != nil { + if len(fsetNodeIDs) == 0 { + conds = append(conds, "1=0") + } else { + conds = append(conds, "comp_log.node_id IN ("+Placeholders(len(fsetNodeIDs))+")") + for _, nodeID := range fsetNodeIDs { + args = append(args, nodeID) + } + } + } + return oDb.listQuery(ctx, "getComplianceLogs", compLogFrom, conds, args, "comp_log.id DESC", p) +} + +// GetComplianceStatus lists the last check run of each module-node-service tuple, +// for the nodes the caller may see; one when id is set. +func (oDb *DB) GetComplianceStatus(ctx context.Context, id *int64, p ListParams) ([]map[string]any, error) { + cond, args := compPublishedNodesCond("comp_status.node_id", p.Groups, p.IsManager) + conds := []string{cond} + if id != nil { + conds = append(conds, "comp_status.id = ?") + args = append(args, *id) + } + return oDb.listQuery(ctx, "getComplianceStatus", "comp_status", conds, args, "comp_status.id DESC", p) +} + +// CompStatusRun is the last check run of a module on a node, or on a service +// instance on that node. +type CompStatusRun struct { + ID int64 + RunModule string + NodeID string + SvcID string + Nodename string + Svcname string +} + +// CompStatusRunVisible returns a check run of a node the caller may see, nil when +// there is none. +func (oDb *DB) CompStatusRunVisible(ctx context.Context, id int64, groups []string, isManager bool) (*CompStatusRun, error) { + cond, args := compPublishedNodesCond("comp_status.node_id", groups, isManager) + query := "SELECT comp_status.id, comp_status.run_module, COALESCE(comp_status.node_id, ''), COALESCE(comp_status.svc_id, '')," + + " COALESCE(nodes.nodename, ''), COALESCE(services.svcname, '')" + + " FROM comp_status" + + " LEFT JOIN nodes ON nodes.node_id = comp_status.node_id" + + " LEFT JOIN services ON services.svc_id = comp_status.svc_id" + + " WHERE comp_status.id = ? AND " + cond + var r CompStatusRun + err := oDb.DB.QueryRowContext(ctx, query, append([]any{id}, args...)...). + Scan(&r.ID, &r.RunModule, &r.NodeID, &r.SvcID, &r.Nodename, &r.Svcname) + switch { + case errors.Is(err, sql.ErrNoRows): + return nil, nil + case err != nil: + return nil, fmt.Errorf("compStatusRunVisible: %w", err) + } + return &r, nil +} + +// DeleteCompStatusRun deletes a check run. +func (oDb *DB) DeleteCompStatusRun(ctx context.Context, id int64) error { + if _, err := oDb.DB.ExecContext(ctx, "DELETE FROM comp_status WHERE id = ?", id); err != nil { + return fmt.Errorf("deleteCompStatusRun: %w", err) + } + oDb.SetChange("comp_status") + return nil +} diff --git a/cdb/db_compliance_attachments.go b/cdb/db_compliance_attachments.go new file mode 100644 index 00000000..fd18ac12 --- /dev/null +++ b/cdb/db_compliance_attachments.go @@ -0,0 +1,71 @@ +package cdb + +import ( + "context" +) + +// compPublishedServicesCond restricts a svc_id column to the services the caller +// may see, as q_filter(svc_field=...): those whose app is published to one of the +// caller's groups; every service for a manager. +func compPublishedServicesCond(svcCol string, groups []string, isManager bool) (string, []any) { + if isManager { + return "1=1", nil + } + cond, args := rolesCond("ag", groups, false) + return svcCol + " IN (SELECT s.svc_id FROM services s" + + " JOIN apps a ON a.app = s.svc_app" + + " JOIN apps_publications ap ON ap.app_id = a.id" + + " JOIN auth_group ag ON ag.id = ap.group_id" + + " WHERE " + cond + ")", args +} + +// GetCompObjectNodes lists the nodes a ruleset or a moduleset is attached to, +// or with candidates the nodes it may be attached to: those whose responsible +// team is one of its publication groups, not attached yet. Both are restricted +// to the nodes the caller may see. +func (oDb *DB) GetCompObjectNodes(ctx context.Context, k CompKind, objID int64, candidates bool, p ListParams) ([]map[string]any, error) { + attached := "SELECT node_id FROM " + k.NodesTable + " WHERE " + k.FK + " = ?" + var conds []string + var args []any + if candidates { + conds = append(conds, + "nodes.team_responsible IN (SELECT ag.role FROM "+k.TeamPrefix+"publication tp"+ + " JOIN auth_group ag ON ag.id = tp.group_id WHERE tp."+k.FK+" = ?)", + "nodes.node_id NOT IN ("+attached+")") + args = append(args, objID, objID) + } else { + conds = append(conds, "nodes.node_id IN ("+attached+")") + args = append(args, objID) + } + cond, condArgs := compPublishedNodesCond("nodes.node_id", p.Groups, p.IsManager) + conds = append(conds, cond) + args = append(args, condArgs...) + return oDb.listQuery(ctx, "getCompObjectNodes", "nodes", conds, args, "nodes.nodename", p) +} + +// GetCompObjectServices lists the services a ruleset or a moduleset is attached +// to, as the service itself or with slave as its encapsulated service; or with +// candidates the services it may be attached to: those whose app has one of its +// publication groups among its responsibles, not attached yet. Both are +// restricted to the services the caller may see. +func (oDb *DB) GetCompObjectServices(ctx context.Context, k CompKind, objID int64, slave, candidates bool, p ListParams) ([]map[string]any, error) { + attached := "SELECT svc_id FROM " + k.ServicesTable + " WHERE " + k.FK + " = ? AND " + compSlaveCond("slave", slave) + var conds []string + var args []any + if candidates { + conds = append(conds, + "services.svc_app IN (SELECT a.app FROM apps a"+ + " JOIN apps_responsibles ar ON ar.app_id = a.id"+ + " JOIN "+k.TeamPrefix+"publication tp ON tp.group_id = ar.group_id"+ + " WHERE tp."+k.FK+" = ?)", + "services.svc_id NOT IN ("+attached+")") + args = append(args, objID, objID) + } else { + conds = append(conds, "services.svc_id IN ("+attached+")") + args = append(args, objID) + } + cond, condArgs := compPublishedServicesCond("services.svc_id", p.Groups, p.IsManager) + conds = append(conds, cond) + args = append(args, condArgs...) + return oDb.listQuery(ctx, "getCompObjectServices", "services", conds, args, "services.svcname", p) +} diff --git a/cdb/db_compliance_export.go b/cdb/db_compliance_export.go new file mode 100644 index 00000000..3fc338cc --- /dev/null +++ b/cdb/db_compliance_export.go @@ -0,0 +1,366 @@ +package cdb + +import ( + "context" + "database/sql" + "fmt" + "sort" + "strings" +) + +type ( + // CompExportVariable is a ruleset variable, as _export_rulesets() writes it. + CompExportVariable struct { + ID int64 `json:"id"` + VarName string `json:"var_name"` + VarValue string `json:"var_value"` + VarClass string `json:"var_class"` + VarAuthor string `json:"var_author"` + VarUpdated string `json:"var_updated"` + } + + // CompExportRuleset is a ruleset with its variables, children, filterset and + // groups, by name. + CompExportRuleset struct { + ID int64 `json:"id"` + RulesetName string `json:"ruleset_name"` + RulesetPublic string `json:"ruleset_public"` + RulesetType string `json:"ruleset_type"` + FsetName *string `json:"fset_name"` + Variables []CompExportVariable `json:"variables"` + Rulesets []string `json:"rulesets"` + Publications []string `json:"publications"` + Responsibles []string `json:"responsibles"` + } + + // CompExportModule is a moduleset module. + CompExportModule struct { + ModsetModName string `json:"modset_mod_name"` + Autofix string `json:"autofix"` + } + + // CompExportModuleset is a moduleset with its modules, children, rulesets and + // groups, by name. + CompExportModuleset struct { + ID int64 `json:"id"` + ModsetName string `json:"modset_name"` + Modules []CompExportModule `json:"modules"` + Modulesets []string `json:"modulesets"` + Rulesets []string `json:"rulesets"` + Publications []string `json:"publications"` + Responsibles []string `json:"responsibles"` + } + + // CompRulesetExport is the export of rulesets: the rulesets and their + // descendants, and the filtersets they use. + CompRulesetExport struct { + Filtersets []FiltersetExport `json:"filtersets"` + Rulesets []CompExportRuleset `json:"rulesets"` + } + + // CompModulesetExport is the export of modulesets: the modulesets and their + // descendants, with the rulesets they hold. + CompModulesetExport struct { + CompRulesetExport + Modulesets []CompExportModuleset `json:"modulesets"` + } +) + +// CompPublishedIDs returns the ids of the compliance objects published to the +// caller, as the historical export handlers select them. +func (oDb *DB) CompPublishedIDs(ctx context.Context, k CompKind, groups []string, isManager bool) ([]int64, error) { + cond, args := compObjectVisibleCond(k, groups, isManager) + return oDb.int64s(ctx, "compPublishedIDs", "SELECT "+k.Table+".id FROM "+k.Table+" WHERE "+cond+" ORDER BY "+k.Table+".id", args...) +} + +func (oDb *DB) int64s(ctx context.Context, name, query string, args ...any) ([]int64, error) { + rows, err := oDb.DB.QueryContext(ctx, query, args...) + if err != nil { + return nil, fmt.Errorf("%s: %w", name, err) + } + defer func() { _ = rows.Close() }() + var ids []int64 + for rows.Next() { + var id int64 + if err := rows.Scan(&id); err != nil { + return nil, fmt.Errorf("%s: %w", name, err) + } + ids = append(ids, id) + } + return ids, rows.Err() +} + +// compPairs reads parent-child id pairs. +func (oDb *DB) compPairs(ctx context.Context, name, query string) (map[int64][]int64, error) { + rows, err := oDb.DB.QueryContext(ctx, query) + if err != nil { + return nil, fmt.Errorf("%s: %w", name, err) + } + defer func() { _ = rows.Close() }() + pairs := map[int64][]int64{} + for rows.Next() { + var p, c int64 + if err := rows.Scan(&p, &c); err != nil { + return nil, fmt.Errorf("%s: %w", name, err) + } + pairs[p] = append(pairs[p], c) + } + return pairs, rows.Err() +} + +// withDescendants returns the ids and all the children reachable from them. +func withDescendants(ids []int64, children map[int64][]int64) []int64 { + seen := map[int64]bool{} + todo := append([]int64{}, ids...) + var all []int64 + for len(todo) > 0 { + id := todo[0] + todo = todo[1:] + if seen[id] { + continue + } + seen[id] = true + all = append(all, id) + todo = append(todo, children[id]...) + } + sort.Slice(all, func(i, j int) bool { return all[i] < all[j] }) + return all +} + +func idArgs(ids []int64) (string, []any) { + args := make([]any, len(ids)) + for i, id := range ids { + args[i] = id + } + return Placeholders(len(ids)), args +} + +// compNames returns the names of the objects of a table, by id. +func (oDb *DB) compNames(ctx context.Context, table, nameCol string) (map[int64]string, error) { + rows, err := oDb.DB.QueryContext(ctx, "SELECT id, COALESCE("+nameCol+", '') FROM "+table) + if err != nil { + return nil, fmt.Errorf("compNames %s: %w", table, err) + } + defer func() { _ = rows.Close() }() + names := map[int64]string{} + for rows.Next() { + var id int64 + var name string + if err := rows.Scan(&id, &name); err != nil { + return nil, fmt.Errorf("compNames %s: %w", table, err) + } + names[id] = name + } + return names, rows.Err() +} + +// compTeamRoles returns the roles of the publication or responsible groups of +// the given objects, by object id. +func (oDb *DB) compTeamRoles(ctx context.Context, k CompKind, gtype string, ids []int64) (map[int64][]string, error) { + table, err := k.teamTable(gtype) + if err != nil { + return nil, err + } + ph, args := idArgs(ids) + rows, err := oDb.DB.QueryContext(ctx, "SELECT t."+k.FK+", ag.role FROM "+table+" t JOIN auth_group ag ON ag.id = t.group_id"+ + " WHERE t."+k.FK+" IN ("+ph+") ORDER BY ag.role", args...) + if err != nil { + return nil, fmt.Errorf("compTeamRoles: %w", err) + } + defer func() { _ = rows.Close() }() + roles := map[int64][]string{} + for rows.Next() { + var id int64 + var role string + if err := rows.Scan(&id, &role); err != nil { + return nil, fmt.Errorf("compTeamRoles: %w", err) + } + roles[id] = append(roles[id], role) + } + return roles, rows.Err() +} + +func mapNames(ids []int64, names map[int64]string) []string { + out := make([]string, 0, len(ids)) + for _, id := range ids { + out = append(out, names[id]) + } + sort.Strings(out) + return out +} + +func orEmpty(l []string) []string { + if l == nil { + return []string{} + } + return l +} + +// ExportCompRulesets exports rulesets and their descendants, with the +// filtersets they use, in the format ImportCompliance reads, as +// _export_rulesets(). +func (oDb *DB) ExportCompRulesets(ctx context.Context, ids []int64) (CompRulesetExport, error) { + out := CompRulesetExport{Filtersets: []FiltersetExport{}, Rulesets: []CompExportRuleset{}} + if len(ids) == 0 { + return out, nil + } + children, err := oDb.compPairs(ctx, "exportCompRulesets", "SELECT parent_rset_id, child_rset_id FROM comp_rulesets_rulesets") + if err != nil { + return out, err + } + names, err := oDb.compNames(ctx, "comp_rulesets", "ruleset_name") + if err != nil { + return out, err + } + all := withDescendants(ids, children) + ph, args := idArgs(all) + + variables := map[int64][]CompExportVariable{} + rows, err := oDb.DB.QueryContext(ctx, "SELECT id, ruleset_id, COALESCE(var_name, ''), COALESCE(var_value, ''), COALESCE(var_class, ''),"+ + " COALESCE(var_author, ''), COALESCE(DATE_FORMAT(var_updated, '%Y-%m-%d %H:%i:%s'), '')"+ + " FROM comp_rulesets_variables WHERE ruleset_id IN ("+ph+") ORDER BY var_name", args...) + if err != nil { + return out, fmt.Errorf("exportCompRulesets variables: %w", err) + } + for rows.Next() { + var v CompExportVariable + var rid int64 + if err := rows.Scan(&v.ID, &rid, &v.VarName, &v.VarValue, &v.VarClass, &v.VarAuthor, &v.VarUpdated); err != nil { + _ = rows.Close() + return out, fmt.Errorf("exportCompRulesets variables: %w", err) + } + variables[rid] = append(variables[rid], v) + } + _ = rows.Close() + + publications, err := oDb.compTeamRoles(ctx, CompRulesetKind, "publication", all) + if err != nil { + return out, err + } + responsibles, err := oDb.compTeamRoles(ctx, CompRulesetKind, "responsible", all) + if err != nil { + return out, err + } + + var fsetIDs []int + rows, err = oDb.DB.QueryContext(ctx, "SELECT r.id, COALESCE(r.ruleset_name, ''), COALESCE(r.ruleset_public, ''), COALESCE(r.ruleset_type, ''), f.id, f.fset_name"+ + " FROM comp_rulesets r LEFT JOIN comp_rulesets_filtersets rf ON rf.ruleset_id = r.id LEFT JOIN gen_filtersets f ON f.id = rf.fset_id"+ + " WHERE r.id IN ("+ph+") ORDER BY r.ruleset_name", args...) + if err != nil { + return out, fmt.Errorf("exportCompRulesets: %w", err) + } + for rows.Next() { + var r CompExportRuleset + var fsetID sql.NullInt64 + var fsetName sql.NullString + if err := rows.Scan(&r.ID, &r.RulesetName, &r.RulesetPublic, &r.RulesetType, &fsetID, &fsetName); err != nil { + _ = rows.Close() + return out, fmt.Errorf("exportCompRulesets: %w", err) + } + if fsetID.Valid { + fsetIDs = append(fsetIDs, int(fsetID.Int64)) + name := fsetName.String + r.FsetName = &name + } + r.Variables = variables[r.ID] + if r.Variables == nil { + r.Variables = []CompExportVariable{} + } + r.Rulesets = mapNames(children[r.ID], names) + r.Publications = orEmpty(publications[r.ID]) + r.Responsibles = orEmpty(responsibles[r.ID]) + out.Rulesets = append(out.Rulesets, r) + } + _ = rows.Close() + + fsets, err := oDb.ExportFiltersets(ctx, fsetIDs) + if err != nil { + return out, err + } + out.Filtersets = fsets.Filtersets + return out, nil +} + +// ExportCompModulesets exports modulesets and their descendants, with the +// rulesets they hold, in the format ImportCompliance reads, as +// _export_modulesets(). +func (oDb *DB) ExportCompModulesets(ctx context.Context, ids []int64) (CompModulesetExport, error) { + out := CompModulesetExport{Modulesets: []CompExportModuleset{}} + out.Filtersets = []FiltersetExport{} + out.Rulesets = []CompExportRuleset{} + if len(ids) == 0 { + return out, nil + } + children, err := oDb.compPairs(ctx, "exportCompModulesets", "SELECT parent_modset_id, child_modset_id FROM comp_moduleset_moduleset") + if err != nil { + return out, err + } + rulesets, err := oDb.compPairs(ctx, "exportCompModulesets", "SELECT modset_id, ruleset_id FROM comp_moduleset_ruleset") + if err != nil { + return out, err + } + names, err := oDb.compNames(ctx, "comp_moduleset", "modset_name") + if err != nil { + return out, err + } + rsetNames, err := oDb.compNames(ctx, "comp_rulesets", "ruleset_name") + if err != nil { + return out, err + } + all := withDescendants(ids, children) + ph, args := idArgs(all) + + modules := map[int64][]CompExportModule{} + rows, err := oDb.DB.QueryContext(ctx, "SELECT modset_id, COALESCE(modset_mod_name, ''), COALESCE(autofix, '')"+ + " FROM comp_moduleset_modules WHERE modset_id IN ("+ph+") ORDER BY modset_mod_name", args...) + if err != nil { + return out, fmt.Errorf("exportCompModulesets modules: %w", err) + } + for rows.Next() { + var m CompExportModule + var mid int64 + if err := rows.Scan(&mid, &m.ModsetModName, &m.Autofix); err != nil { + _ = rows.Close() + return out, fmt.Errorf("exportCompModulesets modules: %w", err) + } + modules[mid] = append(modules[mid], m) + } + _ = rows.Close() + + publications, err := oDb.compTeamRoles(ctx, CompModulesetKind, "publication", all) + if err != nil { + return out, err + } + responsibles, err := oDb.compTeamRoles(ctx, CompModulesetKind, "responsible", all) + if err != nil { + return out, err + } + + var rsetIDs []int64 + for _, id := range all { + m := CompExportModuleset{ + ID: id, + ModsetName: names[id], + Modules: modules[id], + Modulesets: mapNames(children[id], names), + Rulesets: mapNames(rulesets[id], rsetNames), + Publications: orEmpty(publications[id]), + Responsibles: orEmpty(responsibles[id]), + } + if m.Modules == nil { + m.Modules = []CompExportModule{} + } + rsetIDs = append(rsetIDs, rulesets[id]...) + out.Modulesets = append(out.Modulesets, m) + } + sort.Slice(out.Modulesets, func(i, j int) bool { + return strings.ToLower(out.Modulesets[i].ModsetName) < strings.ToLower(out.Modulesets[j].ModsetName) + }) + + rsets, err := oDb.ExportCompRulesets(ctx, rsetIDs) + if err != nil { + return out, err + } + out.CompRulesetExport = rsets + return out, nil +} diff --git a/cdb/db_compliance_import.go b/cdb/db_compliance_import.go new file mode 100644 index 00000000..9454bf86 --- /dev/null +++ b/cdb/db_compliance_import.go @@ -0,0 +1,626 @@ +package cdb + +import ( + "context" + "database/sql" + "encoding/json" + "errors" + "fmt" + "strconv" + "strings" +) + +var ( + // ErrCompInvalid marks compliance designer data that cannot be used. + ErrCompInvalid = errors.New("invalid data") + + // ErrCompForbidden marks a compliance designer change the caller is not + // allowed to make. + ErrCompForbidden = errors.New("forbidden") +) + +// CompFlag is a boolean of the compliance designer, stored as "T" or "F". It +// reads a JSON boolean, number or string, as the historical exports hold either. +type CompFlag string + +func (f *CompFlag) UnmarshalJSON(b []byte) error { + var v any + if err := json.Unmarshal(b, &v); err != nil { + return err + } + switch t := v.(type) { + case bool: + *f = "F" + if t { + *f = "T" + } + return nil + case float64: + if t == 0 || t == 1 { + *f = CompFlag(map[bool]string{true: "T", false: "F"}[t == 1]) + return nil + } + case string: + switch strings.ToLower(strings.TrimSpace(t)) { + case "t", "true", "yes", "y", "1": + *f = "T" + return nil + case "f", "false", "no", "n", "0", "": + *f = "F" + return nil + } + } + return fmt.Errorf("invalid boolean %s", b) +} + +type ( + // CompImportFilter is a filter of an imported filterset. + CompImportFilter struct { + FTable *string `json:"f_table"` + FField *string `json:"f_field"` + FOp *string `json:"f_op"` + FValue *string `json:"f_value"` + } + + // CompImportFilterEntry is a filter or a filterset in an imported filterset. + CompImportFilterEntry struct { + FLogOp string `json:"f_log_op"` + FOrder int `json:"f_order"` + Filter *CompImportFilter `json:"filter"` + Filterset *string `json:"filterset"` + } + + // CompImportFilterset is an imported filterset. + CompImportFilterset struct { + FsetName *string `json:"fset_name"` + Filters []CompImportFilterEntry `json:"filters"` + } + + // CompImportVariable is a variable of an imported ruleset. + CompImportVariable struct { + VarName *string `json:"var_name"` + VarClass *string `json:"var_class"` + VarValue *string `json:"var_value"` + } + + // CompImportRuleset is an imported ruleset. + CompImportRuleset struct { + RulesetName *string `json:"ruleset_name"` + RulesetType *string `json:"ruleset_type"` + RulesetPublic *CompFlag `json:"ruleset_public"` + FsetName *string `json:"fset_name"` + Variables []CompImportVariable `json:"variables"` + Rulesets []string `json:"rulesets"` + } + + // CompImportModule is a module of an imported moduleset. + CompImportModule struct { + ModsetModName *string `json:"modset_mod_name"` + Autofix *CompFlag `json:"autofix"` + } + + // CompImportModuleset is an imported moduleset. + CompImportModuleset struct { + ModsetName *string `json:"modset_name"` + Modules []CompImportModule `json:"modules"` + Modulesets []string `json:"modulesets"` + Rulesets []string `json:"rulesets"` + } + + // CompImportData is what ExportCompRulesets and ExportCompModulesets write. + // The publications and responsibles of the export are not imported: the new + // objects get the importer's default group, as add_default_teams() gives. + CompImportData struct { + Filtersets []CompImportFilterset `json:"filtersets"` + Rulesets []CompImportRuleset `json:"rulesets"` + Modulesets []CompImportModuleset `json:"modulesets"` + } + + // CompImporter is who imports: the author recorded on the new objects, the + // group they are given, and whether the caller is responsible for an existing + // object the import adds to. + CompImporter struct { + Author string + GroupID int64 + Responsible func(ctx context.Context, k CompKind, id int64) (bool, error) + } + + compImport struct { + oDb *DB + imp CompImporter + messages []string + filters map[string]int + fsets map[string]int + rsets map[string]int64 + modsets map[string]int64 + // existing holds the objects the import found already there, which it + // may add to only when the caller is responsible for them. + existing map[string]bool + } +) + +func invalidf(format string, args ...any) error { + return fmt.Errorf("%w: "+format, append([]any{ErrCompInvalid}, args...)...) +} + +// ImportCompliance creates the filters, filtersets, rulesets and modulesets of +// an export, and their relations, as lib_compliance_import(): an object already +// there by name is reused, and the messages tell what was added and what already +// existed. Unlike the historical import, content is added to an existing +// ruleset or moduleset only when the caller is responsible for it, and a +// relation closing a loop is refused. Run it in a transaction, as it stops at +// the first error. +func (oDb *DB) ImportCompliance(ctx context.Context, data CompImportData, imp CompImporter) ([]string, error) { + ci := &compImport{ + oDb: oDb, + imp: imp, + messages: []string{}, + filters: map[string]int{}, + fsets: map[string]int{}, + rsets: map[string]int64{}, + modsets: map[string]int64{}, + existing: map[string]bool{}, + } + for _, step := range []func(context.Context, CompImportData) error{ + ci.importFilters, ci.importFiltersets, ci.importFiltersetRelations, + ci.importRulesets, ci.importRulesetFiltersets, ci.importRulesetRelations, ci.importVariables, + ci.importModulesets, ci.importModules, ci.importModulesetRelations, ci.importModulesetRulesets, + } { + if err := step(ctx, data); err != nil { + return nil, err + } + } + return ci.messages, nil +} + +func (ci *compImport) add(format string, args ...any) { + ci.messages = append(ci.messages, fmt.Sprintf(format, args...)) +} + +// mayChange refuses an addition to an existing object the caller is not +// responsible for. +func (ci *compImport) mayChange(ctx context.Context, k CompKind, name string, id int64) error { + if !ci.existing[k.Name+"/"+name] { + return nil + } + ok, err := ci.imp.Responsible(ctx, k, id) + if err != nil { + return err + } + if !ok { + return fmt.Errorf("%w: the %s %s already exists and you are not responsible for it", ErrCompForbidden, k.Name, name) + } + return nil +} + +func filterKey(f *CompImportFilter) (string, error) { + if f.FTable == nil || f.FField == nil || f.FOp == nil || f.FValue == nil { + b, _ := json.Marshal(f) + return "", invalidf("invalid filter format: %s", b) + } + return *f.FTable + "." + *f.FField + " " + *f.FOp + " " + *f.FValue, nil +} + +func (ci *compImport) importFilters(ctx context.Context, data CompImportData) error { + for _, fset := range data.Filtersets { + for _, entry := range fset.Filters { + f := entry.Filter + if f == nil { + continue + } + key, err := filterKey(f) + if err != nil { + return err + } + if _, done := ci.filters[key]; done { + continue + } + id, found, err := ci.oDb.FilterByDefinition(ctx, *f.FTable, *f.FField, *f.FOp, *f.FValue) + if err != nil { + return err + } + if found { + ci.filters[key] = id + ci.add("Filter already exists: %s", key) + continue + } + if id, err = ci.oDb.InsertFilter(ctx, *f.FTable, *f.FField, *f.FOp, *f.FValue, ci.imp.Author); err != nil { + return err + } + ci.oDb.SetChange("gen_filters") + ci.filters[key] = id + ci.add("Filter added: %s", key) + } + } + return nil +} + +func (ci *compImport) importFiltersets(ctx context.Context, data CompImportData) error { + for _, fset := range data.Filtersets { + if fset.FsetName == nil || *fset.FsetName == "" { + return invalidf("invalid filterset format: a fset_name is expected") + } + name := *fset.FsetName + id, found, err := ci.oDb.FiltersetByName(ctx, name) + if err != nil { + return err + } + if found { + ci.fsets[name] = id + ci.add("Filterset already exists: %s", name) + continue + } + if id, err = ci.oDb.InsertFilterset(ctx, name, "F", ci.imp.Author); err != nil { + return err + } + ci.oDb.SetChange("gen_filtersets") + ci.fsets[name] = id + ci.add("Filterset added: %s", name) + } + return nil +} + +// filtersetID resolves a filterset of the import, or one already there. +func (ci *compImport) filtersetID(ctx context.Context, name string) (int, error) { + if id, ok := ci.fsets[name]; ok { + return id, nil + } + id, found, err := ci.oDb.FiltersetByName(ctx, name) + if err != nil { + return 0, err + } + if !found { + return 0, invalidf("filterset %s not found", name) + } + ci.fsets[name] = id + return id, nil +} + +func (ci *compImport) importFiltersetRelations(ctx context.Context, data CompImportData) error { + for _, fset := range data.Filtersets { + fsetID := ci.fsets[*fset.FsetName] + for _, entry := range fset.Filters { + order := strconv.Itoa(entry.FOrder) + switch { + case entry.Filter != nil: + key, _ := filterKey(entry.Filter) + fID := ci.filters[key] + rel := *fset.FsetName + " -> " + entry.FLogOp + " " + key + " (" + order + ")" + if found, err := ci.oDb.exists(ctx, "importFiltersetRelations", + "SELECT 1 FROM gen_filtersets_filters WHERE fset_id = ? AND f_id = ? AND f_log_op = ? AND f_order = ?", + fsetID, fID, entry.FLogOp, entry.FOrder); err != nil { + return err + } else if found { + ci.add("Filterset relation already exists: %s", rel) + continue + } + if err := ci.oDb.InsertFiltersetFilter(ctx, fsetID, fID, entry.FOrder, entry.FLogOp); err != nil { + return err + } + ci.add("Filterset relation added: %s", rel) + case entry.Filterset != nil: + encapID, err := ci.filtersetID(ctx, *entry.Filterset) + if err != nil { + return err + } + rel := *fset.FsetName + " -> " + entry.FLogOp + " " + *entry.Filterset + " (" + order + ")" + if found, err := ci.oDb.exists(ctx, "importFiltersetRelations", + "SELECT 1 FROM gen_filtersets_filters WHERE fset_id = ? AND encap_fset_id = ? AND f_log_op = ? AND f_order = ?", + fsetID, encapID, entry.FLogOp, entry.FOrder); err != nil { + return err + } else if found { + ci.add("Filterset relation already exists: %s", rel) + continue + } + if loop, err := ci.oDb.FiltersetEncapWouldLoop(ctx, encapID, fsetID); err != nil { + return err + } else if loop || encapID == fsetID { + return invalidf("the filterset relation %s would cause an infinite recursion", rel) + } + if err := ci.oDb.InsertFiltersetEncap(ctx, fsetID, encapID, entry.FOrder, entry.FLogOp); err != nil { + return err + } + ci.add("Filterset relation added: %s", rel) + default: + continue + } + ci.oDb.SetChange("gen_filtersets_filters") + } + } + return nil +} + +// idByName returns the id of the object of a table named name. +func (ci *compImport) idByName(ctx context.Context, table, nameCol, name string) (int64, bool, error) { + var id int64 + err := ci.oDb.DB.QueryRowContext(ctx, "SELECT id FROM "+table+" WHERE "+nameCol+" = ? LIMIT 1", name).Scan(&id) + switch { + case errors.Is(err, sql.ErrNoRows): + return 0, false, nil + case err != nil: + return 0, false, fmt.Errorf("idByName %s: %w", table, err) + } + return id, true, nil +} + +func (ci *compImport) importRulesets(ctx context.Context, data CompImportData) error { + for _, rset := range data.Rulesets { + if rset.RulesetName == nil || *rset.RulesetName == "" || rset.RulesetType == nil || rset.RulesetPublic == nil { + b, _ := json.Marshal(rset) + return invalidf("invalid ruleset format: %s", b) + } + name := *rset.RulesetName + if *rset.RulesetType != "explicit" && *rset.RulesetType != "contextual" { + return invalidf("invalid ruleset_type %q of ruleset %s: expected explicit or contextual", *rset.RulesetType, name) + } + id, found, err := ci.idByName(ctx, "comp_rulesets", "ruleset_name", name) + if err != nil { + return err + } + if found { + ci.rsets[name] = id + ci.existing[CompRulesetKind.Name+"/"+name] = true + ci.add("Ruleset already exists: %s", name) + continue + } + if id, err = ci.oDb.CreateCompRuleset(ctx, name, *rset.RulesetType, string(*rset.RulesetPublic), ci.imp.GroupID); err != nil { + return err + } + ci.rsets[name] = id + ci.add("Ruleset added: %s", name) + } + return nil +} + +// rulesetID resolves a ruleset of the import, or one already there. +func (ci *compImport) rulesetID(ctx context.Context, name string) (int64, error) { + if id, ok := ci.rsets[name]; ok { + return id, nil + } + id, found, err := ci.idByName(ctx, "comp_rulesets", "ruleset_name", name) + if err != nil { + return 0, err + } + if !found { + return 0, invalidf("ruleset %s not found", name) + } + ci.rsets[name] = id + return id, nil +} + +func (ci *compImport) importRulesetFiltersets(ctx context.Context, data CompImportData) error { + for _, rset := range data.Rulesets { + if rset.FsetName == nil { + continue + } + name := *rset.RulesetName + rsetID := ci.rsets[name] + rel := name + " -> " + *rset.FsetName + fsetID, err := ci.filtersetID(ctx, *rset.FsetName) + if err != nil { + return err + } + if found, err := ci.oDb.exists(ctx, "importRulesetFiltersets", + "SELECT 1 FROM comp_rulesets_filtersets WHERE ruleset_id = ? AND fset_id = ?", rsetID, fsetID); err != nil { + return err + } else if found { + ci.add("Ruleset filterset relation already exists: %s", rel) + continue + } + if err := ci.mayChange(ctx, CompRulesetKind, name, rsetID); err != nil { + return err + } + if err := ci.oDb.SetCompRulesetFilterset(ctx, rsetID, int64(fsetID)); err != nil { + return err + } + ci.add("Ruleset filterset relation added: %s", rel) + } + return nil +} + +func (ci *compImport) importRulesetRelations(ctx context.Context, data CompImportData) error { + for _, rset := range data.Rulesets { + name := *rset.RulesetName + parent := ci.rsets[name] + for _, childName := range rset.Rulesets { + rel := name + " -> " + childName + child, err := ci.rulesetID(ctx, childName) + if err != nil { + return err + } + if found, err := ci.oDb.CompRulesetChildAttached(ctx, parent, child); err != nil { + return err + } else if found { + ci.add("Ruleset relation already exists: %s", rel) + continue + } + if err := ci.mayChange(ctx, CompRulesetKind, name, parent); err != nil { + return err + } + if loop, err := ci.oDb.CompRulesetLoop(ctx, child, parent); err != nil { + return err + } else if loop || child == parent { + return invalidf("the ruleset relation %s would cause an infinite recursion", rel) + } + if err := ci.oDb.AttachCompRulesetChild(ctx, parent, child); err != nil { + return err + } + ci.add("Ruleset relation added: %s", rel) + } + } + return nil +} + +func (ci *compImport) importVariables(ctx context.Context, data CompImportData) error { + for _, rset := range data.Rulesets { + name := *rset.RulesetName + rsetID := ci.rsets[name] + for _, v := range rset.Variables { + if v.VarName == nil || v.VarClass == nil || v.VarValue == nil { + b, _ := json.Marshal(v) + return invalidf("invalid variable format: %s", b) + } + desc := name + " :: " + *v.VarName + " (" + *v.VarClass + ")" + var id int64 + var class, value sql.NullString + err := ci.oDb.DB.QueryRowContext(ctx, "SELECT id, var_class, var_value FROM comp_rulesets_variables"+ + " WHERE ruleset_id = ? AND var_name = ? LIMIT 1", rsetID, *v.VarName).Scan(&id, &class, &value) + found := err == nil + if err != nil && !errors.Is(err, sql.ErrNoRows) { + return fmt.Errorf("importVariables: %w", err) + } + if found && class.String == *v.VarClass && value.String == *v.VarValue { + ci.add("Variable already exists: %s", desc) + continue + } + if err := ci.mayChange(ctx, CompRulesetKind, name, rsetID); err != nil { + return err + } + fields := map[string]any{"var_class": *v.VarClass, "var_value": *v.VarValue} + if found { + err = ci.oDb.UpdateCompRulesetVariable(ctx, id, fields, ci.imp.Author) + } else { + fields["var_name"] = *v.VarName + _, err = ci.oDb.CreateCompRulesetVariable(ctx, rsetID, fields, ci.imp.Author) + } + if err != nil { + return err + } + ci.add("Variable added: %s", desc) + } + } + return nil +} + +func (ci *compImport) importModulesets(ctx context.Context, data CompImportData) error { + for _, modset := range data.Modulesets { + if modset.ModsetName == nil || *modset.ModsetName == "" { + return invalidf("invalid moduleset format: a modset_name is expected") + } + name := *modset.ModsetName + id, found, err := ci.idByName(ctx, "comp_moduleset", "modset_name", name) + if err != nil { + return err + } + if found { + ci.modsets[name] = id + ci.existing[CompModulesetKind.Name+"/"+name] = true + ci.add("Moduleset already exists: %s", name) + continue + } + if id, err = ci.oDb.CreateCompModuleset(ctx, name, ci.imp.Author, ci.imp.GroupID); err != nil { + return err + } + ci.modsets[name] = id + ci.add("Moduleset added: %s", name) + } + return nil +} + +func (ci *compImport) importModules(ctx context.Context, data CompImportData) error { + for _, modset := range data.Modulesets { + name := *modset.ModsetName + modsetID := ci.modsets[name] + for _, mod := range modset.Modules { + if mod.ModsetModName == nil || *mod.ModsetModName == "" || mod.Autofix == nil { + b, _ := json.Marshal(mod) + return invalidf("invalid module format: %s", b) + } + desc := name + " :: " + *mod.ModsetModName + " (" + string(*mod.Autofix) + ")" + var id int64 + var autofix sql.NullString + err := ci.oDb.DB.QueryRowContext(ctx, "SELECT id, autofix FROM comp_moduleset_modules"+ + " WHERE modset_id = ? AND modset_mod_name = ? LIMIT 1", modsetID, *mod.ModsetModName).Scan(&id, &autofix) + found := err == nil + if err != nil && !errors.Is(err, sql.ErrNoRows) { + return fmt.Errorf("importModules: %w", err) + } + if stored := autofix.String == "T" || autofix.String == "1"; found && stored == (*mod.Autofix == "T") { + ci.add("Module already exists: %s", desc) + continue + } + if err := ci.mayChange(ctx, CompModulesetKind, name, modsetID); err != nil { + return err + } + fields := map[string]any{"autofix": string(*mod.Autofix)} + if found { + err = ci.oDb.UpdateCompModulesetModule(ctx, id, fields, ci.imp.Author) + } else { + fields["modset_mod_name"] = *mod.ModsetModName + _, err = ci.oDb.CreateCompModulesetModule(ctx, modsetID, fields, ci.imp.Author) + } + if err != nil { + return err + } + ci.add("Module added: %s", desc) + } + } + return nil +} + +func (ci *compImport) importModulesetRelations(ctx context.Context, data CompImportData) error { + for _, modset := range data.Modulesets { + name := *modset.ModsetName + parent := ci.modsets[name] + for _, childName := range modset.Modulesets { + rel := name + " -> " + childName + child, ok := ci.modsets[childName] + if !ok { + var found bool + var err error + if child, found, err = ci.idByName(ctx, "comp_moduleset", "modset_name", childName); err != nil { + return err + } else if !found { + return invalidf("moduleset %s not found", childName) + } + } + if found, err := ci.oDb.CompModulesetChildAttached(ctx, parent, child); err != nil { + return err + } else if found { + ci.add("Moduleset relation already exists: %s", rel) + continue + } + if err := ci.mayChange(ctx, CompModulesetKind, name, parent); err != nil { + return err + } + if loop, err := ci.oDb.CompModulesetLoop(ctx, child, parent); err != nil { + return err + } else if loop || child == parent { + return invalidf("the moduleset relation %s would cause an infinite recursion", rel) + } + if err := ci.oDb.AttachCompModulesetChild(ctx, parent, child); err != nil { + return err + } + ci.add("Moduleset relation added: %s", rel) + } + } + return nil +} + +func (ci *compImport) importModulesetRulesets(ctx context.Context, data CompImportData) error { + for _, modset := range data.Modulesets { + name := *modset.ModsetName + modsetID := ci.modsets[name] + for _, rsetName := range modset.Rulesets { + rel := name + " -> " + rsetName + rsetID, err := ci.rulesetID(ctx, rsetName) + if err != nil { + return err + } + if found, err := ci.oDb.CompModulesetRulesetAttached(ctx, modsetID, rsetID); err != nil { + return err + } else if found { + ci.add("Moduleset ruleset relation already exists: %s", rel) + continue + } + if err := ci.mayChange(ctx, CompModulesetKind, name, modsetID); err != nil { + return err + } + if err := ci.oDb.AttachCompModulesetRuleset(ctx, modsetID, rsetID); err != nil { + return err + } + ci.add("Moduleset ruleset relation added: %s", rel) + } + } + return nil +} diff --git a/cdb/db_compliance_modules.go b/cdb/db_compliance_modules.go new file mode 100644 index 00000000..9995028b --- /dev/null +++ b/cdb/db_compliance_modules.go @@ -0,0 +1,131 @@ +package cdb + +import ( + "context" + "database/sql" + "errors" + "fmt" + "strconv" + "strings" + + "github.com/opensvc/oc3/schema" +) + +// The team roles of each moduleset, as the derived tables modulesetsModulesFrom +// joins, so the lists can be filtered and sorted by them. +var ( + TModsetResponsibles = &schema.Table{Name: "modset_responsibles"} + TModsetPublications = &schema.Table{Name: "modset_publications"} + ModsetResponsibles = &schema.Col{T: TModsetResponsibles, Name: "teams", Nullable: true} + ModsetPublications = &schema.Col{T: TModsetPublications, Name: "teams", Nullable: true} +) + +// compTeamsJoin joins, under alias, the roles of the groups of gtype +// ("responsible" or "publication") of each object of kind k, comma separated in +// the teams column. +func compTeamsJoin(k CompKind, gtype, alias string) string { + return "LEFT JOIN (SELECT t." + k.FK + ", GROUP_CONCAT(DISTINCT ag.role ORDER BY ag.role SEPARATOR ', ') AS teams" + + " FROM " + k.TeamPrefix + gtype + " t JOIN auth_group ag ON ag.id = t.group_id GROUP BY t." + k.FK + ") " + alias + + " ON " + alias + "." + k.FK + " = " + k.Table + ".id" +} + +// modulesetsModulesFrom is the historical v_comp_modulesets view: every +// moduleset with each of its modules, a moduleset without module on a row of +// its own, and the responsible and publication teams of the moduleset. +var modulesetsModulesFrom = "comp_moduleset" + + " LEFT JOIN comp_moduleset_modules ON comp_moduleset_modules.modset_id = comp_moduleset.id " + + compTeamsJoin(CompModulesetKind, "responsible", TModsetResponsibles.Name) + " " + + compTeamsJoin(CompModulesetKind, "publication", TModsetPublications.Name) + +// GetComplianceModulesetsModules lists the modules of the modulesets visible to +// the caller, by moduleset and module name. +func (oDb *DB) GetComplianceModulesetsModules(ctx context.Context, p ListParams) ([]map[string]any, error) { + cond, args := compObjectVisibleCond(CompModulesetKind, p.Groups, p.IsManager) + return oDb.listQuery(ctx, "getComplianceModulesetsModules", modulesetsModulesFrom, []string{cond}, args, + "comp_moduleset.modset_name, comp_moduleset_modules.modset_mod_name", p) +} + +// GetComplianceModulesetModules lists the modules of a moduleset, by name; one +// when modID is set. +func (oDb *DB) GetComplianceModulesetModules(ctx context.Context, modsetID int64, modID *int64, p ListParams) ([]map[string]any, error) { + conds := []string{"comp_moduleset_modules.modset_id = ?"} + args := []any{modsetID} + if modID != nil { + conds = append(conds, "comp_moduleset_modules.id = ?") + args = append(args, *modID) + } + return oDb.listQuery(ctx, "getComplianceModulesetModules", "comp_moduleset_modules", conds, args, "comp_moduleset_modules.modset_mod_name", p) +} + +// CompModulesetModuleID resolves a module of a moduleset given by id or by name, +// as comp_moduleset_module_id(); false when the moduleset has none such. +func (oDb *DB) CompModulesetModuleID(ctx context.Context, modsetID int64, idOrName string) (int64, bool, error) { + var id int64 + var err error + if n, convErr := strconv.ParseInt(idOrName, 10, 64); convErr == nil { + err = oDb.DB.QueryRowContext(ctx, "SELECT id FROM comp_moduleset_modules WHERE modset_id = ? AND id = ?", modsetID, n).Scan(&id) + } else { + err = oDb.DB.QueryRowContext(ctx, "SELECT id FROM comp_moduleset_modules WHERE modset_id = ? AND modset_mod_name = ? LIMIT 1", modsetID, idOrName).Scan(&id) + } + switch { + case errors.Is(err, sql.ErrNoRows): + return 0, false, nil + case err != nil: + return 0, false, fmt.Errorf("compModulesetModuleID: %w", err) + } + return id, true, nil +} + +// CompModulesetModuleName returns the name of a module. +func (oDb *DB) CompModulesetModuleName(ctx context.Context, id int64) (string, error) { + var name string + if err := oDb.DB.QueryRowContext(ctx, "SELECT modset_mod_name FROM comp_moduleset_modules WHERE id = ?", id).Scan(&name); err != nil { + return "", fmt.Errorf("compModulesetModuleName: %w", err) + } + return name, nil +} + +// CreateCompModulesetModule inserts a module in a moduleset; fields holds +// modset_mod_name and optionally autofix. +func (oDb *DB) CreateCompModulesetModule(ctx context.Context, modsetID int64, fields map[string]any, author string) (int64, error) { + cols := []string{"modset_id", "modset_mod_author", "modset_mod_updated"} + vals := []string{"?", "?", "NOW()"} + args := []any{modsetID, author} + for _, k := range sortedKeys(fields) { + cols = append(cols, k) + vals = append(vals, "?") + args = append(args, fields[k]) + } + res, err := oDb.DB.ExecContext(ctx, "INSERT INTO comp_moduleset_modules ("+strings.Join(cols, ", ")+") VALUES ("+strings.Join(vals, ", ")+")", args...) + if err != nil { + return 0, fmt.Errorf("createCompModulesetModule: %w", err) + } + oDb.SetChange("comp_moduleset_modules") + return res.LastInsertId() +} + +// UpdateCompModulesetModule sets the given columns of a module, its author and +// its update date. +func (oDb *DB) UpdateCompModulesetModule(ctx context.Context, id int64, fields map[string]any, author string) error { + sets := []string{"modset_mod_author = ?", "modset_mod_updated = NOW()"} + args := []any{author} + for _, k := range sortedKeys(fields) { + sets = append(sets, k+" = ?") + args = append(args, fields[k]) + } + args = append(args, id) + if _, err := oDb.DB.ExecContext(ctx, "UPDATE comp_moduleset_modules SET "+strings.Join(sets, ", ")+" WHERE id = ?", args...); err != nil { + return fmt.Errorf("updateCompModulesetModule: %w", err) + } + oDb.SetChange("comp_moduleset_modules") + return nil +} + +// DeleteCompModulesetModule deletes a module. +func (oDb *DB) DeleteCompModulesetModule(ctx context.Context, id int64) error { + if _, err := oDb.DB.ExecContext(ctx, "DELETE FROM comp_moduleset_modules WHERE id = ?", id); err != nil { + return fmt.Errorf("deleteCompModulesetModule: %w", err) + } + oDb.SetChange("comp_moduleset_modules") + return nil +} diff --git a/cdb/db_compliance_moduleset_links.go b/cdb/db_compliance_moduleset_links.go new file mode 100644 index 00000000..4c210f64 --- /dev/null +++ b/cdb/db_compliance_moduleset_links.go @@ -0,0 +1,60 @@ +package cdb + +import ( + "context" + "fmt" +) + +// CompModulesetChildAttached tells whether child is a child of parent. +func (oDb *DB) CompModulesetChildAttached(ctx context.Context, parent, child int64) (bool, error) { + return oDb.exists(ctx, "compModulesetChildAttached", + "SELECT 1 FROM comp_moduleset_moduleset WHERE parent_modset_id = ? AND child_modset_id = ?", parent, child) +} + +// CompModulesetLoop tells whether attaching child under parent would close a +// loop: child already is an ancestor of parent. +func (oDb *DB) CompModulesetLoop(ctx context.Context, child, parent int64) (bool, error) { + return oDb.compLoop(ctx, "compModulesetLoop", "SELECT parent_modset_id, child_modset_id FROM comp_moduleset_moduleset", child, parent) +} + +// AttachCompModulesetChild makes child a child of parent. +func (oDb *DB) AttachCompModulesetChild(ctx context.Context, parent, child int64) error { + if _, err := oDb.DB.ExecContext(ctx, "INSERT INTO comp_moduleset_moduleset (parent_modset_id, child_modset_id) VALUES (?, ?)", parent, child); err != nil { + return fmt.Errorf("attachCompModulesetChild: %w", err) + } + oDb.SetChange("comp_moduleset_moduleset") + return nil +} + +// DetachCompModulesetChild removes child from the children of parent. +func (oDb *DB) DetachCompModulesetChild(ctx context.Context, parent, child int64) error { + if _, err := oDb.DB.ExecContext(ctx, "DELETE FROM comp_moduleset_moduleset WHERE parent_modset_id = ? AND child_modset_id = ?", parent, child); err != nil { + return fmt.Errorf("detachCompModulesetChild: %w", err) + } + oDb.SetChange("comp_moduleset_moduleset") + return nil +} + +// CompModulesetRulesetAttached tells whether a ruleset is attached to a moduleset. +func (oDb *DB) CompModulesetRulesetAttached(ctx context.Context, modsetID, rulesetID int64) (bool, error) { + return oDb.exists(ctx, "compModulesetRulesetAttached", + "SELECT 1 FROM comp_moduleset_ruleset WHERE modset_id = ? AND ruleset_id = ?", modsetID, rulesetID) +} + +// AttachCompModulesetRuleset attaches a ruleset to a moduleset. +func (oDb *DB) AttachCompModulesetRuleset(ctx context.Context, modsetID, rulesetID int64) error { + if _, err := oDb.DB.ExecContext(ctx, "INSERT INTO comp_moduleset_ruleset (modset_id, ruleset_id) VALUES (?, ?)", modsetID, rulesetID); err != nil { + return fmt.Errorf("attachCompModulesetRuleset: %w", err) + } + oDb.SetChange("comp_moduleset_ruleset") + return nil +} + +// DetachCompModulesetRuleset detaches a ruleset from a moduleset. +func (oDb *DB) DetachCompModulesetRuleset(ctx context.Context, modsetID, rulesetID int64) error { + if _, err := oDb.DB.ExecContext(ctx, "DELETE FROM comp_moduleset_ruleset WHERE modset_id = ? AND ruleset_id = ?", modsetID, rulesetID); err != nil { + return fmt.Errorf("detachCompModulesetRuleset: %w", err) + } + oDb.SetChange("comp_moduleset_ruleset") + return nil +} diff --git a/cdb/db_compliance_modulesets.go b/cdb/db_compliance_modulesets.go new file mode 100644 index 00000000..a5cfdb92 --- /dev/null +++ b/cdb/db_compliance_modulesets.go @@ -0,0 +1,162 @@ +package cdb + +import ( + "context" + "database/sql" + "errors" + "fmt" + "strconv" +) + +// GetComplianceModulesets lists the modulesets published to one of the caller's +// groups, every moduleset for a manager; one when id is set. +func (oDb *DB) GetComplianceModulesets(ctx context.Context, id *int64, p ListParams) ([]map[string]any, error) { + cond, args := compObjectVisibleCond(CompModulesetKind, p.Groups, p.IsManager) + conds := []string{cond} + if id != nil { + conds = append(conds, "comp_moduleset.id = ?") + args = append(args, *id) + } + return oDb.listQuery(ctx, "getComplianceModulesets", "comp_moduleset", conds, args, "comp_moduleset.modset_name", p) +} + +// CompModulesetID resolves a moduleset given by id or by name, as +// moduleset_id_q(); false when there is none. +func (oDb *DB) CompModulesetID(ctx context.Context, idOrName string) (int64, bool, error) { + var id int64 + var err error + if n, convErr := strconv.ParseInt(idOrName, 10, 64); convErr == nil { + err = oDb.DB.QueryRowContext(ctx, "SELECT id FROM comp_moduleset WHERE id = ?", n).Scan(&id) + } else { + err = oDb.DB.QueryRowContext(ctx, "SELECT id FROM comp_moduleset WHERE modset_name = ? LIMIT 1", idOrName).Scan(&id) + } + switch { + case errors.Is(err, sql.ErrNoRows): + return 0, false, nil + case err != nil: + return 0, false, fmt.Errorf("compModulesetID: %w", err) + } + return id, true, nil +} + +// CreateCompModuleset inserts a moduleset authored by author, published to and +// under the responsibility of groupID, as create_moduleset() and +// add_default_teams_to_modset(). +func (oDb *DB) CreateCompModuleset(ctx context.Context, name, author string, groupID int64) (int64, error) { + res, err := oDb.DB.ExecContext(ctx, "INSERT INTO comp_moduleset (modset_name, modset_author, modset_updated) VALUES (?, ?, NOW())", name, author) + if err != nil { + return 0, fmt.Errorf("createCompModuleset: %w", err) + } + id, err := res.LastInsertId() + if err != nil { + return 0, fmt.Errorf("createCompModuleset: %w", err) + } + if err := oDb.addModulesetTeams(ctx, id, groupID); err != nil { + return 0, err + } + oDb.SetChange("comp_moduleset") + return id, nil +} + +func (oDb *DB) addModulesetTeams(ctx context.Context, modsetID, groupID int64) error { + for _, table := range []string{"comp_moduleset_team_responsible", "comp_moduleset_team_publication"} { + if _, err := oDb.DB.ExecContext(ctx, "INSERT INTO "+table+" (modset_id, group_id) VALUES (?, ?)", modsetID, groupID); err != nil { + return fmt.Errorf("addModulesetTeams: %w", err) + } + oDb.SetChange(table) + } + return nil +} + +// RenameCompModuleset renames a moduleset and records the update date. +func (oDb *DB) RenameCompModuleset(ctx context.Context, id int64, name string) error { + if _, err := oDb.DB.ExecContext(ctx, "UPDATE comp_moduleset SET modset_name = ?, modset_updated = NOW() WHERE id = ?", name, id); err != nil { + return fmt.Errorf("renameCompModuleset: %w", err) + } + oDb.SetChange("comp_moduleset") + return nil +} + +// DeleteCompModuleset deletes a moduleset with its node and service attachments, +// publication and responsible groups, modules, parent and child relations and +// ruleset links, as delete_moduleset(). +func (oDb *DB) DeleteCompModuleset(ctx context.Context, id int64) error { + for _, q := range []struct{ table, cond string }{ + {"comp_node_moduleset", "modset_id = ?"}, + {"comp_modulesets_services", "modset_id = ?"}, + {"comp_moduleset_team_publication", "modset_id = ?"}, + {"comp_moduleset_team_responsible", "modset_id = ?"}, + {"comp_moduleset_modules", "modset_id = ?"}, + {"comp_moduleset", "id = ?"}, + {"comp_moduleset_moduleset", "parent_modset_id = ? OR child_modset_id = ?"}, + {"comp_moduleset_ruleset", "modset_id = ?"}, + } { + args := []any{id} + if q.table == "comp_moduleset_moduleset" { + args = append(args, id) + } + if _, err := oDb.DB.ExecContext(ctx, "DELETE FROM "+q.table+" WHERE "+q.cond, args...); err != nil { + return fmt.Errorf("deleteCompModuleset: %s: %w", q.table, err) + } + oDb.SetChange(q.table) + } + return nil +} + +// CloneCompModuleset copies a moduleset as "_clone", authored by author: +// its modules, its rulesets and its children, under the responsibility and +// publication of groupID, as clone_moduleset(). It returns the id and the name +// of the copy. +func (oDb *DB) CloneCompModuleset(ctx context.Context, id int64, author string, groupID int64) (int64, string, error) { + var name string + err := oDb.DB.QueryRowContext(ctx, "SELECT modset_name FROM comp_moduleset WHERE id = ?", id).Scan(&name) + if errors.Is(err, sql.ErrNoRows) { + return 0, "", ErrCompNotFound + } else if err != nil { + return 0, "", fmt.Errorf("cloneCompModuleset: %w", err) + } + cloneName := name + "_clone" + if _, found, err := oDb.CompModulesetID(ctx, cloneName); err != nil { + return 0, "", err + } else if found { + return 0, "", fmt.Errorf("%w: a moduleset named %s already exists", ErrCompConflict, cloneName) + } + res, err := oDb.DB.ExecContext(ctx, "INSERT INTO comp_moduleset (modset_name, modset_author, modset_updated) VALUES (?, ?, NOW())", cloneName, author) + if err != nil { + return 0, "", fmt.Errorf("cloneCompModuleset: %w", err) + } + newID, err := res.LastInsertId() + if err != nil { + return 0, "", fmt.Errorf("cloneCompModuleset: %w", err) + } + for _, st := range []struct { + query string + args []any + }{ + {"INSERT INTO comp_moduleset_modules (modset_id, modset_mod_name, modset_mod_author, modset_mod_updated, autofix)" + + " SELECT ?, modset_mod_name, modset_mod_author, NOW(), autofix FROM comp_moduleset_modules WHERE modset_id = ?", []any{newID, id}}, + {"INSERT INTO comp_moduleset_ruleset (modset_id, ruleset_id) SELECT ?, ruleset_id FROM comp_moduleset_ruleset WHERE modset_id = ?", []any{newID, id}}, + {"INSERT INTO comp_moduleset_moduleset (parent_modset_id, child_modset_id) SELECT ?, child_modset_id FROM comp_moduleset_moduleset WHERE parent_modset_id = ?", []any{newID, id}}, + } { + if _, err := oDb.DB.ExecContext(ctx, st.query, st.args...); err != nil { + return 0, "", fmt.Errorf("cloneCompModuleset: %w", err) + } + } + if err := oDb.addModulesetTeams(ctx, newID, groupID); err != nil { + return 0, "", err + } + for _, t := range []string{"comp_moduleset", "comp_moduleset_modules", "comp_moduleset_ruleset", "comp_moduleset_moduleset"} { + oDb.SetChange(t) + } + return newID, cloneName, nil +} + +// CompModulesetUsage lists the modulesets holding a moduleset as a child. +func (oDb *DB) CompModulesetUsage(ctx context.Context, id int64) (map[string][]map[string]any, error) { + parents, err := oDb.namedPairs(ctx, "SELECT m.id, m.modset_name FROM comp_moduleset_moduleset mm"+ + " JOIN comp_moduleset m ON m.id = mm.parent_modset_id WHERE mm.child_modset_id = ? ORDER BY m.modset_name", id, "id", "modset_name") + if err != nil { + return nil, fmt.Errorf("compModulesetUsage: %w", err) + } + return map[string][]map[string]any{"modulesets": parents}, nil +} diff --git a/cdb/db_compliance_ruleset_links.go b/cdb/db_compliance_ruleset_links.go new file mode 100644 index 00000000..8f4d7d97 --- /dev/null +++ b/cdb/db_compliance_ruleset_links.go @@ -0,0 +1,111 @@ +package cdb + +import ( + "context" + "database/sql" + "errors" + "fmt" +) + +// CompRulesetChildAttached tells whether child is a child of parent. +func (oDb *DB) CompRulesetChildAttached(ctx context.Context, parent, child int64) (bool, error) { + return oDb.exists(ctx, "compRulesetChildAttached", + "SELECT 1 FROM comp_rulesets_rulesets WHERE parent_rset_id = ? AND child_rset_id = ?", parent, child) +} + +// CompRulesetLoop tells whether attaching child under parent would close a loop: +// child already is an ancestor of parent, as rset_loop(). +func (oDb *DB) CompRulesetLoop(ctx context.Context, child, parent int64) (bool, error) { + return oDb.compLoop(ctx, "compRulesetLoop", "SELECT parent_rset_id, child_rset_id FROM comp_rulesets_rulesets", child, parent) +} + +// compLoop tells whether child is an ancestor of parent in the parent-child +// pairs the query returns. +func (oDb *DB) compLoop(ctx context.Context, name, query string, child, parent int64) (bool, error) { + parents := map[int64][]int64{} + rows, err := oDb.DB.QueryContext(ctx, query) + if err != nil { + return false, fmt.Errorf("%s: %w", name, err) + } + for rows.Next() { + var p, c int64 + if err := rows.Scan(&p, &c); err != nil { + _ = rows.Close() + return false, fmt.Errorf("%s: %w", name, err) + } + parents[c] = append(parents[c], p) + } + _ = rows.Close() + seen := map[int64]bool{} + todo := []int64{parent} + for len(todo) > 0 { + id := todo[0] + todo = todo[1:] + for _, p := range parents[id] { + if p == child { + return true, nil + } + if !seen[p] { + seen[p] = true + todo = append(todo, p) + } + } + } + return false, nil +} + +// AttachCompRulesetChild makes child a child of parent. +func (oDb *DB) AttachCompRulesetChild(ctx context.Context, parent, child int64) error { + if _, err := oDb.DB.ExecContext(ctx, "INSERT INTO comp_rulesets_rulesets (parent_rset_id, child_rset_id) VALUES (?, ?)", parent, child); err != nil { + return fmt.Errorf("attachCompRulesetChild: %w", err) + } + oDb.SetChange("comp_rulesets_rulesets") + return nil +} + +// DetachCompRulesetChild removes child from the children of parent. +func (oDb *DB) DetachCompRulesetChild(ctx context.Context, parent, child int64) error { + if _, err := oDb.DB.ExecContext(ctx, "DELETE FROM comp_rulesets_rulesets WHERE parent_rset_id = ? AND child_rset_id = ?", parent, child); err != nil { + return fmt.Errorf("detachCompRulesetChild: %w", err) + } + oDb.SetChange("comp_rulesets_rulesets") + return nil +} + +// CompRulesetFilterset returns the filterset of a contextual ruleset, with its +// name; false when it has none. +func (oDb *DB) CompRulesetFilterset(ctx context.Context, rulesetID int64) (int64, string, bool, error) { + var id int64 + var name sql.NullString + err := oDb.DB.QueryRowContext(ctx, "SELECT f.id, f.fset_name FROM comp_rulesets_filtersets rf"+ + " JOIN gen_filtersets f ON f.id = rf.fset_id WHERE rf.ruleset_id = ? LIMIT 1", rulesetID).Scan(&id, &name) + switch { + case errors.Is(err, sql.ErrNoRows): + return 0, "", false, nil + case err != nil: + return 0, "", false, fmt.Errorf("compRulesetFilterset: %w", err) + } + return id, name.String, true, nil +} + +// SetCompRulesetFilterset gives a ruleset its filterset, replacing the previous +// one: a ruleset has at most one, as update_or_insert() keeps it. +func (oDb *DB) SetCompRulesetFilterset(ctx context.Context, rulesetID, fsetID int64) error { + if _, err := oDb.DB.ExecContext(ctx, "DELETE FROM comp_rulesets_filtersets WHERE ruleset_id = ?", rulesetID); err != nil { + return fmt.Errorf("setCompRulesetFilterset: %w", err) + } + if _, err := oDb.DB.ExecContext(ctx, "INSERT INTO comp_rulesets_filtersets (ruleset_id, fset_id) VALUES (?, ?)", rulesetID, fsetID); err != nil { + return fmt.Errorf("setCompRulesetFilterset: %w", err) + } + oDb.SetChange("comp_rulesets_filtersets") + return nil +} + +// DeleteCompRulesetFilterset removes the filterset of a ruleset. +func (oDb *DB) DeleteCompRulesetFilterset(ctx context.Context, rulesetID int64) error { + if _, err := oDb.DB.ExecContext(ctx, "DELETE FROM comp_rulesets_filtersets WHERE ruleset_id = ?", rulesetID); err != nil { + return fmt.Errorf("deleteCompRulesetFilterset: %w", err) + } + oDb.SetChange("comp_rulesets_filtersets") + return nil +} diff --git a/cdb/db_compliance_rulesets.go b/cdb/db_compliance_rulesets.go new file mode 100644 index 00000000..7f2b5647 --- /dev/null +++ b/cdb/db_compliance_rulesets.go @@ -0,0 +1,406 @@ +package cdb + +import ( + "context" + "database/sql" + "errors" + "fmt" + "strconv" + "strings" +) + +// rolesCond restricts an auth_group alias to the caller's groups, "1=0" without +// any: the join condition of the publication and responsibility checks. +func rolesCond(alias string, groups []string, orgOnly bool) (string, []any) { + clean := cleanGroups(groups) + if len(clean) == 0 { + return "1=0", nil + } + args := make([]any, len(clean)) + for i, g := range clean { + args[i] = g + } + cond := alias + ".role IN (" + Placeholders(len(clean)) + ")" + if orgOnly { + cond += " AND " + alias + ".privilege = 'F'" + } + return cond, args +} + +// compRulesetVisibleCond restricts comp_rulesets to the rulesets published to one +// of the caller's groups, every ruleset for a manager, as the historical +// rest_get_compliance_rulesets. +func compRulesetVisibleCond(groups []string, isManager bool) (string, []any) { + if isManager { + return "1=1", nil + } + cond, args := rolesCond("ag", groups, false) + return "comp_rulesets.id IN (SELECT p.ruleset_id FROM comp_ruleset_team_publication p" + + " JOIN auth_group ag ON ag.id = p.group_id WHERE " + cond + ")", args +} + +// GetComplianceRulesets lists the rulesets the caller may see; one when id is set. +func (oDb *DB) GetComplianceRulesets(ctx context.Context, id *int64, p ListParams) ([]map[string]any, error) { + cond, args := compRulesetVisibleCond(p.Groups, p.IsManager) + conds := []string{cond} + if id != nil { + conds = append(conds, "comp_rulesets.id = ?") + args = append(args, *id) + } + return oDb.listQuery(ctx, "getComplianceRulesets", "comp_rulesets", conds, args, "comp_rulesets.ruleset_name", p) +} + +// CompRulesetID resolves a ruleset given by id or by name, as ruleset_id_q(); +// false when there is none. +func (oDb *DB) CompRulesetID(ctx context.Context, idOrName string) (int64, bool, error) { + var id int64 + var err error + if n, convErr := strconv.ParseInt(idOrName, 10, 64); convErr == nil { + err = oDb.DB.QueryRowContext(ctx, "SELECT id FROM comp_rulesets WHERE id = ?", n).Scan(&id) + } else { + err = oDb.DB.QueryRowContext(ctx, "SELECT id FROM comp_rulesets WHERE ruleset_name = ? LIMIT 1", idOrName).Scan(&id) + } + switch { + case errors.Is(err, sql.ErrNoRows): + return 0, false, nil + case err != nil: + return 0, false, fmt.Errorf("compRulesetID: %w", err) + } + return id, true, nil +} + +// CompRulesetVisible tells whether a ruleset is published to one of the caller's +// groups; always for a manager. +func (oDb *DB) CompRulesetVisible(ctx context.Context, id int64, groups []string, isManager bool) (bool, error) { + cond, args := compRulesetVisibleCond(groups, isManager) + return oDb.exists(ctx, "compRulesetVisible", "SELECT 1 FROM comp_rulesets WHERE comp_rulesets.id = ? AND "+cond, append([]any{id}, args...)...) +} + +// CompRulesetResponsible tells whether one of the caller's organization groups is +// responsible for a ruleset, as ruleset_responsible(); always for a manager. +func (oDb *DB) CompRulesetResponsible(ctx context.Context, id int64, groups []string, isManager bool) (bool, error) { + if isManager { + return oDb.exists(ctx, "compRulesetResponsible", "SELECT 1 FROM comp_rulesets WHERE id = ?", id) + } + cond, args := rolesCond("ag", groups, true) + return oDb.exists(ctx, "compRulesetResponsible", "SELECT 1 FROM comp_ruleset_team_responsible r"+ + " JOIN auth_group ag ON ag.id = r.group_id WHERE r.ruleset_id = ? AND "+cond, append([]any{id}, args...)...) +} + +func (oDb *DB) exists(ctx context.Context, name, query string, args ...any) (bool, error) { + var one int + err := oDb.DB.QueryRowContext(ctx, query+" LIMIT 1", args...).Scan(&one) + switch { + case errors.Is(err, sql.ErrNoRows): + return false, nil + case err != nil: + return false, fmt.Errorf("%s: %w", name, err) + } + return true, nil +} + +// CompRulesetName returns the name of a ruleset by id. +func (oDb *DB) CompRulesetNameByID(ctx context.Context, id int64) (string, error) { + var name sql.NullString + if err := oDb.DB.QueryRowContext(ctx, "SELECT ruleset_name FROM comp_rulesets WHERE id = ?", id).Scan(&name); err != nil { + return "", fmt.Errorf("compRulesetNameByID: %w", err) + } + return name.String, nil +} + +// DefaultGroupOrManager returns the group a new compliance object is given to: +// the user's default group, else the Manager group, as add_default_teams(). +func (oDb *DB) DefaultGroupOrManager(ctx context.Context, userID *int64) (int64, error) { + if userID != nil { + if gid, ok, err := oDb.UserDefaultGroupID(ctx, *userID); err != nil { + return 0, err + } else if ok { + return gid, nil + } + } + var gid int64 + if err := oDb.DB.QueryRowContext(ctx, "SELECT id FROM auth_group WHERE role = 'Manager' LIMIT 1").Scan(&gid); err != nil { + return 0, fmt.Errorf("defaultGroupOrManager: %w", err) + } + return gid, nil +} + +// CreateCompRuleset inserts a ruleset, published to and under the responsibility +// of groupID, as create_ruleset() and add_default_teams(). +func (oDb *DB) CreateCompRuleset(ctx context.Context, name, rtype, public string, groupID int64) (int64, error) { + res, err := oDb.DB.ExecContext(ctx, "INSERT INTO comp_rulesets (ruleset_name, ruleset_type, ruleset_public) VALUES (?, ?, ?)", + name, rtype, public) + if err != nil { + return 0, fmt.Errorf("createCompRuleset: %w", err) + } + id, err := res.LastInsertId() + if err != nil { + return 0, fmt.Errorf("createCompRuleset: %w", err) + } + if err := oDb.addRulesetTeams(ctx, id, groupID); err != nil { + return 0, err + } + oDb.SetChange("comp_rulesets") + return id, nil +} + +func (oDb *DB) addRulesetTeams(ctx context.Context, rulesetID, groupID int64) error { + for _, table := range []string{"comp_ruleset_team_responsible", "comp_ruleset_team_publication"} { + if _, err := oDb.DB.ExecContext(ctx, "INSERT INTO "+table+" (ruleset_id, group_id) VALUES (?, ?)", rulesetID, groupID); err != nil { + return fmt.Errorf("addRulesetTeams: %w", err) + } + oDb.SetChange(table) + } + return nil +} + +// UpdateCompRuleset sets the given columns of a ruleset; the keys are checked by +// the caller. +func (oDb *DB) UpdateCompRuleset(ctx context.Context, id int64, fields map[string]any) error { + if len(fields) == 0 { + return nil + } + sets := make([]string, 0, len(fields)) + args := make([]any, 0, len(fields)+1) + for _, k := range sortedKeys(fields) { + sets = append(sets, k+" = ?") + args = append(args, fields[k]) + } + args = append(args, id) + if _, err := oDb.DB.ExecContext(ctx, "UPDATE comp_rulesets SET "+strings.Join(sets, ", ")+" WHERE id = ?", args...); err != nil { + return fmt.Errorf("updateCompRuleset: %w", err) + } + oDb.SetChange("comp_rulesets") + return nil +} + +// DeleteCompRuleset deletes a ruleset with its filtersets, node and service +// attachments, publication and responsible groups, parent and child relations, +// variables and moduleset links, as delete_ruleset(). +func (oDb *DB) DeleteCompRuleset(ctx context.Context, id int64) error { + for _, q := range []struct{ table, cond string }{ + {"comp_rulesets_filtersets", "ruleset_id = ?"}, + {"comp_rulesets_nodes", "ruleset_id = ?"}, + {"comp_rulesets_services", "ruleset_id = ?"}, + {"comp_ruleset_team_publication", "ruleset_id = ?"}, + {"comp_ruleset_team_responsible", "ruleset_id = ?"}, + {"comp_rulesets_rulesets", "parent_rset_id = ? OR child_rset_id = ?"}, + {"comp_rulesets_variables", "ruleset_id = ?"}, + {"comp_rulesets", "id = ?"}, + {"comp_moduleset_ruleset", "ruleset_id = ?"}, + } { + args := []any{id} + if strings.Count(q.cond, "?") == 2 { + args = append(args, id) + } + if _, err := oDb.DB.ExecContext(ctx, "DELETE FROM "+q.table+" WHERE "+q.cond, args...); err != nil { + return fmt.Errorf("deleteCompRuleset: %s: %w", q.table, err) + } + oDb.SetChange(q.table) + } + return nil +} + +// CloneCompRuleset copies a ruleset as "_clone": its type and publicity, +// the filterset of a contextual ruleset, its variables (authored by author), its +// children, under the responsibility and publication of groupID, as +// clone_ruleset(). It returns the id and the name of the copy. +func (oDb *DB) CloneCompRuleset(ctx context.Context, id int64, author string, groupID int64) (int64, string, error) { + var name, rtype, public sql.NullString + err := oDb.DB.QueryRowContext(ctx, "SELECT ruleset_name, ruleset_type, ruleset_public FROM comp_rulesets WHERE id = ?", id). + Scan(&name, &rtype, &public) + if errors.Is(err, sql.ErrNoRows) { + return 0, "", ErrCompNotFound + } else if err != nil { + return 0, "", fmt.Errorf("cloneCompRuleset: %w", err) + } + cloneName := name.String + "_clone" + if _, found, err := oDb.CompRulesetID(ctx, cloneName); err != nil { + return 0, "", err + } else if found { + return 0, "", fmt.Errorf("%w: a ruleset named %s already exists", ErrCompConflict, cloneName) + } + res, err := oDb.DB.ExecContext(ctx, "INSERT INTO comp_rulesets (ruleset_name, ruleset_type, ruleset_public) VALUES (?, ?, ?)", + cloneName, rtype, public) + if err != nil { + return 0, "", fmt.Errorf("cloneCompRuleset: %w", err) + } + newID, err := res.LastInsertId() + if err != nil { + return 0, "", fmt.Errorf("cloneCompRuleset: %w", err) + } + stmts := []struct { + query string + args []any + }{ + {"INSERT INTO comp_rulesets_variables (ruleset_id, var_name, var_class, var_value, var_author, var_updated)" + + " SELECT ?, var_name, var_class, var_value, ?, NOW() FROM comp_rulesets_variables WHERE ruleset_id = ?", []any{newID, author, id}}, + {"INSERT INTO comp_rulesets_rulesets (parent_rset_id, child_rset_id)" + + " SELECT ?, child_rset_id FROM comp_rulesets_rulesets WHERE parent_rset_id = ?", []any{newID, id}}, + } + if rtype.String == "contextual" { + stmts = append(stmts, struct { + query string + args []any + }{"INSERT INTO comp_rulesets_filtersets (ruleset_id, fset_id)" + + " SELECT ?, fset_id FROM comp_rulesets_filtersets WHERE ruleset_id = ? LIMIT 1", []any{newID, id}}) + } + for _, st := range stmts { + if _, err := oDb.DB.ExecContext(ctx, st.query, st.args...); err != nil { + return 0, "", fmt.Errorf("cloneCompRuleset: %w", err) + } + } + if err := oDb.addRulesetTeams(ctx, newID, groupID); err != nil { + return 0, "", err + } + for _, t := range []string{"comp_rulesets", "comp_rulesets_variables", "comp_rulesets_rulesets", "comp_rulesets_filtersets"} { + oDb.SetChange(t) + } + return newID, cloneName, nil +} + +// CompRulesetsChains rebuilds comp_rulesets_chains, the flattened ruleset +// hierarchy: one row per ruleset (chain_len 1), and one per path from a ruleset to +// each of its descendants, named "a > b > c", as comp_rulesets_chains(). +func (oDb *DB) CompRulesetsChains(ctx context.Context) error { + names := map[int64]string{} + var order []int64 + rows, err := oDb.DB.QueryContext(ctx, "SELECT id, COALESCE(ruleset_name, '') FROM comp_rulesets ORDER BY id") + if err != nil { + return fmt.Errorf("compRulesetsChains: %w", err) + } + for rows.Next() { + var id int64 + var name string + if err := rows.Scan(&id, &name); err != nil { + _ = rows.Close() + return fmt.Errorf("compRulesetsChains: %w", err) + } + names[id] = name + order = append(order, id) + } + _ = rows.Close() + children := map[int64][]int64{} + rows, err = oDb.DB.QueryContext(ctx, "SELECT rr.parent_rset_id, rr.child_rset_id FROM comp_rulesets_rulesets rr"+ + " JOIN comp_rulesets r ON r.id = rr.child_rset_id ORDER BY rr.id") + if err != nil { + return fmt.Errorf("compRulesetsChains: %w", err) + } + for rows.Next() { + var parent, child int64 + if err := rows.Scan(&parent, &child); err != nil { + _ = rows.Close() + return fmt.Errorf("compRulesetsChains: %w", err) + } + children[parent] = append(children[parent], child) + } + _ = rows.Close() + + type chain struct { + head, tail int64 + length int + text string + } + var chains []chain + var walk func(path []int64) + walk = func(path []int64) { + last := path[len(path)-1] + for _, child := range children[last] { + // A ruleset already in the path would loop: the relation is refused on + // attachment, a stored cycle is not followed. + loop := false + for _, p := range path { + if p == child { + loop = true + } + } + if loop { + continue + } + next := append(append([]int64{}, path...), child) + parts := make([]string, len(next)) + for i, id := range next { + parts[i] = names[id] + } + chains = append(chains, chain{next[0], child, len(next), strings.Join(parts, " > ")}) + walk(next) + } + } + for _, id := range order { + chains = append(chains, chain{id, id, 1, ""}) + walk([]int64{id}) + } + + if _, err := oDb.DB.ExecContext(ctx, "DELETE FROM comp_rulesets_chains"); err != nil { + return fmt.Errorf("compRulesetsChains: %w", err) + } + for start := 0; start < len(chains); start += 500 { + end := min(start+500, len(chains)) + values := make([]string, 0, end-start) + args := make([]any, 0, 4*(end-start)) + for _, c := range chains[start:end] { + values = append(values, "(?, ?, ?, ?)") + args = append(args, c.head, c.tail, c.length, c.text) + } + if _, err := oDb.DB.ExecContext(ctx, "INSERT INTO comp_rulesets_chains (head_rset_id, tail_rset_id, chain_len, chain) VALUES "+ + strings.Join(values, ", ")+" ON DUPLICATE KEY UPDATE chain_len = VALUES(chain_len), chain = VALUES(chain)", args...); err != nil { + return fmt.Errorf("compRulesetsChains: %w", err) + } + } + oDb.SetChange("comp_rulesets_chains") + return nil +} + +// CompRulesetUsage lists what uses a ruleset: the modulesets and the parent +// rulesets holding it, the nodes and the services it is attached to. +func (oDb *DB) CompRulesetUsage(ctx context.Context, id int64) (map[string][]map[string]any, error) { + out := map[string][]map[string]any{} + for _, q := range []struct{ key, idKey, nameKey, query string }{ + {"modulesets", "id", "modset_name", "SELECT m.id, m.modset_name FROM comp_moduleset_ruleset mr JOIN comp_moduleset m ON m.id = mr.modset_id WHERE mr.ruleset_id = ? ORDER BY m.modset_name"}, + {"rulesets", "id", "ruleset_name", "SELECT r.id, COALESCE(r.ruleset_name, '') FROM comp_rulesets_rulesets rr JOIN comp_rulesets r ON r.id = rr.parent_rset_id WHERE rr.child_rset_id = ? ORDER BY r.ruleset_name"}, + {"nodes", "node_id", "nodename", "SELECT rn.node_id, COALESCE(n.nodename, '') FROM comp_rulesets_nodes rn JOIN nodes n ON n.node_id = rn.node_id WHERE rn.ruleset_id = ? ORDER BY n.nodename"}, + {"services", "svc_id", "svcname", "SELECT rs.svc_id, COALESCE(s.svcname, '') FROM comp_rulesets_services rs JOIN services s ON s.svc_id = rs.svc_id WHERE rs.ruleset_id = ? ORDER BY s.svcname"}, + } { + entries, err := oDb.namedPairs(ctx, q.query, id, q.idKey, q.nameKey) + if err != nil { + return nil, fmt.Errorf("compRulesetUsage: %s: %w", q.key, err) + } + out[q.key] = entries + } + return out, nil +} + +// namedPairs runs a query returning (id, name) rows, as a list of objects with +// the given keys; an integer id stays a number. +func (oDb *DB) namedPairs(ctx context.Context, query string, arg any, idKey, nameKey string) ([]map[string]any, error) { + rows, err := oDb.DB.QueryContext(ctx, query, arg) + if err != nil { + return nil, err + } + defer func() { _ = rows.Close() }() + out := []map[string]any{} + for rows.Next() { + var id, name sql.NullString + if err := rows.Scan(&id, &name); err != nil { + return nil, err + } + var idv any = id.String + if n, err := strconv.ParseInt(id.String, 10, 64); err == nil && idKey == "id" { + idv = n + } + out = append(out, map[string]any{idKey: idv, nameKey: name.String}) + } + return out, rows.Err() +} + +// Errors of the compliance designer, mapped to HTTP statuses by the handlers. +var ( + ErrCompNotFound = errors.New("not found") + ErrCompConflict = errors.New("conflict") +) + +// RulesetIsContextual tells whether a ruleset is contextual, applied through its +// filterset rather than by attachment. +func (oDb *DB) RulesetIsContextual(ctx context.Context, id int64) (bool, error) { + return oDb.exists(ctx, "rulesetIsContextual", "SELECT 1 FROM comp_rulesets WHERE id = ? AND ruleset_type = 'contextual'", id) +} diff --git a/cdb/db_compliance_teams.go b/cdb/db_compliance_teams.go new file mode 100644 index 00000000..929d024a --- /dev/null +++ b/cdb/db_compliance_teams.go @@ -0,0 +1,142 @@ +package cdb + +import ( + "context" + "fmt" +) + +// CompKind names the tables of a compliance object kind that has publication and +// responsible groups: rulesets and modulesets. +type CompKind struct { + // Name is the kind as the messages name it: "ruleset", "moduleset". + Name string + // Table and NameCol are the object table and its name column. + Table, NameCol string + // TeamPrefix is the prefix of the group tables, completed by "publication" + // or "responsible"; FK is their column naming the object. + TeamPrefix, FK string + // NodesTable and ServicesTable hold the attachments to nodes and services, + // by FK and node_id, or FK, svc_id and slave. + NodesTable, ServicesTable string +} + +var ( + CompRulesetKind = CompKind{Name: "ruleset", Table: "comp_rulesets", NameCol: "ruleset_name", + TeamPrefix: "comp_ruleset_team_", FK: "ruleset_id", + NodesTable: "comp_rulesets_nodes", ServicesTable: "comp_rulesets_services"} + CompModulesetKind = CompKind{Name: "moduleset", Table: "comp_moduleset", NameCol: "modset_name", + TeamPrefix: "comp_moduleset_team_", FK: "modset_id", + NodesTable: "comp_node_moduleset", ServicesTable: "comp_modulesets_services"} +) + +// CompTeamTypes are the two kinds of groups of a compliance object. +var CompTeamTypes = []string{"publication", "responsible"} + +func (k CompKind) teamTable(gtype string) (string, error) { + for _, t := range CompTeamTypes { + if t == gtype { + return k.TeamPrefix + gtype, nil + } + } + return "", fmt.Errorf("unknown group type %q", gtype) +} + +// GetCompTeamGroups lists the publication or responsible groups of a compliance +// object; a non-manager sees only those they are a member of, as the historical +// rest_get_compliance_*_publications and _responsibles. +func (oDb *DB) GetCompTeamGroups(ctx context.Context, k CompKind, objID int64, gtype string, p ListParams) ([]map[string]any, error) { + table, err := k.teamTable(gtype) + if err != nil { + return nil, err + } + conds := []string{"auth_group.id IN (SELECT group_id FROM " + table + " WHERE " + k.FK + " = ?)"} + args := []any{objID} + if !p.IsManager { + cond, condArgs := rolesCond("auth_group", p.Groups, false) + conds = append(conds, cond) + args = append(args, condArgs...) + } + return oDb.listQuery(ctx, "getCompTeamGroups", "auth_group", conds, args, "auth_group.role", p) +} + +// CompTeamAttached tells whether a group is a publication or responsible group of +// a compliance object. +func (oDb *DB) CompTeamAttached(ctx context.Context, k CompKind, objID int64, gtype string, groupID int64) (bool, error) { + table, err := k.teamTable(gtype) + if err != nil { + return false, err + } + return oDb.exists(ctx, "compTeamAttached", "SELECT 1 FROM "+table+" WHERE "+k.FK+" = ? AND group_id = ?", objID, groupID) +} + +// AttachCompTeam makes a group a publication or responsible group of a +// compliance object. +func (oDb *DB) AttachCompTeam(ctx context.Context, k CompKind, objID int64, gtype string, groupID int64) error { + table, err := k.teamTable(gtype) + if err != nil { + return err + } + if _, err := oDb.DB.ExecContext(ctx, "INSERT INTO "+table+" ("+k.FK+", group_id) VALUES (?, ?)", objID, groupID); err != nil { + return fmt.Errorf("attachCompTeam: %w", err) + } + oDb.SetChange(table) + return nil +} + +// DetachCompTeam removes a publication or responsible group from a compliance +// object. +func (oDb *DB) DetachCompTeam(ctx context.Context, k CompKind, objID int64, gtype string, groupID int64) error { + table, err := k.teamTable(gtype) + if err != nil { + return err + } + if _, err := oDb.DB.ExecContext(ctx, "DELETE FROM "+table+" WHERE "+k.FK+" = ? AND group_id = ?", objID, groupID); err != nil { + return fmt.Errorf("detachCompTeam: %w", err) + } + oDb.SetChange(table) + return nil +} + +// CompObjectName returns the name of a compliance object. +func (oDb *DB) CompObjectName(ctx context.Context, k CompKind, objID int64) (string, error) { + var name string + if err := oDb.DB.QueryRowContext(ctx, "SELECT COALESCE("+k.NameCol+", '') FROM "+k.Table+" WHERE id = ?", objID).Scan(&name); err != nil { + return "", fmt.Errorf("compObjectName: %w", err) + } + return name, nil +} + +// CompObjectResponsible tells whether one of the caller's organization groups is +// responsible for a compliance object, as ruleset_responsible() and +// moduleset_responsible(); always for a manager, when the object exists. +func (oDb *DB) CompObjectResponsible(ctx context.Context, k CompKind, objID int64, groups []string, isManager bool) (bool, error) { + if isManager { + return oDb.exists(ctx, "compObjectResponsible", "SELECT 1 FROM "+k.Table+" WHERE id = ?", objID) + } + cond, args := rolesCond("ag", groups, true) + return oDb.exists(ctx, "compObjectResponsible", "SELECT 1 FROM "+k.TeamPrefix+"responsible r"+ + " JOIN auth_group ag ON ag.id = r.group_id WHERE r."+k.FK+" = ? AND "+cond, append([]any{objID}, args...)...) +} + +// compObjectVisibleCond restricts a compliance object table to the objects +// published to one of the caller's groups; every object for a manager. +func compObjectVisibleCond(k CompKind, groups []string, isManager bool) (string, []any) { + if isManager { + return "1=1", nil + } + cond, args := rolesCond("ag", groups, false) + return k.Table + ".id IN (SELECT tp." + k.FK + " FROM " + k.TeamPrefix + "publication tp" + + " JOIN auth_group ag ON ag.id = tp.group_id WHERE " + cond + ")", args +} + +// CompObjectPublished tells whether a compliance object is published to the +// caller: to one of their groups or to Everybody, as ruleset_publication() and +// moduleset_publication(); always for a manager, when it exists. +func (oDb *DB) CompObjectPublished(ctx context.Context, k CompKind, objID int64, groups []string, isManager bool) (bool, error) { + cond, args := compObjectVisibleCond(k, groups, isManager) + if ok, err := oDb.exists(ctx, "compObjectPublished", "SELECT 1 FROM "+k.Table+" WHERE "+k.Table+".id = ? AND "+cond, append([]any{objID}, args...)...); err != nil || ok { + return ok, err + } + return oDb.exists(ctx, "compObjectPublished", "SELECT 1 FROM "+k.TeamPrefix+"publication tp"+ + " JOIN auth_group ag ON ag.id = tp.group_id WHERE tp."+k.FK+" = ? AND ag.role = 'Everybody'", objID) +} diff --git a/cdb/db_compliance_variables.go b/cdb/db_compliance_variables.go new file mode 100644 index 00000000..2888943f --- /dev/null +++ b/cdb/db_compliance_variables.go @@ -0,0 +1,190 @@ +package cdb + +import ( + "context" + "database/sql" + "errors" + "fmt" + "strconv" + "strings" + + "github.com/opensvc/oc3/schema" +) + +// The derived tables rulesetsVariablesFrom joins, declared as columns so the +// lists can be filtered and sorted by them: the team roles of each ruleset, and +// the chains from a ruleset to itself and to each ruleset it encapsulates. +var ( + TRsetResponsibles = &schema.Table{Name: "rset_responsibles"} + TRsetPublications = &schema.Table{Name: "rset_publications"} + TRsetChains = &schema.Table{Name: "rset_chains"} + RsetResponsibles = &schema.Col{T: TRsetResponsibles, Name: "teams", Nullable: true} + RsetPublications = &schema.Col{T: TRsetPublications, Name: "teams", Nullable: true} + RsetChainsChain = &schema.Col{T: TRsetChains, Name: "chain", Nullable: true} + RsetChainsLen = &schema.Col{T: TRsetChains, Name: "chain_len", Nullable: true} + RsetChainsEncap = &schema.Col{T: TRsetChains, Name: "encap_rset", Nullable: true} + RsetChainsEncapID = &schema.Col{T: TRsetChains, Name: "encap_rset_id", Nullable: true} +) + +// rulesetsVariablesFrom is the historical v_comp_rulesets view: every ruleset +// with its filterset and teams, and the variables of the ruleset itself then of +// each ruleset it encapsulates, found through comp_rulesets_chains. On its own +// chain a ruleset names no encapsulated ruleset; a ruleset of the chain without +// variable is on a row of its own. +var rulesetsVariablesFrom = "comp_rulesets" + + " LEFT JOIN comp_rulesets_filtersets ON comp_rulesets_filtersets.ruleset_id = comp_rulesets.id" + + " LEFT JOIN gen_filtersets ON gen_filtersets.id = comp_rulesets_filtersets.fset_id " + + compTeamsJoin(CompRulesetKind, "responsible", TRsetResponsibles.Name) + " " + + compTeamsJoin(CompRulesetKind, "publication", TRsetPublications.Name) + + " LEFT JOIN (SELECT c.head_rset_id, c.tail_rset_id, c.chain, c.chain_len," + + " IF(c.tail_rset_id = c.head_rset_id, '', r.ruleset_name) AS encap_rset," + + " IF(c.tail_rset_id = c.head_rset_id, NULL, c.tail_rset_id) AS encap_rset_id" + + " FROM comp_rulesets_chains c JOIN comp_rulesets r ON r.id = c.tail_rset_id) " + TRsetChains.Name + + " ON " + TRsetChains.Name + ".head_rset_id = comp_rulesets.id" + + " LEFT JOIN comp_rulesets_variables ON comp_rulesets_variables.ruleset_id = " + TRsetChains.Name + ".tail_rset_id" + +// GetComplianceRulesetsVariables lists the variables of the rulesets visible to +// the caller, encapsulated ones included, by ruleset, chain and variable name. +func (oDb *DB) GetComplianceRulesetsVariables(ctx context.Context, p ListParams) ([]map[string]any, error) { + cond, args := compRulesetVisibleCond(p.Groups, p.IsManager) + return oDb.listQuery(ctx, "getComplianceRulesetsVariables", rulesetsVariablesFrom, []string{cond}, args, + "comp_rulesets.ruleset_name, "+RsetChainsLen.Qualified()+", "+RsetChainsEncap.Qualified()+", comp_rulesets_variables.var_name", p) +} + +// CompRulesetPublished tells whether a ruleset is published to the caller: to +// one of the caller's groups or to Everybody, as ruleset_publication(); always +// for a manager. +func (oDb *DB) CompRulesetPublished(ctx context.Context, id int64, groups []string, isManager bool) (bool, error) { + if ok, err := oDb.CompRulesetVisible(ctx, id, groups, isManager); err != nil || ok { + return ok, err + } + return oDb.RulesetHasEverybodyPublication(ctx, strconv.FormatInt(id, 10)) +} + +// GetComplianceRulesetVariables lists the variables of a ruleset, by name; one +// when varID is set. +func (oDb *DB) GetComplianceRulesetVariables(ctx context.Context, rulesetID int64, varID *int64, p ListParams) ([]map[string]any, error) { + conds := []string{"comp_rulesets_variables.ruleset_id = ?"} + args := []any{rulesetID} + if varID != nil { + conds = append(conds, "comp_rulesets_variables.id = ?") + args = append(args, *varID) + } + return oDb.listQuery(ctx, "getComplianceRulesetVariables", "comp_rulesets_variables", conds, args, "comp_rulesets_variables.var_name", p) +} + +// CompRulesetVariableID resolves a variable of a ruleset given by id or by name, +// as comp_ruleset_variable_id(); false when the ruleset has none such. +func (oDb *DB) CompRulesetVariableID(ctx context.Context, rulesetID int64, idOrName string) (int64, bool, error) { + var id int64 + var err error + if n, convErr := strconv.ParseInt(idOrName, 10, 64); convErr == nil { + err = oDb.DB.QueryRowContext(ctx, "SELECT id FROM comp_rulesets_variables WHERE ruleset_id = ? AND id = ?", rulesetID, n).Scan(&id) + } else { + err = oDb.DB.QueryRowContext(ctx, "SELECT id FROM comp_rulesets_variables WHERE ruleset_id = ? AND var_name = ? LIMIT 1", rulesetID, idOrName).Scan(&id) + } + switch { + case errors.Is(err, sql.ErrNoRows): + return 0, false, nil + case err != nil: + return 0, false, fmt.Errorf("compRulesetVariableID: %w", err) + } + return id, true, nil +} + +// CompRulesetVariable is a variable of a ruleset, as the change logs name it. +type CompRulesetVariable struct { + ID int64 + RulesetID int64 + RulesetName string + Name string + Class string + Value string +} + +// CompRulesetVariableByID returns a variable with the name of its ruleset. +func (oDb *DB) CompRulesetVariableByID(ctx context.Context, id int64) (*CompRulesetVariable, error) { + var v CompRulesetVariable + var rname, value sql.NullString + err := oDb.DB.QueryRowContext(ctx, "SELECT v.id, v.ruleset_id, r.ruleset_name, v.var_name, v.var_class, v.var_value"+ + " FROM comp_rulesets_variables v JOIN comp_rulesets r ON r.id = v.ruleset_id WHERE v.id = ?", id). + Scan(&v.ID, &v.RulesetID, &rname, &v.Name, &v.Class, &value) + switch { + case errors.Is(err, sql.ErrNoRows): + return nil, ErrCompNotFound + case err != nil: + return nil, fmt.Errorf("compRulesetVariableByID: %w", err) + } + v.RulesetName, v.Value = rname.String, value.String + return &v, nil +} + +// CreateCompRulesetVariable inserts a variable in a ruleset; fields holds +// var_name and optionally var_class and var_value. +func (oDb *DB) CreateCompRulesetVariable(ctx context.Context, rulesetID int64, fields map[string]any, author string) (int64, error) { + cols := []string{"ruleset_id", "var_author", "var_updated"} + vals := []string{"?", "?", "NOW()"} + args := []any{rulesetID, author} + if _, ok := fields["var_class"]; !ok { + fields["var_class"] = "" + } + for _, k := range sortedKeys(fields) { + cols = append(cols, k) + vals = append(vals, "?") + args = append(args, fields[k]) + } + res, err := oDb.DB.ExecContext(ctx, "INSERT INTO comp_rulesets_variables ("+strings.Join(cols, ", ")+") VALUES ("+strings.Join(vals, ", ")+")", args...) + if err != nil { + return 0, fmt.Errorf("createCompRulesetVariable: %w", err) + } + oDb.SetChange("comp_rulesets_variables") + return res.LastInsertId() +} + +// UpdateCompRulesetVariable sets the given columns of a variable, its author and +// its update date. +func (oDb *DB) UpdateCompRulesetVariable(ctx context.Context, id int64, fields map[string]any, author string) error { + sets := []string{"var_author = ?", "var_updated = NOW()"} + args := []any{author} + for _, k := range sortedKeys(fields) { + sets = append(sets, k+" = ?") + args = append(args, fields[k]) + } + args = append(args, id) + if _, err := oDb.DB.ExecContext(ctx, "UPDATE comp_rulesets_variables SET "+strings.Join(sets, ", ")+" WHERE id = ?", args...); err != nil { + return fmt.Errorf("updateCompRulesetVariable: %w", err) + } + oDb.SetChange("comp_rulesets_variables") + return nil +} + +// DeleteCompRulesetVariable deletes a variable. +func (oDb *DB) DeleteCompRulesetVariable(ctx context.Context, id int64) error { + if _, err := oDb.DB.ExecContext(ctx, "DELETE FROM comp_rulesets_variables WHERE id = ?", id); err != nil { + return fmt.Errorf("deleteCompRulesetVariable: %w", err) + } + oDb.SetChange("comp_rulesets_variables") + return nil +} + +// CopyCompRulesetVariable copies a variable to another ruleset, authored by +// author, as copy_variable_to_ruleset(). +func (oDb *DB) CopyCompRulesetVariable(ctx context.Context, id, dstRulesetID int64, author string) (int64, error) { + res, err := oDb.DB.ExecContext(ctx, "INSERT INTO comp_rulesets_variables (ruleset_id, var_name, var_class, var_value, var_author, var_updated)"+ + " SELECT ?, var_name, var_class, var_value, ?, NOW() FROM comp_rulesets_variables WHERE id = ?", dstRulesetID, author, id) + if err != nil { + return 0, fmt.Errorf("copyCompRulesetVariable: %w", err) + } + oDb.SetChange("comp_rulesets_variables") + return res.LastInsertId() +} + +// MoveCompRulesetVariable moves a variable to another ruleset, as +// move_variable_to_ruleset(). +func (oDb *DB) MoveCompRulesetVariable(ctx context.Context, id, dstRulesetID int64) error { + if _, err := oDb.DB.ExecContext(ctx, "UPDATE comp_rulesets_variables SET ruleset_id = ? WHERE id = ?", dstRulesetID, id); err != nil { + return fmt.Errorf("moveCompRulesetVariable: %w", err) + } + oDb.SetChange("comp_rulesets_variables") + return nil +} diff --git a/cdb/db_dashboard.go b/cdb/db_dashboard.go index c08a9c31..98a0805a 100644 --- a/cdb/db_dashboard.go +++ b/cdb/db_dashboard.go @@ -40,7 +40,9 @@ func (oDb *DB) GetAlerts(ctx context.Context, p ListParams) ([]map[string]any, e return nil, fmt.Errorf("getAlerts: no select expressions") } - query := "SELECT " + strings.Join(p.SelectExprs, ", ") + " FROM dashboard" + // Joined so that "nodes.nodename" and "services.svcname" can be selected: + // a dashboard row only carries the ids. + query := "SELECT " + strings.Join(p.SelectExprs, ", ") + " FROM dashboard LEFT JOIN nodes ON nodes.node_id = dashboard.node_id LEFT JOIN services ON services.svc_id = dashboard.svc_id" var args []any if gb := p.GroupByClause(""); gb != "" { query += " " + gb @@ -62,7 +64,7 @@ func (oDb *DB) GetAlert(ctx context.Context, id string, p ListParams) ([]map[str return nil, fmt.Errorf("getAlert: no select expressions") } - query := "SELECT " + strings.Join(p.SelectExprs, ", ") + " FROM dashboard WHERE dashboard.id = ?" + query := "SELECT " + strings.Join(p.SelectExprs, ", ") + " FROM dashboard LEFT JOIN nodes ON nodes.node_id = dashboard.node_id LEFT JOIN services ON services.svc_id = dashboard.svc_id WHERE dashboard.id = ?" args := []any{id} query += " " + p.OrderByClause("dashboard.id DESC") query, args = appendLimitOffset(query, args, p.Limit, p.Offset) diff --git a/cdb/db_disks.go b/cdb/db_disks.go index 3d534c25..877d1117 100644 --- a/cdb/db_disks.go +++ b/cdb/db_disks.go @@ -7,7 +7,7 @@ import ( "github.com/opensvc/oc3/schema" ) -func buildDisksQuery(groups []string, isManager bool, selectExprs []string) (string, []any, error) { +func buildDisksQuery(groups []string, isManager bool, selectExprs []string, filters []ColumnFilter) (string, []any, error) { q := From(schema.TDiskinfo). LeftJoin(schema.TSvcdisks, schema.TNodes, schema.TServices, schema.TApps). RawSelect(selectExprs...) @@ -37,6 +37,9 @@ func buildDisksQuery(groups []string, isManager bool, selectExprs []string) (str q = q.Where(schema.DiskinfoID, ">", 0) } + // Column filters of the request, ANDed with the access control above. + q = q.WhereFilters(filters) + query, args, err := q.Build() if err != nil { return "", nil, fmt.Errorf("buildDisksQuery: %w", err) @@ -45,7 +48,7 @@ func buildDisksQuery(groups []string, isManager bool, selectExprs []string) (str } func (oDb *DB) GetDisk(ctx context.Context, diskID string, p ListParams) ([]map[string]any, error) { - query, args, err := buildDisksQuery(p.Groups, p.IsManager, p.SelectExprs) + query, args, err := buildDisksQuery(p.Groups, p.IsManager, p.SelectExprs, p.Filters) if err != nil { return nil, err } @@ -118,7 +121,7 @@ func (oDb *DB) GetServiceDisks(ctx context.Context, svcID string, p ListParams) } func (oDb *DB) GetNodeDisks(ctx context.Context, nodeID string, p ListParams) ([]map[string]any, error) { - query, args, err := buildDisksQuery(p.Groups, p.IsManager, p.SelectExprs) + query, args, err := buildDisksQuery(p.Groups, p.IsManager, p.SelectExprs, p.Filters) if err != nil { return nil, err } @@ -140,7 +143,7 @@ func (oDb *DB) GetNodeDisks(ctx context.Context, nodeID string, p ListParams) ([ } func (oDb *DB) GetDisks(ctx context.Context, p ListParams) ([]map[string]any, error) { - query, args, err := buildDisksQuery(p.Groups, p.IsManager, p.SelectExprs) + query, args, err := buildDisksQuery(p.Groups, p.IsManager, p.SelectExprs, p.Filters) if err != nil { return nil, err } diff --git a/cdb/db_filtersets.go b/cdb/db_filtersets.go index e714e44a..5097eef1 100644 --- a/cdb/db_filtersets.go +++ b/cdb/db_filtersets.go @@ -616,7 +616,10 @@ func (oDb *DB) GetFiltersets(ctx context.Context, p ListParams) ([]map[string]an } query := "SELECT " + strings.Join(p.SelectExprs, ", ") + " FROM gen_filtersets WHERE gen_filtersets.id > 0" - args := []any{} + filterConds, args := p.FilterConditions() + for _, cond := range filterConds { + query += " AND " + cond + } if gb := p.GroupByClause(""); gb != "" { query += " " + gb } diff --git a/cdb/db_forms.go b/cdb/db_forms.go new file mode 100644 index 00000000..d8215b1a --- /dev/null +++ b/cdb/db_forms.go @@ -0,0 +1,315 @@ +package cdb + +import ( + "context" + "database/sql" + "errors" + "fmt" + "sort" + "strings" +) + +// Form is a row of the forms table. +type Form struct { + ID int64 + Name string + Yaml string + Author string + Created string + Type string + Folder string +} + +// formCols lists the forms columns a caller may set, as the historical collector +// wrote any posted key to the table. +var formCols = map[string]bool{ + "form_name": true, "form_yaml": true, "form_author": true, + "form_created": true, "form_type": true, "form_folder": true, +} + +// IsFormColumn reports whether a posted key is a settable forms column. +func IsFormColumn(key string) bool { return formCols[key] } + +// formPublishedCond restricts forms to those published to one of the caller's +// groups, as the historical collector does for a non-manager. +func formPublishedCond(formIDExpr string, groups []string) (string, []any) { + if len(groups) == 0 { + return "1=0", nil + } + args := make([]any, len(groups)) + for i, g := range groups { + args[i] = g + } + return formIDExpr + " IN (SELECT ftp.form_id FROM forms_team_publication ftp" + + " JOIN auth_group ag ON ag.id = ftp.group_id WHERE ag.role IN (" + Placeholders(len(groups)) + "))", args +} + +// GetForms lists the forms visible to the caller, one form when formID is set. +func (oDb *DB) GetForms(ctx context.Context, formID *int64, p ListParams) ([]map[string]any, error) { + if len(p.SelectExprs) == 0 { + return nil, fmt.Errorf("getForms: no select expressions") + } + conds := []string{"forms.id > 0"} + var args []any + if formID != nil { + conds = append(conds, "forms.id = ?") + args = append(args, *formID) + } + if !p.IsManager { + cond, condArgs := formPublishedCond("forms.id", p.Groups) + conds = append(conds, cond) + args = append(args, condArgs...) + } + filterConds, filterArgs := p.FilterConditions() + conds = append(conds, filterConds...) + args = append(args, filterArgs...) + + query := "SELECT " + strings.Join(p.SelectExprs, ", ") + " FROM forms WHERE " + strings.Join(conds, " AND ") + if gb := p.GroupByClause(""); gb != "" { + query += " " + gb + } + query += " " + p.OrderByClause("forms.form_name") + query, args = appendLimitOffset(query, args, p.Limit, p.Offset) + rows, err := oDb.DB.QueryContext(ctx, query, args...) + if err != nil { + return nil, fmt.Errorf("getForms: %w", err) + } + defer func() { _ = rows.Close() }() + return scanRowsToMaps(rows, p.Props, p.TypeHints) +} + +// FormByID returns a form, nil when it does not exist. +func (oDb *DB) FormByID(ctx context.Context, id int64) (*Form, error) { + var f Form + var name, yaml, author, typ, folder sql.NullString + err := oDb.DB.QueryRowContext(ctx, "SELECT id, form_name, form_yaml, form_author, COALESCE(form_created, ''),"+ + " form_type, form_folder FROM forms WHERE id = ?", id). + Scan(&f.ID, &name, &yaml, &author, &f.Created, &typ, &folder) + switch { + case errors.Is(err, sql.ErrNoRows): + return nil, nil + case err != nil: + return nil, fmt.Errorf("formByID: %w", err) + } + f.Name, f.Yaml, f.Author, f.Type, f.Folder = name.String, yaml.String, author.String, typ.String, folder.String + return &f, nil +} + +// FormIDByName returns the id of the form with that name. +func (oDb *DB) FormIDByName(ctx context.Context, name string) (int64, bool, error) { + var id int64 + err := oDb.DB.QueryRowContext(ctx, "SELECT id FROM forms WHERE form_name = ?", name).Scan(&id) + switch { + case errors.Is(err, sql.ErrNoRows): + return 0, false, nil + case err != nil: + return 0, false, fmt.Errorf("formIDByName: %w", err) + } + return id, true, nil +} + +// FormVisible reports whether the form exists and the caller may see it: a +// manager sees every form, others the forms published to one of their groups. +func (oDb *DB) FormVisible(ctx context.Context, formID int64, groups []string, isManager bool) (bool, error) { + return oDb.formLinked(ctx, "forms_team_publication", formID, groups, isManager) +} + +// FormResponsible reports whether the caller is responsible for the form: a +// manager is responsible for every form, others through a responsible group. +func (oDb *DB) FormResponsible(ctx context.Context, formID int64, groups []string, isManager bool) (bool, error) { + return oDb.formLinked(ctx, "forms_team_responsible", formID, groups, isManager) +} + +func (oDb *DB) formLinked(ctx context.Context, table string, formID int64, groups []string, isManager bool) (bool, error) { + query := "SELECT 1 FROM forms WHERE forms.id = ?" + args := []any{formID} + if !isManager { + if len(groups) == 0 { + return false, nil + } + query += " AND forms.id IN (SELECT t.form_id FROM " + table + " t JOIN auth_group ag ON ag.id = t.group_id" + + " WHERE ag.role IN (" + Placeholders(len(groups)) + "))" + for _, g := range groups { + args = append(args, g) + } + } + var one int + err := oDb.DB.QueryRowContext(ctx, query+" LIMIT 1", args...).Scan(&one) + switch { + case errors.Is(err, sql.ErrNoRows): + return false, nil + case err != nil: + return false, fmt.Errorf("formLinked %s: %w", table, err) + } + return true, nil +} + +// sortedKeys returns the keys of a column map in a stable order, for the SQL. +func sortedKeys(fields map[string]any) []string { + keys := make([]string, 0, len(fields)) + for k := range fields { + keys = append(keys, k) + } + sort.Strings(keys) + return keys +} + +// InsertForm creates a form from settable columns and returns its id. +func (oDb *DB) InsertForm(ctx context.Context, fields map[string]any) (int64, error) { + keys := sortedKeys(fields) + args := make([]any, len(keys)) + for i, k := range keys { + if !formCols[k] { + return 0, fmt.Errorf("insertForm: unknown column %s", k) + } + args[i] = fields[k] + } + query := "INSERT INTO forms (" + strings.Join(keys, ", ") + ") VALUES (" + Placeholders(len(keys)) + ")" + res, err := oDb.ExecContext(ctx, query, args...) + if err != nil { + return 0, fmt.Errorf("insertForm: %w", err) + } + oDb.SetChange("forms") + return res.LastInsertId() +} + +// UpdateForm sets settable columns of a form. +func (oDb *DB) UpdateForm(ctx context.Context, id int64, fields map[string]any) error { + if len(fields) == 0 { + return nil + } + keys := sortedKeys(fields) + sets := make([]string, len(keys)) + args := make([]any, 0, len(keys)+1) + for i, k := range keys { + if !formCols[k] { + return fmt.Errorf("updateForm: unknown column %s", k) + } + sets[i] = k + " = ?" + args = append(args, fields[k]) + } + args = append(args, id) + if _, err := oDb.ExecContext(ctx, "UPDATE forms SET "+strings.Join(sets, ", ")+" WHERE id = ?", args...); err != nil { + return fmt.Errorf("updateForm: %w", err) + } + oDb.SetChange("forms") + return nil +} + +// DeleteForm deletes a form with its publications and responsibles. +func (oDb *DB) DeleteForm(ctx context.Context, id int64) error { + for _, table := range []string{"forms", "forms_team_publication", "forms_team_responsible"} { + col := "form_id" + if table == "forms" { + col = "id" + } + if _, err := oDb.ExecContext(ctx, "DELETE FROM "+table+" WHERE "+col+" = ?", id); err != nil { + return fmt.Errorf("deleteForm %s: %w", table, err) + } + oDb.SetChange(table) + } + return nil +} + +// FormTeamTable names the table of a form/group link: publications or +// responsibles. +type FormTeamTable string + +const ( + FormPublications FormTeamTable = "forms_team_publication" + FormResponsibles FormTeamTable = "forms_team_responsible" +) + +// FormTeamExists reports whether the form is linked to the group. +func (oDb *DB) FormTeamExists(ctx context.Context, table FormTeamTable, formID, groupID int64) (bool, error) { + var one int + err := oDb.DB.QueryRowContext(ctx, "SELECT 1 FROM "+string(table)+" WHERE form_id = ? AND group_id = ? LIMIT 1", + formID, groupID).Scan(&one) + switch { + case errors.Is(err, sql.ErrNoRows): + return false, nil + case err != nil: + return false, fmt.Errorf("formTeamExists: %w", err) + } + return true, nil +} + +// InsertFormTeam links the form to the group. +func (oDb *DB) InsertFormTeam(ctx context.Context, table FormTeamTable, formID, groupID int64) error { + if _, err := oDb.ExecContext(ctx, "INSERT INTO "+string(table)+" (form_id, group_id) VALUES (?, ?)", formID, groupID); err != nil { + return fmt.Errorf("insertFormTeam: %w", err) + } + oDb.SetChange(string(table)) + return nil +} + +// DeleteFormTeam unlinks the form from the group. +func (oDb *DB) DeleteFormTeam(ctx context.Context, table FormTeamTable, formID, groupID int64) error { + if _, err := oDb.ExecContext(ctx, "DELETE FROM "+string(table)+" WHERE form_id = ? AND group_id = ?", formID, groupID); err != nil { + return fmt.Errorf("deleteFormTeam: %w", err) + } + oDb.SetChange(string(table)) + return nil +} + +// GetFormTeam lists the groups linked to a form, as auth_group rows. +func (oDb *DB) GetFormTeam(ctx context.Context, table FormTeamTable, formID int64, p ListParams) ([]map[string]any, error) { + if len(p.SelectExprs) == 0 { + return nil, fmt.Errorf("getFormTeam: no select expressions") + } + conds := []string{"t.form_id = ?"} + args := []any{formID} + filterConds, filterArgs := p.FilterConditions() + conds = append(conds, filterConds...) + args = append(args, filterArgs...) + query := "SELECT " + strings.Join(p.SelectExprs, ", ") + " FROM auth_group JOIN " + string(table) + + " t ON t.group_id = auth_group.id WHERE " + strings.Join(conds, " AND ") + if gb := p.GroupByClause(""); gb != "" { + query += " " + gb + } + query += " " + p.OrderByClause("auth_group.role") + query, args = appendLimitOffset(query, args, p.Limit, p.Offset) + rows, err := oDb.DB.QueryContext(ctx, query, args...) + if err != nil { + return nil, fmt.Errorf("getFormTeam: %w", err) + } + defer func() { _ = rows.Close() }() + return scanRowsToMaps(rows, p.Props, p.TypeHints) +} + +// UserName returns "First Last" of a user, as the historical collector names the +// author of a change, and the email. +func (oDb *DB) UserName(ctx context.Context, userID int64) (string, string, error) { + var first, last, email sql.NullString + err := oDb.DB.QueryRowContext(ctx, "SELECT first_name, last_name, email FROM auth_user WHERE id = ?", userID). + Scan(&first, &last, &email) + switch { + case errors.Is(err, sql.ErrNoRows): + return "Unknown", "", nil + case err != nil: + return "", "", fmt.Errorf("userName: %w", err) + } + return first.String + " " + last.String, email.String, nil +} + +// UserEmailByName returns the email of the user named "First Last", as +// email_of() resolves a mail recipient given by name. +func (oDb *DB) UserEmailByName(ctx context.Context, name string) (string, bool, error) { + rows, err := oDb.DB.QueryContext(ctx, `SELECT email FROM auth_user WHERE CONCAT(first_name, " ", last_name) = ?`, name) + if err != nil { + return "", false, fmt.Errorf("userEmailByName: %w", err) + } + defer func() { _ = rows.Close() }() + var emails []string + for rows.Next() { + var email sql.NullString + if err := rows.Scan(&email); err != nil { + return "", false, fmt.Errorf("userEmailByName: %w", err) + } + emails = append(emails, email.String) + } + if len(emails) != 1 { + return "", false, rows.Err() + } + return emails[0], true, rows.Err() +} diff --git a/cdb/db_forms_store.go b/cdb/db_forms_store.go new file mode 100644 index 00000000..95872118 --- /dev/null +++ b/cdb/db_forms_store.go @@ -0,0 +1,198 @@ +package cdb + +import ( + "context" + "database/sql" + "errors" + "fmt" + "strconv" + "strings" +) + +// listQuery runs a hand-built list query: the select expressions of the request +// over from, the conditions and the filters ANDed, then grouping, sort and page. +func (oDb *DB) listQuery(ctx context.Context, name, from string, conds []string, args []any, defaultOrder string, p ListParams) ([]map[string]any, error) { + if len(p.SelectExprs) == 0 { + return nil, fmt.Errorf("%s: no select expressions", name) + } + filterConds, filterArgs := p.FilterConditions() + conds = append(conds, filterConds...) + args = append(args, filterArgs...) + query := "SELECT " + strings.Join(p.SelectExprs, ", ") + " FROM " + from + if len(conds) > 0 { + query += " WHERE " + strings.Join(conds, " AND ") + } + if gb := p.GroupByClause(""); gb != "" { + query += " " + gb + } + query += " " + p.OrderByClause(defaultOrder) + query, args = appendLimitOffset(query, args, p.Limit, p.Offset) + rows, err := oDb.DB.QueryContext(ctx, query, args...) + if err != nil { + return nil, fmt.Errorf("%s: %w", name, err) + } + defer func() { _ = rows.Close() }() + return scanRowsToMaps(rows, p.Props, p.TypeHints) +} + +// GetFormsRevisions lists the form revisions, one when idOrMD5 is set: a +// numeric value is an id, anything else a md5, as the historical handler does. +func (oDb *DB) GetFormsRevisions(ctx context.Context, idOrMD5 *string, p ListParams) ([]map[string]any, error) { + conds := []string{"forms_revisions.id > 0"} + var args []any + if idOrMD5 != nil { + if _, err := strconv.ParseInt(*idOrMD5, 10, 64); err == nil { + conds = append(conds, "forms_revisions.id = ?") + } else { + conds = append(conds, "forms_revisions.form_md5 = ?") + } + args = append(args, *idOrMD5) + } + return oDb.listQuery(ctx, "getFormsRevisions", "forms_revisions", conds, args, "forms_revisions.id", p) +} + +// formsStoreFrom joins the stored forms to the revision they were submitted +// with, as the v_forms_store view of the historical collector. +const formsStoreFrom = "forms_store JOIN forms_revisions ON forms_revisions.form_md5 = forms_store.form_md5" + +// GetFormsStore lists the forms stored by workflows, one when storeID is set. +func (oDb *DB) GetFormsStore(ctx context.Context, storeID *int64, p ListParams) ([]map[string]any, error) { + conds := []string{"forms_store.id > 0"} + var args []any + if storeID != nil { + conds = append(conds, "forms_store.id = ?") + args = append(args, *storeID) + } + return oDb.listQuery(ctx, "getFormsStore", formsStoreFrom, conds, args, "forms_store.id", p) +} + +// workflowsFrom joins the form revision a workflow started from, for its name, +// folder and definition; a workflow whose revision is missing is still listed. +const workflowsFrom = "workflows LEFT JOIN forms_revisions ON forms_revisions.form_md5 = workflows.form_md5" + +// myTeamNames is the subquery naming the caller and their team, as the historical +// requests tables compare them with a workflow's creator and last assignee: the +// user's full name ("first last") and the roles of their non-privilege groups. +const myTeamNames = "(SELECT CONCAT(COALESCE(first_name, ''), ' ', COALESCE(last_name, '')) FROM auth_user WHERE id = ?" + + " UNION SELECT auth_group.role FROM auth_group" + + " JOIN auth_membership ON auth_membership.group_id = auth_group.id" + + " WHERE auth_membership.user_id = ? AND auth_group.privilege = 'F')" + +// Workflows assigned to the caller's team, or started by it and awaiting a +// tier, as the historical "Assigned to my team" and "Pending tiers action". +const ( + WorkflowsAssignedTeam = "team" + WorkflowsAssignedTiers = "tiers" +) + +// GetWorkflows lists the workflows, one when id is set. assigned, when set, +// keeps the pending workflows assigned to the caller's team (WorkflowsAssignedTeam), +// or started by it and assigned to someone else (WorkflowsAssignedTiers); it +// requires p.UserID, and matches nothing without it. +func (oDb *DB) GetWorkflows(ctx context.Context, id *int64, assigned string, p ListParams) ([]map[string]any, error) { + conds := []string{"workflows.id > 0"} + var args []any + if id != nil { + conds = append(conds, "workflows.id = ?") + args = append(args, *id) + } + switch { + case assigned == "": + case p.UserID == nil: + conds = append(conds, "1=0") + case assigned == WorkflowsAssignedTeam: + conds = append(conds, "workflows.status != 'closed'", + "workflows.last_assignee IN "+myTeamNames) + args = append(args, *p.UserID, *p.UserID) + case assigned == WorkflowsAssignedTiers: + conds = append(conds, "workflows.status != 'closed'", + "workflows.last_assignee NOT IN "+myTeamNames, + "workflows.creator IN "+myTeamNames) + args = append(args, *p.UserID, *p.UserID, *p.UserID, *p.UserID) + default: + return nil, fmt.Errorf("getWorkflows: unknown assigned value %q", assigned) + } + return oDb.listQuery(ctx, "getWorkflows", workflowsFrom, conds, args, "workflows.id", p) +} + +// WorkflowIDByHead returns the workflow started by a stored form. +func (oDb *DB) WorkflowIDByHead(ctx context.Context, headID int64) (int64, bool, error) { + var id int64 + err := oDb.DB.QueryRowContext(ctx, "SELECT id FROM workflows WHERE form_head_id = ?", headID).Scan(&id) + switch { + case errors.Is(err, sql.ErrNoRows): + return 0, false, nil + case err != nil: + return 0, false, fmt.Errorf("workflowIDByHead: %w", err) + } + return id, true, nil +} + +// FormResultsAccess is the caller of a form results request, for the access +// filter of q_filter(user_field, node_field, svc_field). +type FormResultsAccess struct { + IsManager bool + UserID *int64 + NodeID string +} + +// FormOutputResults returns the results structure of a submission, as stored, +// when the caller may read it: a manager reads every result; a user those +// submitted by the users sharing one of their organization groups; a node +// those of its services, and its own. +func (oDb *DB) FormOutputResults(ctx context.Context, id int64, access FormResultsAccess) (string, bool, error) { + query := "SELECT COALESCE(results, '') FROM form_output_results WHERE id = ?" + args := []any{id} + switch { + case access.NodeID != "": + query += " AND (node_id = ? OR svc_id IN (SELECT svc_id FROM svcmon WHERE node_id = ?))" + args = append(args, access.NodeID, access.NodeID) + case access.IsManager: + case access.UserID != nil: + query += " AND user_id IN (SELECT DISTINCT m.user_id FROM auth_membership m" + + " WHERE m.group_id IN (SELECT g.id FROM auth_group g JOIN auth_membership am ON am.group_id = g.id" + + " WHERE am.user_id = ? AND g.privilege = 'F'))" + args = append(args, *access.UserID) + default: + return "", false, nil + } + var results string + err := oDb.DB.QueryRowContext(ctx, query, args...).Scan(&results) + switch { + case errors.Is(err, sql.ErrNoRows): + return "", false, nil + case err != nil: + return "", false, fmt.Errorf("formOutputResults: %w", err) + } + return results, true, nil +} + +// InsertFormOutputResults stores the results structure of a new submission. +func (oDb *DB) InsertFormOutputResults(ctx context.Context, userID *int64, nodeID, svcID, results string) (int64, error) { + res, err := oDb.ExecContext(ctx, "INSERT INTO form_output_results (user_id, node_id, svc_id, results) VALUES (?, ?, ?, ?)", + userID, nodeID, svcID, results) + if err != nil { + return 0, fmt.Errorf("insertFormOutputResults: %w", err) + } + oDb.SetChange("form_output_results") + return res.LastInsertId() +} + +// UpdateFormOutputResults replaces the results structure of a submission. +func (oDb *DB) UpdateFormOutputResults(ctx context.Context, id int64, results string) error { + if _, err := oDb.ExecContext(ctx, "UPDATE form_output_results SET results = ? WHERE id = ?", results, id); err != nil { + return fmt.Errorf("updateFormOutputResults: %w", err) + } + oDb.SetChange("form_output_results") + return nil +} + +// ReadFormOutputResults returns the stored results structure, without access +// filter: for the submission engine, which owns it. +func (oDb *DB) ReadFormOutputResults(ctx context.Context, id int64) (string, error) { + var results sql.NullString + if err := oDb.DB.QueryRowContext(ctx, "SELECT results FROM form_output_results WHERE id = ?", id).Scan(&results); err != nil { + return "", fmt.Errorf("readFormOutputResults: %w", err) + } + return results.String, nil +} diff --git a/cdb/db_forms_submit.go b/cdb/db_forms_submit.go new file mode 100644 index 00000000..9f727233 --- /dev/null +++ b/cdb/db_forms_submit.go @@ -0,0 +1,201 @@ +package cdb + +import ( + "context" + "crypto/md5" + "database/sql" + "encoding/hex" + "errors" + "fmt" + "strings" +) + +// TableColumns returns the columns of a table of the collector database, none +// when the table does not exist. +func (oDb *DB) TableColumns(ctx context.Context, table string) ([]string, error) { + rows, err := oDb.DB.QueryContext(ctx, "SELECT column_name FROM information_schema.columns"+ + " WHERE table_schema = DATABASE() AND table_name = ? ORDER BY ordinal_position", table) + if err != nil { + return nil, fmt.Errorf("tableColumns: %w", err) + } + defer func() { _ = rows.Close() }() + var cols []string + for rows.Next() { + var col string + if err := rows.Scan(&col); err != nil { + return nil, fmt.Errorf("tableColumns: %w", err) + } + cols = append(cols, col) + } + return cols, rows.Err() +} + +// InsertRow inserts a row in a table, the keys checked against its columns by +// the caller. +func (oDb *DB) InsertRow(ctx context.Context, table string, row map[string]any) error { + keys := sortedKeys(row) + quoted := make([]string, len(keys)) + args := make([]any, len(keys)) + for i, k := range keys { + quoted[i] = "`" + strings.ReplaceAll(k, "`", "") + "`" + args[i] = row[k] + } + query := "INSERT INTO `" + strings.ReplaceAll(table, "`", "") + "` (" + strings.Join(quoted, ", ") + + ") VALUES (" + Placeholders(len(keys)) + ")" + if _, err := oDb.ExecContext(ctx, query, args...); err != nil { + return err + } + oDb.SetChange(table) + return nil +} + +// UserPrimaryOrgGroupRole returns the role of the user's primary group when it +// is not a privilege group, as user_primary_group() does. +func (oDb *DB) UserPrimaryOrgGroupRole(ctx context.Context, userID int64) (string, bool, error) { + var role sql.NullString + err := oDb.DB.QueryRowContext(ctx, "SELECT auth_group.role FROM auth_group"+ + " JOIN auth_membership ON auth_membership.group_id = auth_group.id"+ + " WHERE auth_membership.user_id = ? AND auth_membership.primary_group = 'T'"+ + " AND auth_group.privilege = 'F' LIMIT 1", userID).Scan(&role) + switch { + case errors.Is(err, sql.ErrNoRows): + return "", false, nil + case err != nil: + return "", false, fmt.Errorf("userPrimaryOrgGroupRole: %w", err) + } + return role.String, role.Valid, nil +} + +// InsertFormRevisionMD5 records the definition a form is submitted with, once +// per content, and returns its md5, as insert_form_md5() does. +func (oDb *DB) InsertFormRevisionMD5(ctx context.Context, f *Form) (string, error) { + sum := md5.Sum([]byte(f.Yaml)) + formMD5 := hex.EncodeToString(sum[:]) + var one int + err := oDb.DB.QueryRowContext(ctx, "SELECT 1 FROM forms_revisions WHERE form_md5 = ?", formMD5).Scan(&one) + switch { + case err == nil: + return formMD5, nil + case !errors.Is(err, sql.ErrNoRows): + return "", fmt.Errorf("insertFormRevisionMD5: %w", err) + } + if _, err := oDb.ExecContext(ctx, "INSERT INTO forms_revisions (form_id, form_yaml, form_folder, form_name, form_md5)"+ + " VALUES (?, ?, ?, ?, ?)", f.ID, f.Yaml, f.Folder, f.Name, formMD5); err != nil { + return "", fmt.Errorf("insertFormRevisionMD5: %w", err) + } + oDb.SetChange("forms_revisions") + return formMD5, nil +} + +// StoredFormLink is what a workflow step needs from a stored form. +type StoredFormLink struct { + ID int64 + PrevID *int64 + NextID *int64 + Submitter string + SubmitDate string +} + +// StoredFormLinkByID returns the links of a stored form, nil when it does not +// exist. +func (oDb *DB) StoredFormLinkByID(ctx context.Context, id int64) (*StoredFormLink, error) { + var l StoredFormLink + var prev, next sql.NullInt64 + err := oDb.DB.QueryRowContext(ctx, "SELECT id, form_prev_id, form_next_id, form_submitter,"+ + " DATE_FORMAT(form_submit_date, '%Y-%m-%d %H:%i:%s') FROM forms_store WHERE id = ?", id). + Scan(&l.ID, &prev, &next, &l.Submitter, &l.SubmitDate) + switch { + case errors.Is(err, sql.ErrNoRows): + return nil, nil + case err != nil: + return nil, fmt.Errorf("storedFormLinkByID: %w", err) + } + if prev.Valid { + l.PrevID = &prev.Int64 + } + if next.Valid { + l.NextID = &next.Int64 + } + return &l, nil +} + +// StoredFormInsert is a new step of a workflow. +type StoredFormInsert struct { + MD5 string + Submitter string + Assignee string + Date string + PrevID *int64 + NextID *int64 + HeadID *int64 + Data string + ResultsID int64 +} + +// InsertStoredForm stores a submitted form as a workflow step and returns its id. +func (oDb *DB) InsertStoredForm(ctx context.Context, s StoredFormInsert) (int64, error) { + res, err := oDb.ExecContext(ctx, "INSERT INTO forms_store (form_md5, form_submitter, form_assignee,"+ + " form_submit_date, form_prev_id, form_next_id, form_head_id, form_data, results_id)"+ + " VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)", + s.MD5, s.Submitter, s.Assignee, s.Date, s.PrevID, s.NextID, s.HeadID, s.Data, s.ResultsID) + if err != nil { + return 0, fmt.Errorf("insertStoredForm: %w", err) + } + oDb.SetChange("forms_store") + return res.LastInsertId() +} + +// SetStoredFormNext links a workflow step to the next one. +func (oDb *DB) SetStoredFormNext(ctx context.Context, id, nextID int64) error { + if _, err := oDb.ExecContext(ctx, "UPDATE forms_store SET form_next_id = ? WHERE id = ?", nextID, id); err != nil { + return fmt.Errorf("setStoredFormNext: %w", err) + } + oDb.SetChange("forms_store") + return nil +} + +// SetStoredFormHead makes a stored form the head of its own workflow. +func (oDb *DB) SetStoredFormHead(ctx context.Context, id int64) error { + if _, err := oDb.ExecContext(ctx, "UPDATE forms_store SET form_head_id = ? WHERE id = ?", id, id); err != nil { + return fmt.Errorf("setStoredFormHead: %w", err) + } + oDb.SetChange("forms_store") + return nil +} + +// WorkflowInsert is a new workflow, or the new state of an existing one. +type WorkflowInsert struct { + Status string + MD5 string + Steps int + LastAssignee string + LastUpdate string + LastFormID int64 + LastFormName string + HeadID int64 + Creator string + CreateDate string +} + +// InsertWorkflow creates a workflow and returns its id. +func (oDb *DB) InsertWorkflow(ctx context.Context, w WorkflowInsert) (int64, error) { + res, err := oDb.ExecContext(ctx, "INSERT INTO workflows (status, form_md5, steps, last_assignee, last_update,"+ + " last_form_id, last_form_name, form_head_id, creator, create_date) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)", + w.Status, w.MD5, w.Steps, w.LastAssignee, w.LastUpdate, w.LastFormID, w.LastFormName, w.HeadID, w.Creator, w.CreateDate) + if err != nil { + return 0, fmt.Errorf("insertWorkflow: %w", err) + } + oDb.SetChange("workflows") + return res.LastInsertId() +} + +// UpdateWorkflowStep records a new step of the workflow started by headID. +func (oDb *DB) UpdateWorkflowStep(ctx context.Context, headID int64, w WorkflowInsert) error { + if _, err := oDb.ExecContext(ctx, "UPDATE workflows SET status = ?, steps = ?, last_assignee = ?,"+ + " last_form_id = ?, last_form_name = ?, last_update = ? WHERE form_head_id = ?", + w.Status, w.Steps, w.LastAssignee, w.LastFormID, w.LastFormName, w.LastUpdate, headID); err != nil { + return fmt.Errorf("updateWorkflowStep: %w", err) + } + oDb.SetChange("workflows") + return nil +} diff --git a/cdb/db_ips.go b/cdb/db_ips.go index f03d7065..666d1772 100644 --- a/cdb/db_ips.go +++ b/cdb/db_ips.go @@ -6,8 +6,20 @@ import ( "errors" "fmt" "strings" + + "github.com/opensvc/oc3/schema" ) +// TNodeNetworks is the v_nodenetworks view: the addresses of the nodes, joined to +// the declared network each one belongs to. +var TNodeNetworks = &schema.Table{Name: "v_nodenetworks"} + +// NodeNetworksCol returns a column of the v_nodenetworks view, for the list +// props that sort and filter on it. +func NodeNetworksCol(name string) *schema.Col { + return &schema.Col{T: TNodeNetworks, Name: name, Nullable: true} +} + type NodeIP struct { ID int64 Addr string @@ -76,6 +88,10 @@ func buildIpsQuery(p ListParams, idCond string, idArgs []any) (string, []any, er } } + filterConds, filterArgs := p.FilterConditions() + conds = append(conds, filterConds...) + args = append(args, filterArgs...) + if len(conds) > 0 { sb.WriteString("\nWHERE " + strings.Join(conds, " AND ")) } diff --git a/cdb/db_network_segments.go b/cdb/db_network_segments.go new file mode 100644 index 00000000..c1b24cd1 --- /dev/null +++ b/cdb/db_network_segments.go @@ -0,0 +1,103 @@ +package cdb + +import ( + "context" + "database/sql" + "errors" + "fmt" +) + +// GetNetworks lists the declared networks, by name then address. Every +// authenticated user may read them, as in the historical collector. +func (oDb *DB) GetNetworks(ctx context.Context, p ListParams) ([]map[string]any, error) { + return oDb.listQuery(ctx, "getNetworks", "networks", nil, nil, "networks.name, networks.network", p) +} + +// NetworkRange is what a segment needs to know of its parent network: its +// usable range and the team responsible for it. +type NetworkRange struct { + Network string + Netmask int + Begin string + End string + TeamResponsible string +} + +// GetNetworkRange returns the range and responsible team of a declared network. +func (oDb *DB) GetNetworkRange(ctx context.Context, id int) (NetworkRange, bool, error) { + var ( + r NetworkRange + netmask sql.NullInt64 + ) + err := oDb.DB.QueryRowContext(ctx, + `SELECT COALESCE(network, ''), netmask, COALESCE(begin, ''), COALESCE(end, ''), + COALESCE(team_responsible, '') FROM networks WHERE id = ?`, id). + Scan(&r.Network, &netmask, &r.Begin, &r.End, &r.TeamResponsible) + if errors.Is(err, sql.ErrNoRows) { + return r, false, nil + } + if err != nil { + return r, false, fmt.Errorf("GetNetworkRange: %w", err) + } + r.Netmask = int(netmask.Int64) + return r, true, nil +} + +// NetworkSegmentOverlapping returns the id of a segment of the network whose +// range shares at least one address with begin–end, if any. +func (oDb *DB) NetworkSegmentOverlapping(ctx context.Context, netID int, begin, end string) (int, bool, error) { + var id int + err := oDb.DB.QueryRowContext(ctx, + `SELECT id FROM network_segments WHERE net_id = ? + AND INET_ATON(seg_begin) <= INET_ATON(?) AND INET_ATON(seg_end) >= INET_ATON(?) LIMIT 1`, + netID, end, begin).Scan(&id) + if errors.Is(err, sql.ErrNoRows) { + return 0, false, nil + } + if err != nil { + return 0, false, fmt.Errorf("NetworkSegmentOverlapping: %w", err) + } + return id, true, nil +} + +// InsertNetworkSegment creates a segment of a network and, when groupID is set, +// makes that group responsible for it. It returns the segment id. +func (oDb *DB) InsertNetworkSegment(ctx context.Context, netID int, segType, begin, end string, groupID *int64) (int, error) { + res, err := oDb.ExecContext(ctx, + "INSERT INTO network_segments (net_id, seg_type, seg_begin, seg_end) VALUES (?, ?, ?, ?)", + netID, segType, begin, end) + if err != nil { + return 0, fmt.Errorf("InsertNetworkSegment: %w", err) + } + id, err := res.LastInsertId() + if err != nil { + return 0, fmt.Errorf("InsertNetworkSegment: %w", err) + } + oDb.SetChange("network_segments") + if groupID != nil { + if _, err := oDb.ExecContext(ctx, + "INSERT INTO network_segment_responsibles (seg_id, group_id) VALUES (?, ?)", id, *groupID); err != nil { + return int(id), fmt.Errorf("InsertNetworkSegment: responsible: %w", err) + } + oDb.SetChange("network_segment_responsibles") + } + return int(id), nil +} + +// GetNetworkSegmentRow returns a network segment. +func (oDb *DB) GetNetworkSegmentRow(ctx context.Context, id int) (map[string]any, error) { + var ( + rowID, netID int + segType, begin, end string + ) + err := oDb.DB.QueryRowContext(ctx, + `SELECT id, COALESCE(net_id, 0), COALESCE(seg_type, ''), COALESCE(seg_begin, ''), COALESCE(seg_end, '') + FROM network_segments WHERE id = ?`, id).Scan(&rowID, &netID, &segType, &begin, &end) + if errors.Is(err, sql.ErrNoRows) { + return nil, nil + } + if err != nil { + return nil, fmt.Errorf("GetNetworkSegmentRow: %w", err) + } + return map[string]any{"id": rowID, "net_id": netID, "seg_type": segType, "seg_begin": begin, "seg_end": end}, nil +} diff --git a/cdb/db_networks_create.go b/cdb/db_networks_create.go new file mode 100644 index 00000000..dcc8f26c --- /dev/null +++ b/cdb/db_networks_create.go @@ -0,0 +1,129 @@ +package cdb + +import ( + "context" + "database/sql" + "errors" + "fmt" +) + +// NetworkInsert holds the columns set when declaring a network. begin, end and +// broadcast are generated by the database from network and netmask. +type NetworkInsert struct { + Name *string + Network string + Netmask int + Gateway *string + Comment *string + Pvid *int + Prio int + TeamResponsible *string +} + +// NetworkIDByName returns the id of the network with this name, if any. +func (oDb *DB) NetworkIDByName(ctx context.Context, name string) (int, bool, error) { + var id int + err := oDb.DB.QueryRowContext(ctx, "SELECT id FROM networks WHERE name = ? LIMIT 1", name).Scan(&id) + if errors.Is(err, sql.ErrNoRows) { + return 0, false, nil + } + if err != nil { + return 0, false, fmt.Errorf("NetworkIDByName: %w", err) + } + return id, true, nil +} + +// NetworkIDByAddress returns the id of the network declared with this address and +// netmask, if any. +func (oDb *DB) NetworkIDByAddress(ctx context.Context, network string, netmask int) (int, bool, error) { + var id int + err := oDb.DB.QueryRowContext(ctx, + "SELECT id FROM networks WHERE network = ? AND netmask = ? LIMIT 1", network, netmask).Scan(&id) + if errors.Is(err, sql.ErrNoRows) { + return 0, false, nil + } + if err != nil { + return 0, false, fmt.Errorf("NetworkIDByAddress: %w", err) + } + return id, true, nil +} + +// IsAssignableTeam reports whether role names an organisational group: neither a +// privilege group nor a user's private group, as required for team_responsible in +// the historical collector. +func (oDb *DB) IsAssignableTeam(ctx context.Context, role string) (bool, error) { + var n int + err := oDb.DB.QueryRowContext(ctx, + "SELECT COUNT(*) FROM auth_group WHERE role = ? AND privilege = 'F' AND role NOT LIKE 'user\\_%'", + role).Scan(&n) + if err != nil { + return false, fmt.Errorf("IsAssignableTeam: %w", err) + } + return n > 0, nil +} + +// UserPrimaryGroupRole returns the role of the user's primary group, if any. +func (oDb *DB) UserPrimaryGroupRole(ctx context.Context, userID int64) (string, bool, error) { + const query = "SELECT auth_group.role FROM auth_group " + + "JOIN auth_membership ON auth_membership.group_id = auth_group.id " + + "WHERE auth_membership.user_id = ? AND auth_membership.primary_group = 'T' LIMIT 1" + var role sql.NullString + err := oDb.DB.QueryRowContext(ctx, query, userID).Scan(&role) + return checkRow(err, role.Valid, role.String) +} + +// InsertNetwork declares a network and returns its record id. +func (oDb *DB) InsertNetwork(ctx context.Context, n NetworkInsert) (int, error) { + res, err := oDb.ExecContext(ctx, + `INSERT INTO networks (name, network, netmask, gateway, comment, pvid, prio, team_responsible) + VALUES (?, ?, ?, ?, ?, ?, ?, ?)`, + n.Name, n.Network, n.Netmask, n.Gateway, n.Comment, n.Pvid, n.Prio, n.TeamResponsible) + if err != nil { + return 0, fmt.Errorf("InsertNetwork: %w", err) + } + id, err := res.LastInsertId() + if err != nil { + return 0, fmt.Errorf("InsertNetwork: %w", err) + } + oDb.SetChange("networks") + return int(id), nil +} + +// GetNetworkRow returns a declared network, generated columns included. +func (oDb *DB) GetNetworkRow(ctx context.Context, id int) (map[string]any, error) { + const query = `SELECT id, COALESCE(name, ''), COALESCE(network, ''), netmask, + COALESCE(broadcast, ''), COALESCE(gateway, ''), COALESCE(begin, ''), COALESCE(end, ''), + pvid, prio, COALESCE(team_responsible, ''), COALESCE(comment, ''), updated + FROM networks WHERE id = ?` + var ( + rowID int + name, network, broadcast, gateway, begin, end string + team, comment string + netmask, pvid sql.NullInt64 + prio int + updated sql.NullTime + ) + err := oDb.DB.QueryRowContext(ctx, query, id).Scan(&rowID, &name, &network, &netmask, + &broadcast, &gateway, &begin, &end, &pvid, &prio, &team, &comment, &updated) + if errors.Is(err, sql.ErrNoRows) { + return nil, nil + } + if err != nil { + return nil, fmt.Errorf("GetNetworkRow: %w", err) + } + row := map[string]any{ + "id": rowID, "name": name, "network": network, "broadcast": broadcast, + "gateway": gateway, "begin": begin, "end": end, "prio": prio, + "team_responsible": team, "comment": comment, + } + if netmask.Valid { + row["netmask"] = netmask.Int64 + } + if pvid.Valid { + row["pvid"] = pvid.Int64 + } + if updated.Valid { + row["updated"] = updated.Time.Format("2006-01-02 15:04:05") + } + return row, nil +} diff --git a/cdb/db_node_hardware.go b/cdb/db_node_hardware.go index fe50fb90..32e730f6 100644 --- a/cdb/db_node_hardware.go +++ b/cdb/db_node_hardware.go @@ -7,8 +7,11 @@ import ( "github.com/opensvc/oc3/schema" ) -func buildNodeHardwareQuery(groups []string, isManager bool, selectExprs []string) (string, []any, error) { +func buildNodeHardwareQuery(groups []string, isManager bool, selectExprs []string, filters []ColumnFilter) (string, []any, error) { + // nodes is a left join, for the nodes. props: a component of an unknown node + // is kept, as before the join. q := From(schema.TNodeHW). + LeftJoin(schema.TNodes). RawSelect(selectExprs...) if !isManager { @@ -35,6 +38,9 @@ func buildNodeHardwareQuery(groups []string, isManager bool, selectExprs []strin q = q.Where(schema.NodeHWID, ">", 0) } + // Column filters of the request, ANDed with the access control above. + q = q.WhereFilters(filters) + query, args, err := q.Build() if err != nil { return "", nil, fmt.Errorf("buildNodeHardwareQuery: %w", err) @@ -43,7 +49,7 @@ func buildNodeHardwareQuery(groups []string, isManager bool, selectExprs []strin } func (oDb *DB) queryHardware(ctx context.Context, nodeID string, defaultOrderBy string, p ListParams) ([]map[string]any, error) { - query, args, err := buildNodeHardwareQuery(p.Groups, p.IsManager, p.SelectExprs) + query, args, err := buildNodeHardwareQuery(p.Groups, p.IsManager, p.SelectExprs, p.Filters) if err != nil { return nil, err } diff --git a/cdb/db_nodes.go b/cdb/db_nodes.go index 5b80d435..8598e9e3 100644 --- a/cdb/db_nodes.go +++ b/cdb/db_nodes.go @@ -50,8 +50,11 @@ func (n *DBNode) String() string { return fmt.Sprintf("node: {nodename: %s, node_id: %s, cluster_id: %s, app: %s}", n.Nodename, n.NodeID, n.ClusterID, n.App) } -func buildNodesQuery(groups []string, isManager bool, selectExprs []string) (string, []any, error) { +func buildNodesQuery(groups []string, isManager bool, selectExprs []string, filters []ColumnFilter) (string, []any, error) { q := From(schema.TNodes). + // A node may name no cluster, or one the collector does not know: a plain join + // would then drop the row. + LeftJoin(schema.TClusters). RawSelect(selectExprs...) if !isManager { @@ -77,6 +80,9 @@ func buildNodesQuery(groups []string, isManager bool, selectExprs []string) (str q = q.Where(schema.NodesID, ">", 0) } + // Column filters of the request, ANDed with the access control above. + q = q.WhereFilters(filters) + query, args, err := q.Build() if err != nil { return "", nil, fmt.Errorf("buildNodesQuery: %w", err) @@ -85,7 +91,7 @@ func buildNodesQuery(groups []string, isManager bool, selectExprs []string) (str } func (oDb *DB) GetNodes(ctx context.Context, p ListParams) ([]map[string]any, error) { - query, args, err := buildNodesQuery(p.Groups, p.IsManager, p.SelectExprs) + query, args, err := buildNodesQuery(p.Groups, p.IsManager, p.SelectExprs, p.Filters) if err != nil { return nil, err } @@ -106,7 +112,7 @@ func (oDb *DB) GetNodes(ctx context.Context, p ListParams) ([]map[string]any, er // GetNodesByIDs fetches nodes whose node_id is in the given list. func (oDb *DB) GetNodesByIDs(ctx context.Context, ids []string, p ListParams) ([]map[string]any, error) { - query, args, err := buildNodesQuery(p.Groups, p.IsManager, p.SelectExprs) + query, args, err := buildNodesQuery(p.Groups, p.IsManager, p.SelectExprs, p.Filters) if err != nil { return nil, err } @@ -135,7 +141,7 @@ func (oDb *DB) GetNodesByIDs(ctx context.Context, ids []string, p ListParams) ([ // GetNode fetches a single node by node_id or nodename. func (oDb *DB) GetNode(ctx context.Context, nodeID string, p ListParams) ([]map[string]any, error) { - query, args, err := buildNodesQuery(p.Groups, p.IsManager, p.SelectExprs) + query, args, err := buildNodesQuery(p.Groups, p.IsManager, p.SelectExprs, p.Filters) if err != nil { return nil, err } @@ -754,12 +760,27 @@ func (oDb *DB) UpdateNodeFields(ctx context.Context, nodeID string, fields map[s "serial": true, "sp_version": true, "team_integ": true, "team_support": true, "updated": true, } + // Datetime columns reject the empty string, and one bad value fails the whole + // UPDATE: clearing a date would silently discard every other field of the same + // request. An empty value clears the column instead. + datetime := map[string]bool{ + "warranty_end": true, "maintenance_end": true, "snooze_till": true, + "node_frozen_at": true, "last_boot": true, "last_comm": true, + "hw_obs_warn_date": true, "hw_obs_alert_date": true, + "os_obs_warn_date": true, "os_obs_alert_date": true, + } setClauses := []string{"updated = NOW()"} args := []any{} for col, val := range fields { if !allowed[col] { continue } + if datetime[col] { + if s, ok := val.(string); ok && s == "" { + setClauses = append(setClauses, col+" = NULL") + continue + } + } setClauses = append(setClauses, col+" = ?") args = append(args, val) } diff --git a/cdb/db_obsolescence.go b/cdb/db_obsolescence.go index 17807b09..4d52eb2b 100644 --- a/cdb/db_obsolescence.go +++ b/cdb/db_obsolescence.go @@ -395,11 +395,11 @@ func (oDb *DB) UpdateObsolescenceSetting(ctx context.Context, id int, fields Upd args := []any{} if fields.ObsWarnDate != nil { setClauses = append(setClauses, "obs_warn_date = ?", "obs_warn_date_updated_by = ?", "obs_warn_date_updated = NOW()") - args = append(args, *fields.ObsWarnDate, author) + args = append(args, nullIfEmpty(*fields.ObsWarnDate), author) } if fields.ObsAlertDate != nil { setClauses = append(setClauses, "obs_alert_date = ?", "obs_alert_date_updated_by = ?", "obs_alert_date_updated = NOW()") - args = append(args, *fields.ObsAlertDate, author) + args = append(args, nullIfEmpty(*fields.ObsAlertDate), author) } if len(setClauses) == 0 { return nil @@ -421,20 +421,24 @@ func (oDb *DB) DeleteObsolescenceSetting(ctx context.Context, id int) error { return nil } -func (oDb *DB) UpdateNodeObsolescenceDates(ctx context.Context, obsType, obsName string, warnDate, alertDate sql.NullString) error { +// SyncNodeObsolescenceDates copies the stored dates of an obsolescence setting to +// the nodes it applies to. Copying inside the database keeps datetime values +// intact: passing back a date read through the driver would send it in RFC 3339 +// form, which a datetime column rejects in strict mode. +func (oDb *DB) SyncNodeObsolescenceDates(ctx context.Context, id int, obsType string) error { + var query string switch obsType { case "hw": - if _, err := oDb.ExecContext(ctx, - "UPDATE nodes SET hw_obs_warn_date = ?, hw_obs_alert_date = ? WHERE model = ?", - warnDate, alertDate, obsName); err != nil { - return fmt.Errorf("UpdateNodeObsolescenceDates: %w", err) - } + query = `UPDATE nodes JOIN obsolescence o ON o.id = ? AND nodes.model = o.obs_name + SET nodes.hw_obs_warn_date = o.obs_warn_date, nodes.hw_obs_alert_date = o.obs_alert_date` case "os": - if _, err := oDb.ExecContext(ctx, - "UPDATE nodes SET os_obs_warn_date = ?, os_obs_alert_date = ? WHERE os_concat = ?", - warnDate, alertDate, obsName); err != nil { - return fmt.Errorf("UpdateNodeObsolescenceDates: %w", err) - } + query = `UPDATE nodes JOIN obsolescence o ON o.id = ? AND nodes.os_concat = o.obs_name + SET nodes.os_obs_warn_date = o.obs_warn_date, nodes.os_obs_alert_date = o.obs_alert_date` + default: + return nil + } + if _, err := oDb.ExecContext(ctx, query, id); err != nil { + return fmt.Errorf("SyncNodeObsolescenceDates: %w", err) } return nil } @@ -654,3 +658,11 @@ func (oDb *DB) UpdateNodesObsolescence(ctx context.Context) error { } return nil } + +// nullIfEmpty maps an empty date to NULL: a datetime column rejects ”. +func nullIfEmpty(value string) any { + if value == "" { + return nil + } + return value +} diff --git a/cdb/db_packages.go b/cdb/db_packages.go index b37210df..c67fb2f5 100644 --- a/cdb/db_packages.go +++ b/cdb/db_packages.go @@ -2,7 +2,11 @@ package cdb import ( "context" + "fmt" + "strings" "time" + + "github.com/opensvc/oc3/schema" ) func (oDb *DB) PurgePackagesOutdated(ctx context.Context, maxAge time.Duration) error { @@ -30,3 +34,216 @@ func (oDb *DB) PurgePatchesOutdated(ctx context.Context, maxAge time.Duration) e } return nil } + +// buildPackagesQuery lists the packages installed on the nodes the user may see, +// as the historical packages table does: joined with nodes, whose app scopes the +// access, and with pkg_sig_provider, which names the signing key's provider. +func buildPackagesQuery(groups []string, isManager bool, selectExprs []string, filters []ColumnFilter) (string, []any, error) { + // nodes is an inner join: a package of an unknown node is not listed, and the + // access check filters on nodes.app. pkg_sig_provider is a left join: most + // signatures have no known provider. + q := From(schema.TPackages). + Via(schema.TNodes). + LeftJoin(schema.TPkgSigProvider). + RawSelect(selectExprs...) + + if !isManager { + cleanGroups := cleanGroups(groups) + if len(cleanGroups) == 0 { + q = q.WhereRaw("1=0") + } else { + args := make([]any, len(cleanGroups)) + for i, g := range cleanGroups { + args[i] = g + } + q = q.WhereRaw( + "nodes.app IN ("+ + "SELECT a.app FROM apps a"+ + " JOIN apps_responsibles ar ON ar.app_id = a.id"+ + " JOIN auth_group ag ON ag.id = ar.group_id"+ + " WHERE ag.role IN ("+Placeholders(len(cleanGroups))+")"+ + ")", + args..., + ) + } + } else { + q = q.Where(schema.PackagesID, ">", 0) + } + + // Column filters of the request, ANDed with the access control above. + q = q.WhereFilters(filters) + + query, args, err := q.Build() + if err != nil { + return "", nil, fmt.Errorf("buildPackagesQuery: %w", err) + } + return query, args, nil +} + +// GetPackages lists packages, ordered by node, name and architecture by default, +// as the historical packages table. +func (oDb *DB) GetPackages(ctx context.Context, p ListParams) ([]map[string]any, error) { + query, args, err := buildPackagesQuery(p.Groups, p.IsManager, p.SelectExprs, p.Filters) + if err != nil { + return nil, err + } + if gb := p.GroupByClause(""); gb != "" { + query += " " + gb + } + query += " " + p.OrderByClause("nodes.nodename, packages.pkg_name, packages.pkg_arch") + query, args = appendLimitOffset(query, args, p.Limit, p.Offset) + + rows, err := oDb.DB.QueryContext(ctx, query, args...) + if err != nil { + return nil, fmt.Errorf("getPackages: %w", err) + } + defer func() { _ = rows.Close() }() + + return scanRowsToMaps(rows, p.Props, p.TypeHints) +} + +// PackageDiffNode is a node compared by a packages diff. +type PackageDiffNode struct { + NodeID string `json:"node_id"` + Nodename string `json:"nodename"` +} + +// PackageDiffRow is a package version installed on some of the compared nodes +// but not on all of them. +type PackageDiffRow struct { + NodeID string `json:"node_id"` + PkgName string `json:"pkg_name"` + PkgVersion string `json:"pkg_version"` + PkgArch string `json:"pkg_arch"` + PkgType string `json:"pkg_type"` +} + +// appsOfGroups is the condition restricting an app column to the apps one of the +// groups is responsible for, and its arguments; "1=0" without groups. +func appsOfGroups(appCol string, groups []string) (string, []any) { + cleanGroups := cleanGroups(groups) + if len(cleanGroups) == 0 { + return "1=0", nil + } + args := make([]any, len(cleanGroups)) + for i, g := range cleanGroups { + args[i] = g + } + return appCol + " IN (" + + "SELECT a.app FROM apps a" + + " JOIN apps_responsibles ar ON ar.app_id = a.id" + + " JOIN auth_group ag ON ag.id = ar.group_id" + + " WHERE ag.role IN (" + Placeholders(len(cleanGroups)) + ")" + + ")", args +} + +// PackagesDiffNodes resolves the nodes a packages diff compares, as the +// historical lib_packages_diff: the given nodes, plus the nodes running the +// given services, or with encap the encapsulated nodes of those services (the +// nodes named after their instances' mon_vmname). Unless the user is a manager, +// only the nodes and services of the apps their groups are responsible for count. +// The nodes are returned by name. +func (oDb *DB) PackagesDiffNodes(ctx context.Context, nodeIDs, svcIDs []string, encap bool, groups []string, isManager bool) ([]PackageDiffNode, error) { + var parts []string + var args []any + + if len(nodeIDs) > 0 { + part := "SELECT nodes.node_id FROM nodes WHERE nodes.node_id IN (" + Placeholders(len(nodeIDs)) + ")" + for _, id := range nodeIDs { + args = append(args, id) + } + if !isManager { + cond, condArgs := appsOfGroups("nodes.app", groups) + part += " AND " + cond + args = append(args, condArgs...) + } + parts = append(parts, part) + } + + if len(svcIDs) > 0 { + var part string + if encap { + part = "SELECT nodes.node_id FROM svcmon" + + " JOIN services ON services.svc_id = svcmon.svc_id" + + " JOIN nodes ON nodes.nodename = svcmon.mon_vmname" + + " WHERE svcmon.mon_vmname IS NOT NULL AND svcmon.mon_vmname != ''" + + " AND svcmon.svc_id IN (" + Placeholders(len(svcIDs)) + ")" + } else { + part = "SELECT svcmon.node_id FROM svcmon" + + " JOIN services ON services.svc_id = svcmon.svc_id" + + " WHERE svcmon.svc_id IN (" + Placeholders(len(svcIDs)) + ")" + } + for _, id := range svcIDs { + args = append(args, id) + } + if !isManager { + cond, condArgs := appsOfGroups("services.svc_app", groups) + part += " AND " + cond + args = append(args, condArgs...) + } + parts = append(parts, part) + } + + if len(parts) == 0 { + return []PackageDiffNode{}, nil + } + query := "SELECT nodes.node_id, COALESCE(nodes.nodename, '') FROM nodes" + + " WHERE nodes.node_id IN (" + strings.Join(parts, " UNION ") + ")" + + " ORDER BY nodes.nodename, nodes.node_id" + rows, err := oDb.DB.QueryContext(ctx, query, args...) + if err != nil { + return nil, fmt.Errorf("packagesDiffNodes: %w", err) + } + defer func() { _ = rows.Close() }() + nodes := []PackageDiffNode{} + for rows.Next() { + var n PackageDiffNode + if err := rows.Scan(&n.NodeID, &n.Nodename); err != nil { + return nil, fmt.Errorf("packagesDiffNodes: %w", err) + } + nodes = append(nodes, n) + } + return nodes, rows.Err() +} + +// PackagesDiff lists, on the given nodes, the package versions that are not +// installed on all of them: a package (name, version, architecture, type) +// present on every node is left out, as in the historical lib_packages_diff. +func (oDb *DB) PackagesDiff(ctx context.Context, nodeIDs []string) ([]PackageDiffRow, error) { + if len(nodeIDs) < 2 { + return []PackageDiffRow{}, nil + } + in := Placeholders(len(nodeIDs)) + query := "SELECT p.node_id, p.pkg_name, p.pkg_version, p.pkg_arch, COALESCE(p.pkg_type, '')" + + " FROM packages p JOIN (" + + " SELECT pkg_name, pkg_version, pkg_arch, pkg_type FROM packages" + + " WHERE node_id IN (" + in + ")" + + " GROUP BY pkg_name, pkg_version, pkg_arch, pkg_type" + + " HAVING COUNT(DISTINCT node_id) != ?" + + " ) u ON p.pkg_name = u.pkg_name AND p.pkg_version = u.pkg_version" + + " AND p.pkg_arch = u.pkg_arch AND p.pkg_type <=> u.pkg_type" + + " WHERE p.node_id IN (" + in + ")" + + " ORDER BY p.pkg_name, p.pkg_arch, p.pkg_type, p.pkg_version, p.node_id" + args := make([]any, 0, 2*len(nodeIDs)+1) + for _, id := range nodeIDs { + args = append(args, id) + } + args = append(args, len(nodeIDs)) + for _, id := range nodeIDs { + args = append(args, id) + } + rows, err := oDb.DB.QueryContext(ctx, query, args...) + if err != nil { + return nil, fmt.Errorf("packagesDiff: %w", err) + } + defer func() { _ = rows.Close() }() + out := []PackageDiffRow{} + for rows.Next() { + var r PackageDiffRow + if err := rows.Scan(&r.NodeID, &r.PkgName, &r.PkgVersion, &r.PkgArch, &r.PkgType); err != nil { + return nil, fmt.Errorf("packagesDiff: %w", err) + } + out = append(out, r) + } + return out, rows.Err() +} diff --git a/cdb/db_search.go b/cdb/db_search.go new file mode 100644 index 00000000..1006b777 --- /dev/null +++ b/cdb/db_search.go @@ -0,0 +1,27 @@ +package cdb + +import ( + "context" + "fmt" +) + +// SearchTags returns the tags whose name contains the LIKE pattern, by name, up +// to limit rows. Tags are readable by every user, as in the historical search. +func (oDb *DB) SearchTags(ctx context.Context, pattern string, limit int) ([]map[string]any, error) { + rows, err := oDb.DB.QueryContext(ctx, + `SELECT COALESCE(tag_id, ''), COALESCE(tag_name, ''), COALESCE(tag_exclude, '') + FROM tags WHERE tag_name LIKE ? ORDER BY tag_name, id LIMIT ?`, pattern, limit) + if err != nil { + return nil, fmt.Errorf("searchTags: %w", err) + } + defer func() { _ = rows.Close() }() + var out []map[string]any + for rows.Next() { + var tagID, name, exclude string + if err := rows.Scan(&tagID, &name, &exclude); err != nil { + return nil, fmt.Errorf("searchTags scan: %w", err) + } + out = append(out, map[string]any{"tag_id": tagID, "tag_name": name, "tag_exclude": exclude}) + } + return out, rows.Err() +} diff --git a/cdb/db_services.go b/cdb/db_services.go index fb504cc2..7aba4a69 100644 --- a/cdb/db_services.go +++ b/cdb/db_services.go @@ -11,7 +11,7 @@ import ( "github.com/opensvc/oc3/schema" ) -func buildServicesQuery(groups []string, isManager bool, selectExprs []string) (string, []any, error) { +func buildServicesQuery(groups []string, isManager bool, selectExprs []string, filters []ColumnFilter) (string, []any, error) { q := From(schema.TServices). RawSelect(selectExprs...) @@ -38,6 +38,9 @@ func buildServicesQuery(groups []string, isManager bool, selectExprs []string) ( q = q.Where(schema.ServicesID, ">", 0) } + // Column filters of the request, ANDed with the access control above. + q = q.WhereFilters(filters) + query, args, err := q.Build() if err != nil { return "", nil, fmt.Errorf("buildServicesQuery: %w", err) @@ -46,7 +49,7 @@ func buildServicesQuery(groups []string, isManager bool, selectExprs []string) ( } func (oDb *DB) GetServices(ctx context.Context, p ListParams) ([]map[string]any, error) { - query, args, err := buildServicesQuery(p.Groups, p.IsManager, p.SelectExprs) + query, args, err := buildServicesQuery(p.Groups, p.IsManager, p.SelectExprs, p.Filters) if err != nil { return nil, err } @@ -67,7 +70,7 @@ func (oDb *DB) GetServices(ctx context.Context, p ListParams) ([]map[string]any, // GetServicesByIDs fetches services whose svc_id is in the given list. func (oDb *DB) GetServicesByIDs(ctx context.Context, ids []string, p ListParams) ([]map[string]any, error) { - query, args, err := buildServicesQuery(p.Groups, p.IsManager, p.SelectExprs) + query, args, err := buildServicesQuery(p.Groups, p.IsManager, p.SelectExprs, p.Filters) if err != nil { return nil, err } @@ -96,7 +99,7 @@ func (oDb *DB) GetServicesByIDs(ctx context.Context, ids []string, p ListParams) // GetService fetches a single service by svc_id (UUID) or svcname. func (oDb *DB) GetService(ctx context.Context, svcID string, p ListParams) ([]map[string]any, error) { - query, args, err := buildServicesQuery(p.Groups, p.IsManager, p.SelectExprs) + query, args, err := buildServicesQuery(p.Groups, p.IsManager, p.SelectExprs, p.Filters) if err != nil { return nil, err } diff --git a/cdb/db_services_instances.go b/cdb/db_services_instances.go index 3decd988..3ebe466d 100644 --- a/cdb/db_services_instances.go +++ b/cdb/db_services_instances.go @@ -9,9 +9,13 @@ import ( "github.com/opensvc/oc3/schema" ) -func buildServicesInstancesQuery(groups []string, isManager bool, selectExprs []string) (string, []any, error) { +func buildServicesInstancesQuery(groups []string, isManager bool, selectExprs []string, filters []ColumnFilter) (string, []any, error) { + // services is an inner join: the access check filters on services.svc_app. + // nodes is a left join so that "nodes.*" props can be selected without dropping + // an instance whose node row is missing. q := From(schema.TSvcmon). Via(schema.TServices). + LeftJoin(schema.TNodes). RawSelect(selectExprs...) if !isManager { @@ -37,6 +41,9 @@ func buildServicesInstancesQuery(groups []string, isManager bool, selectExprs [] q = q.Where(schema.SvcmonID, ">", 0) } + // Column filters of the request, ANDed with the access control above. + q = q.WhereFilters(filters) + query, args, err := q.Build() if err != nil { return "", nil, fmt.Errorf("buildServicesInstancesQuery: %w", err) @@ -45,7 +52,7 @@ func buildServicesInstancesQuery(groups []string, isManager bool, selectExprs [] } func (oDb *DB) GetServicesInstances(ctx context.Context, p ListParams) ([]map[string]any, error) { - query, args, err := buildServicesInstancesQuery(p.Groups, p.IsManager, p.SelectExprs) + query, args, err := buildServicesInstancesQuery(p.Groups, p.IsManager, p.SelectExprs, p.Filters) if err != nil { return nil, err } @@ -66,7 +73,7 @@ func (oDb *DB) GetServicesInstances(ctx context.Context, p ListParams) ([]map[st // GetServiceNodeInstance fetches the service instance on a specific node. func (oDb *DB) GetServiceNodeInstance(ctx context.Context, svcID, nodeID string, p ListParams) ([]map[string]any, error) { - query, args, err := buildServicesInstancesQuery(p.Groups, p.IsManager, p.SelectExprs) + query, args, err := buildServicesInstancesQuery(p.Groups, p.IsManager, p.SelectExprs, p.Filters) if err != nil { return nil, err } @@ -85,7 +92,7 @@ func (oDb *DB) GetServiceNodeInstance(ctx context.Context, svcID, nodeID string, // GetNodeServices fetches all service instances on a specific node. func (oDb *DB) GetNodeServices(ctx context.Context, nodeID string, p ListParams) ([]map[string]any, error) { - query, args, err := buildServicesInstancesQuery(p.Groups, p.IsManager, p.SelectExprs) + query, args, err := buildServicesInstancesQuery(p.Groups, p.IsManager, p.SelectExprs, p.Filters) if err != nil { return nil, err } @@ -132,7 +139,7 @@ func (oDb *DB) DeleteServiceInstanceCascade(ctx context.Context, svcID, nodeID s // GetServicesInstance fetches all instances of a single service by svc_id (UUID) or svcname. func (oDb *DB) GetServicesInstance(ctx context.Context, svcID string, p ListParams) ([]map[string]any, error) { - query, args, err := buildServicesInstancesQuery(p.Groups, p.IsManager, p.SelectExprs) + query, args, err := buildServicesInstancesQuery(p.Groups, p.IsManager, p.SelectExprs, p.Filters) if err != nil { return nil, err } diff --git a/cdb/db_tags.go b/cdb/db_tags.go index 880fb0ec..baa96c40 100644 --- a/cdb/db_tags.go +++ b/cdb/db_tags.go @@ -21,6 +21,15 @@ type Tag struct { } // GetTags returns all tags with id > 0, or a specific tag if tagID is provided +// CountTags returns the number of tags, for the total of the paginated tag list. +func (oDb *DB) CountTags(ctx context.Context) (int, error) { + var n int + if err := oDb.DB.QueryRowContext(ctx, "SELECT COUNT(*) FROM tags WHERE id > 0").Scan(&n); err != nil { + return 0, fmt.Errorf("countTags: %w", err) + } + return n, nil +} + func (oDb *DB) GetTags(ctx context.Context, tagID *int, limit, offset int) ([]Tag, error) { query := ` SELECT id, tag_name, tag_created, tag_exclude, tag_data, tag_id @@ -318,7 +327,7 @@ func (oDb *DB) DetachServiceTag(ctx context.Context, svcID, tagID string) (int64 // GetTagNodes returns nodes where a tag (by integer id) is attached, with app-based auth. func (oDb *DB) GetTagNodes(ctx context.Context, tagID int, p ListParams) ([]map[string]any, error) { - query, args, err := buildNodesQuery(p.Groups, p.IsManager, p.SelectExprs) + query, args, err := buildNodesQuery(p.Groups, p.IsManager, p.SelectExprs, p.Filters) if err != nil { return nil, err } @@ -486,7 +495,7 @@ func (oDb *DB) GetServiceCandidateTags(ctx context.Context, svcID string, p List // GetTagServices returns services where a tag (by integer id) is attached, with app-based auth. func (oDb *DB) GetTagServices(ctx context.Context, tagID int, p ListParams) ([]map[string]any, error) { - query, args, err := buildServicesQuery(p.Groups, p.IsManager, p.SelectExprs) + query, args, err := buildServicesQuery(p.Groups, p.IsManager, p.SelectExprs, p.Filters) if err != nil { return nil, err } diff --git a/cdb/db_users.go b/cdb/db_users.go index 05185376..ed636011 100644 --- a/cdb/db_users.go +++ b/cdb/db_users.go @@ -5,8 +5,207 @@ import ( "database/sql" "errors" "fmt" + "strconv" + "strings" ) +// usersAuthClause returns the WHERE fragment restricting a query on auth_user to +// the users the caller may see, mirroring allowed_user_ids_q() of the python +// collector (init/models/rest/lib_users.py:11). +// +// Manager and UserManager see every user. Anybody else sees the users sharing +// one of its organisational groups — the non-privilege groups it belongs to, +// excluding "UnaffectedProjects" (user_org_group_ids(), init/models/auth.py:380) +// — plus itself. The target membership ignores the "Everybody" group, which +// holds all users and would defeat the restriction. +func usersAuthClause(p ListParams) (string, []any) { + if p.IsManager || p.HasGroup("UserManager") { + return "auth_user.id > 0", nil + } + if p.UserID == nil { + // Not authenticated as a user: no organisational group, and no self. + return "1=0", nil + } + const clause = `(auth_user.id IN ( + SELECT peer.user_id + FROM auth_membership peer + JOIN auth_group peer_group ON peer_group.id = peer.group_id + WHERE peer_group.role != 'Everybody' + AND peer.group_id IN ( + SELECT own_group.id + FROM auth_group own_group + JOIN auth_membership own ON own.group_id = own_group.id + WHERE own.user_id = ? + AND own_group.privilege = 'F' + AND own_group.role != 'UnaffectedProjects' + ) + ) OR auth_user.id = ?)` + return clause, []any{*p.UserID, *p.UserID} +} + +// GetUsers lists the users visible to the caller. +func (oDb *DB) GetUsers(ctx context.Context, p ListParams) ([]map[string]any, error) { + if len(p.SelectExprs) == 0 { + return nil, fmt.Errorf("getUsers: no select expressions") + } + authClause, args := usersAuthClause(p) + conds := []string{authClause} + filterConds, filterArgs := p.FilterConditions() + conds = append(conds, filterConds...) + args = append(args, filterArgs...) + query := "SELECT " + strings.Join(p.SelectExprs, ", ") + + " FROM auth_user WHERE " + strings.Join(conds, " AND ") + if gb := p.GroupByClause(""); gb != "" { + query += " " + gb + } + query += " " + p.OrderByClause("auth_user.email, auth_user.id") + query, args = appendLimitOffset(query, args, p.Limit, p.Offset) + + rows, err := oDb.DB.QueryContext(ctx, query, args...) + if err != nil { + return nil, fmt.Errorf("getUsers: %w", err) + } + defer func() { _ = rows.Close() }() + + return scanRowsToMaps(rows, p.Props, p.TypeHints) +} + +// GetUser fetches a single user visible to the caller, identified the way +// user_id_q() does — see userIdentClause. +func (oDb *DB) GetUser(ctx context.Context, idOrEmail string, p ListParams) ([]map[string]any, error) { + if len(p.SelectExprs) == 0 { + return nil, fmt.Errorf("getUser: no select expressions") + } + + identClause, identArgs, ok := userIdentClause(idOrEmail, p.UserID) + if !ok { + return nil, nil + } + + authClause, args := usersAuthClause(p) + query := "SELECT " + strings.Join(p.SelectExprs, ", ") + + " FROM auth_user WHERE " + authClause + " AND " + identClause + args = append(args, identArgs...) + if gb := p.GroupByClause(""); gb != "" { + query += " " + gb + } + query += " " + p.OrderByClause("auth_user.email, auth_user.id") + query, args = appendLimitOffset(query, args, p.Limit, p.Offset) + + rows, err := oDb.DB.QueryContext(ctx, query, args...) + if err != nil { + return nil, fmt.Errorf("getUser: %w", err) + } + defer func() { _ = rows.Close() }() + + return scanRowsToMaps(rows, p.Props, p.TypeHints) +} + +// userIdentClause returns the WHERE fragment selecting the user designated by +// idOrEmail, mirroring user_id_q() (init/models/rest/lib_users.py:25): an email +// when the identifier contains "@", the caller itself for "self", an +// auth_user.id otherwise. +// +// ok is false when the identifier cannot designate anybody: "self" without a +// caller identity, or a value that is neither an email nor a number. The python +// code compares such a value to the numeric id column, which never matches. +func userIdentClause(idOrEmail string, callerID *int64) (clause string, args []any, ok bool) { + switch { + case strings.Contains(idOrEmail, "@"): + return "auth_user.email = ?", []any{idOrEmail}, true + case idOrEmail == "self": + if callerID == nil { + return "", nil, false + } + return "auth_user.id = ?", []any{*callerID}, true + default: + id, err := strconv.ParseInt(idOrEmail, 10, 64) + if err != nil { + return "", nil, false + } + return "auth_user.id = ?", []any{id}, true + } +} + +// UserIDForPrefs resolves idOrEmail to an auth_user.id the caller is allowed to +// see. found is false when no such user exists or it is not visible, which +// rest_post_user_prefs answers with a 403 (init/models/rest/api_users.py:141). +func (oDb *DB) UserIDForPrefs(ctx context.Context, idOrEmail string, p ListParams) (int64, bool, error) { + identClause, identArgs, ok := userIdentClause(idOrEmail, p.UserID) + if !ok { + return 0, false, nil + } + authClause, args := usersAuthClause(p) + query := "SELECT auth_user.id FROM auth_user WHERE " + authClause + " AND " + identClause + " LIMIT 1" + args = append(args, identArgs...) + + var id sql.NullInt64 + err := oDb.DB.QueryRowContext(ctx, query, args...).Scan(&id) + switch { + case errors.Is(err, sql.ErrNoRows): + return 0, false, nil + case err != nil: + return 0, false, fmt.Errorf("userIDForPrefs: %w", err) + } + return id.Int64, id.Valid, nil +} + +// UserPrefs returns the raw preferences document of the user designated by +// idOrEmail, as stored in user_prefs.prefs. +// +// found is false when the user is unknown, not visible to the caller, has no +// user_prefs row, or a NULL document — rest_get_user_prefs returns an empty +// object for all of these alike (init/models/rest/api_users.py:112). +func (oDb *DB) UserPrefs(ctx context.Context, idOrEmail string, p ListParams) (string, bool, error) { + identClause, identArgs, ok := userIdentClause(idOrEmail, p.UserID) + if !ok { + return "", false, nil + } + authClause, args := usersAuthClause(p) + query := "SELECT user_prefs.prefs FROM auth_user" + + " JOIN user_prefs ON user_prefs.user_id = auth_user.id" + + " WHERE " + authClause + " AND " + identClause + " LIMIT 1" + args = append(args, identArgs...) + + var prefs sql.NullString + err := oDb.DB.QueryRowContext(ctx, query, args...).Scan(&prefs) + switch { + case errors.Is(err, sql.ErrNoRows): + return "", false, nil + case err != nil: + return "", false, fmt.Errorf("userPrefs: %w", err) + } + return prefs.String, prefs.Valid, nil +} + +// SaveUserPrefs stores the preferences document of a user, updating the existing +// user_prefs row or inserting one. +// +// The select-then-write mirrors web2py's update_or_insert: user_prefs.user_id +// carries no unique index, so ON DUPLICATE KEY cannot be relied upon. Call it on +// a transaction-scoped *DB so the read and the write cannot interleave. +func (oDb *DB) SaveUserPrefs(ctx context.Context, userID int64, prefs string) error { + const selectQuery = "SELECT id FROM user_prefs WHERE user_id = ? LIMIT 1" + var rowID sql.NullInt64 + err := oDb.DB.QueryRowContext(ctx, selectQuery, userID).Scan(&rowID) + switch { + case errors.Is(err, sql.ErrNoRows): + const insertQuery = "INSERT INTO user_prefs (user_id, prefs) VALUES (?, ?)" + if _, err := oDb.DB.ExecContext(ctx, insertQuery, userID, prefs); err != nil { + return fmt.Errorf("saveUserPrefs insert: %w", err) + } + case err != nil: + return fmt.Errorf("saveUserPrefs select: %w", err) + default: + const updateQuery = "UPDATE user_prefs SET prefs = ? WHERE id = ?" + if _, err := oDb.DB.ExecContext(ctx, updateQuery, prefs, rowID.Int64); err != nil { + return fmt.Errorf("saveUserPrefs update: %w", err) + } + } + oDb.SetChange("user_prefs") + return nil +} + // return the default app for a user // if the user belongs to several apps, return the first one in alphabetical order func (oDb *DB) UserDefaultApp(ctx context.Context, userID *int64) (string, error) { @@ -137,3 +336,59 @@ func (oDb *DB) UserDefaultGroup(ctx context.Context, userID int64) (string, bool err = oDb.DB.QueryRowContext(ctx, query, gid).Scan(&role) return checkRow(err, role.Valid, role.String) } + +// UserPasswordHash returns the stored password hash of a user, empty when the +// account has no password; false when there is no such user. +func (oDb *DB) UserPasswordHash(ctx context.Context, userID int64) (string, bool, error) { + var hash sql.NullString + err := oDb.DB.QueryRowContext(ctx, "SELECT password FROM auth_user WHERE id = ?", userID).Scan(&hash) + switch { + case errors.Is(err, sql.ErrNoRows): + return "", false, nil + case err != nil: + return "", false, fmt.Errorf("userPasswordHash: %w", err) + } + return hash.String, true, nil +} + +// SetUserPassword stores a new password hash for a user. +func (oDb *DB) SetUserPassword(ctx context.Context, userID int64, hash string) error { + if _, err := oDb.DB.ExecContext(ctx, "UPDATE auth_user SET password = ? WHERE id = ?", hash, userID); err != nil { + return fmt.Errorf("setUserPassword: %w", err) + } + oDb.SetChange("auth_user") + return nil +} + +// UserIdentity is what a user may change about themselves: their name and email. +type UserIdentity struct { + FirstName string + LastName string + Email string +} + +// GetUserIdentity returns the name and email of a user; false when there is no +// such user. +func (oDb *DB) GetUserIdentity(ctx context.Context, userID int64) (UserIdentity, bool, error) { + var first, last, email sql.NullString + err := oDb.DB.QueryRowContext(ctx, + "SELECT first_name, last_name, email FROM auth_user WHERE id = ?", userID).Scan(&first, &last, &email) + switch { + case errors.Is(err, sql.ErrNoRows): + return UserIdentity{}, false, nil + case err != nil: + return UserIdentity{}, false, fmt.Errorf("getUserIdentity: %w", err) + } + return UserIdentity{FirstName: first.String, LastName: last.String, Email: email.String}, true, nil +} + +// SetUserIdentity stores the name and email of a user. +func (oDb *DB) SetUserIdentity(ctx context.Context, userID int64, u UserIdentity) error { + if _, err := oDb.DB.ExecContext(ctx, + "UPDATE auth_user SET first_name = ?, last_name = ?, email = ? WHERE id = ?", + u.FirstName, u.LastName, u.Email, userID); err != nil { + return fmt.Errorf("setUserIdentity: %w", err) + } + oDb.SetChange("auth_user") + return nil +} diff --git a/cdb/db_users_create.go b/cdb/db_users_create.go new file mode 100644 index 00000000..2d418891 --- /dev/null +++ b/cdb/db_users_create.go @@ -0,0 +1,77 @@ +package cdb + +import ( + "context" + "database/sql" + "errors" + "fmt" +) + +// UserInsert holds the columns set when creating a user. PasswordHash is already in +// the web2py format; empty, the account cannot sign in until a password is set. +type UserInsert struct { + Email string + Username *string + FirstName *string + LastName *string + PhoneWork *string + PasswordHash *string +} + +func (oDb *DB) userIDBy(ctx context.Context, column, value string) (int64, bool, error) { + var id int64 + err := oDb.DB.QueryRowContext(ctx, "SELECT id FROM auth_user WHERE "+column+" = ? LIMIT 1", value).Scan(&id) + if errors.Is(err, sql.ErrNoRows) { + return 0, false, nil + } + if err != nil { + return 0, false, fmt.Errorf("user by %s: %w", column, err) + } + return id, true, nil +} + +// UserIDByEmail returns the id of the user with this email, if any. +func (oDb *DB) UserIDByEmail(ctx context.Context, email string) (int64, bool, error) { + return oDb.userIDBy(ctx, "email", email) +} + +// UserIDByUsername returns the id of the user with this username, if any. +func (oDb *DB) UserIDByUsername(ctx context.Context, username string) (int64, bool, error) { + return oDb.userIDBy(ctx, "username", username) +} + +// InsertUserWithPrivateGroup creates a user, then its private group "user_" and +// the membership, as web2py does on registration (auth.settings.create_user_groups). +// Meant to run in a transaction. +func (oDb *DB) InsertUserWithPrivateGroup(ctx context.Context, u UserInsert) (int64, error) { + res, err := oDb.ExecContext(ctx, + `INSERT INTO auth_user (email, username, first_name, last_name, phone_work, password) + VALUES (?, ?, ?, ?, ?, ?)`, + u.Email, u.Username, u.FirstName, u.LastName, u.PhoneWork, u.PasswordHash) + if err != nil { + return 0, fmt.Errorf("InsertUserWithPrivateGroup user: %w", err) + } + userID, err := res.LastInsertId() + if err != nil { + return 0, fmt.Errorf("InsertUserWithPrivateGroup user id: %w", err) + } + res, err = oDb.ExecContext(ctx, + "INSERT INTO auth_group (role, description, privilege) VALUES (?, ?, 'F')", + fmt.Sprintf("user_%d", userID), fmt.Sprintf("group uniquely assigned to user %d", userID)) + if err != nil { + return 0, fmt.Errorf("InsertUserWithPrivateGroup group: %w", err) + } + groupID, err := res.LastInsertId() + if err != nil { + return 0, fmt.Errorf("InsertUserWithPrivateGroup group id: %w", err) + } + if _, err := oDb.ExecContext(ctx, + "INSERT INTO auth_membership (user_id, group_id, primary_group) VALUES (?, ?, 'F')", + userID, groupID); err != nil { + return 0, fmt.Errorf("InsertUserWithPrivateGroup membership: %w", err) + } + oDb.SetChange("auth_user") + oDb.SetChange("auth_group") + oDb.SetChange("auth_membership") + return userID, nil +} diff --git a/cdb/list_params.go b/cdb/list_params.go index 2ba64183..891bb45c 100644 --- a/cdb/list_params.go +++ b/cdb/list_params.go @@ -1,12 +1,32 @@ package cdb -import "strings" +import ( + "strings" + + "github.com/opensvc/oc3/schema" +) + +// ColumnFilter is one column filter of a list request, already resolved to SQL. +// Col names the filtered column, so that the query builder joins its table when +// the column is not selected; Expr is the condition with "?" placeholders. +type ColumnFilter struct { + Col *schema.Col + Expr string + Args []any +} // ListParams bundles the standard query parameters shared by all list endpoints. // Groups and IsManager encode the caller's access control context. type ListParams struct { - Groups []string - IsManager bool + Groups []string + IsManager bool + + // UserID is the authenticated user's auth_user.id, set only by the endpoints + // whose access control references the caller's identity rather than just its + // groups. Nil when the caller is not a user (node credentials) or when the + // endpoint does not need it. + UserID *int64 + Limit int Offset int Props []string @@ -14,9 +34,32 @@ type ListParams struct { TypeHints map[string]string // Used by scanRowsToMaps to convert []byte driver values to the correct type OrderBy []string GroupBy []string + + // Filters are the column filters of the request, combined with AND. + Filters []ColumnFilter + + // CountOnly asks for the query of a list without its sort: the rows are only + // counted, see OrderByClause. + CountOnly bool +} + +// HasGroup reports whether the caller belongs to the named group. Use it for the +// privileges that are not covered by IsManager, which only tracks "Manager". +func (p ListParams) HasGroup(role string) bool { + for _, g := range p.Groups { + if g == role { + return true + } + } + return false } func (p ListParams) OrderByClause(defaultClause string) string { + if p.CountOnly { + // A count does not depend on the order of the rows: sorting them first + // would only cost. + return "" + } if len(p.OrderBy) == 0 { return "ORDER BY " + defaultClause } @@ -32,3 +75,16 @@ func (p ListParams) GroupByClause(defaultClause string) string { } return "" } + +// FilterConditions returns the column filters as conditions to AND into a +// hand-built WHERE clause, and their arguments. Queries built with the query +// builder use Query.WhereFilters instead, which also resolves the joins. +func (p ListParams) FilterConditions() ([]string, []any) { + conds := make([]string, 0, len(p.Filters)) + var args []any + for _, f := range p.Filters { + conds = append(conds, f.Expr) + args = append(args, f.Args...) + } + return conds, args +} diff --git a/cdb/log.go b/cdb/log.go index cff02d67..d008c665 100644 --- a/cdb/log.go +++ b/cdb/log.go @@ -40,7 +40,7 @@ func (oDb *DB) GetLog(ctx context.Context, id string, p ListParams) ([]map[strin return nil, fmt.Errorf("getLog: no select expressions") } query := "SELECT " + strings.Join(p.SelectExprs, ", ") + - " FROM log WHERE log.id = ?" + " FROM log" + logJoins + " WHERE log.id = ?" args := []any{id} query, args = appendLimitOffset(query, args, p.Limit, p.Offset) rows, err := oDb.DB.QueryContext(ctx, query, args...) @@ -51,13 +51,19 @@ func (oDb *DB) GetLog(ctx context.Context, id string, p ListParams) ([]map[strin return scanRowsToMaps(rows, p.Props, p.TypeHints) } +// logJoins makes the "nodes." and "services." props selectable: a log event only +// carries the ids, and most events name no node nor service (empty ids), hence the +// LEFT JOINs. +const logJoins = " LEFT JOIN nodes ON nodes.node_id = log.node_id" + + " LEFT JOIN services ON services.svc_id = log.svc_id" + // GetLogs returns rows from the collector log table. func (oDb *DB) GetLogs(ctx context.Context, p ListParams, fset LogsFiltersetFilter) ([]map[string]any, error) { if len(p.SelectExprs) == 0 { return nil, fmt.Errorf("getLogs: no select expressions") } query := "SELECT " + strings.Join(p.SelectExprs, ", ") + - " FROM log WHERE log.id > 0" + " FROM log" + logJoins + " WHERE log.id > 0" args := []any{} if fset.Active { query, args = appendLogsFiltersetClause(query, args, fset.NodeIDs, fset.SvcIDs) diff --git a/cdb/qb.go b/cdb/qb.go index 25ac2644..157a2fd6 100644 --- a/cdb/qb.go +++ b/cdb/qb.go @@ -143,6 +143,15 @@ func (q *Query) WhereRaw(expr string, args ...any) *Query { return q } +// WhereFilters adds the column filters of a list request. Each carries its column, +// so a filter on a joined table not otherwise selected still gets its join. +func (q *Query) WhereFilters(filters []ColumnFilter) *Query { + for _, f := range filters { + q.wheres = append(q.wheres, condition{col: f.Col, expr: f.Expr, args: f.Args}) + } + return q +} + // WhereIn adds a "col IN (?,...)" condition. Produces "1=0" for an empty slice. func (q *Query) WhereIn(col *schema.Col, vals []string) *Query { if len(vals) == 0 { diff --git a/cdb/session.go b/cdb/session.go index 6cb230cb..3215be40 100644 --- a/cdb/session.go +++ b/cdb/session.go @@ -38,6 +38,12 @@ func (t *Session) NotifyChanges(ctx context.Context) error { } func (t *Session) NotifyTableChangeWithData(ctx context.Context, tableName string, data map[string]any) error { + // Same guard as NotifyChanges: the server component creates its session with a + // nil publisher, and dereferencing it here panicked the request after the write + // had already been committed. + if t.ev == nil { + return fmt.Errorf("NotifyTableChangeWithData: eventPublisher is not configured") + } if err := t.ev.EventPublish(tableName+"_change", data); err != nil { return fmt.Errorf("EventPublish send %s: %w", tableName, err) } diff --git a/cmd/conf.go b/cmd/conf.go index dbaa7e74..57e6a888 100644 --- a/cmd/conf.go +++ b/cmd/conf.go @@ -61,6 +61,12 @@ func setDefaultServerConfig() { viper.SetDefault(s+".ui.enable", false) viper.SetDefault(s+".sync.timeout", "2s") viper.SetDefault(s+".allow_anon_register", false) + // One git repository per form, holding its yaml history, as the historical + // collector keeps them under private/forms. + viper.SetDefault(s+".directories.forms", "/oc3/uploads/forms") + // The javascript sandbox running the manglers of the form rest outputs. + viper.SetDefault(s+".forms.nodejs", "/usr/bin/nodejs") + viper.SetDefault(s+".forms.vm2", "/usr/local/bin/vm2") viper.SetDefault(s+".log.request.level", "none") setDefaultAuthConfig() diff --git a/feeder/api.yaml b/feeder/api.yaml index 0411f2d7..754dca9e 100644 --- a/feeder/api.yaml +++ b/feeder/api.yaml @@ -367,6 +367,31 @@ paths: tags: - agent + /sanswitch: + post: + description: | + Update the configuration of a SAN switch, as the agent inventoried it: + the raw outputs of the switch commands, which the worker parses into + the switches, zones and aliases tables. A node inventories the + switches its configuration declares, on the schedule of each. + operationId: PostSANSwitch + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/SANSwitch' + responses: + 202: + description: the switch configuration will be refreshed + 400: + $ref: '#/components/responses/400' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + tags: + - agent + /version: get: operationId: GetVersion @@ -608,6 +633,29 @@ components: items: $ref: '#/components/schemas/Disk' + SANSwitch: + type: object + required: + - name + - type + - data + properties: + name: + type: string + description: the name the agent reaches the switch with + type: + type: string + enum: + - brocade + description: the driver of the switch, which says how data is read + data: + type: object + additionalProperties: + type: string + description: | + the raw output of each switch command, by command name. For a + brocade: switchshow, nsshow and zoneshow. + ObjectConfig: type: object required: @@ -782,17 +830,27 @@ components: SysReport: type: object - required: - - deleted - - file properties: deleted: type: array items: type: string + description: | + the tracked files deleted on the node since its last report, as + their paths on the node file: type: string format: binary + description: | + a tar of the files and command outputs changed since the last + report, each member named /file/ or + /cmd/. A report of deletions only has none. + full: + type: boolean + description: | + the archive holds every file and command output of the node: the + ones the collector holds for the node and the archive does not + are removed PostChecks: type: object diff --git a/feeder/codegen_server_gen.go b/feeder/codegen_server_gen.go index bc758f48..9f9c7bb5 100644 --- a/feeder/codegen_server_gen.go +++ b/feeder/codegen_server_gen.go @@ -1,11 +1,11 @@ // Package feeder provides primitives to interact with the openapi HTTP API. // -// Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.5.1 DO NOT EDIT. +// Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.7.1 DO NOT EDIT. package feeder import ( "bytes" - "compress/gzip" + "compress/flate" "encoding/base64" "fmt" "net/http" @@ -66,6 +66,9 @@ type ServerInterface interface { // (GET /openapi.json) GetSwagger(ctx echo.Context) error + // (POST /sanswitch) + PostSANSwitch(ctx echo.Context) error + // (GET /version) GetVersion(ctx echo.Context) error } @@ -79,9 +82,9 @@ type ServerInterfaceWrapper struct { func (w *ServerInterfaceWrapper) PostChecks(ctx echo.Context) error { var err error - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Invoke the callback with all the unmarshaled arguments err = w.Handler.PostChecks(ctx) @@ -92,9 +95,9 @@ func (w *ServerInterfaceWrapper) PostChecks(ctx echo.Context) error { func (w *ServerInterfaceWrapper) PostDaemonPing(ctx echo.Context) error { var err error - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Invoke the callback with all the unmarshaled arguments err = w.Handler.PostDaemonPing(ctx) @@ -105,9 +108,9 @@ func (w *ServerInterfaceWrapper) PostDaemonPing(ctx echo.Context) error { func (w *ServerInterfaceWrapper) PostDaemonStatus(ctx echo.Context) error { var err error - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Invoke the callback with all the unmarshaled arguments err = w.Handler.PostDaemonStatus(ctx) @@ -118,9 +121,9 @@ func (w *ServerInterfaceWrapper) PostDaemonStatus(ctx echo.Context) error { func (w *ServerInterfaceWrapper) PostInstanceAction(ctx echo.Context) error { var err error - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Invoke the callback with all the unmarshaled arguments err = w.Handler.PostInstanceAction(ctx) @@ -131,9 +134,9 @@ func (w *ServerInterfaceWrapper) PostInstanceAction(ctx echo.Context) error { func (w *ServerInterfaceWrapper) PutInstanceActionEnd(ctx echo.Context) error { var err error - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Invoke the callback with all the unmarshaled arguments err = w.Handler.PutInstanceActionEnd(ctx) @@ -144,9 +147,9 @@ func (w *ServerInterfaceWrapper) PutInstanceActionEnd(ctx echo.Context) error { func (w *ServerInterfaceWrapper) PostInstanceResourceInfo(ctx echo.Context) error { var err error - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Invoke the callback with all the unmarshaled arguments err = w.Handler.PostInstanceResourceInfo(ctx) @@ -157,15 +160,15 @@ func (w *ServerInterfaceWrapper) PostInstanceResourceInfo(ctx echo.Context) erro func (w *ServerInterfaceWrapper) PostInstanceStatus(ctx echo.Context) error { var err error - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context var params PostInstanceStatusParams // ------------- Optional query parameter "sync" ------------- - err = runtime.BindQueryParameter("form", true, false, "sync", ctx.QueryParams(), ¶ms.Sync) + err = runtime.BindQueryParameterWithOptions("form", true, false, "sync", ctx.QueryParams(), ¶ms.Sync, runtime.BindQueryParameterOptions{Type: "boolean", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter sync: %s", err)) } @@ -179,9 +182,9 @@ func (w *ServerInterfaceWrapper) PostInstanceStatus(ctx echo.Context) error { func (w *ServerInterfaceWrapper) GetNodeActionQueued(ctx echo.Context) error { var err error - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Invoke the callback with all the unmarshaled arguments err = w.Handler.GetNodeActionQueued(ctx) @@ -192,9 +195,9 @@ func (w *ServerInterfaceWrapper) GetNodeActionQueued(ctx echo.Context) error { func (w *ServerInterfaceWrapper) PostNodeActionQueuedDone(ctx echo.Context) error { var err error - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Invoke the callback with all the unmarshaled arguments err = w.Handler.PostNodeActionQueuedDone(ctx) @@ -205,9 +208,9 @@ func (w *ServerInterfaceWrapper) PostNodeActionQueuedDone(ctx echo.Context) erro func (w *ServerInterfaceWrapper) PostNodeActionQueuedRunning(ctx echo.Context) error { var err error - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Invoke the callback with all the unmarshaled arguments err = w.Handler.PostNodeActionQueuedRunning(ctx) @@ -218,9 +221,9 @@ func (w *ServerInterfaceWrapper) PostNodeActionQueuedRunning(ctx echo.Context) e func (w *ServerInterfaceWrapper) PostNodeDisk(ctx echo.Context) error { var err error - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Invoke the callback with all the unmarshaled arguments err = w.Handler.PostNodeDisk(ctx) @@ -231,9 +234,9 @@ func (w *ServerInterfaceWrapper) PostNodeDisk(ctx echo.Context) error { func (w *ServerInterfaceWrapper) PostNodeSysReport(ctx echo.Context) error { var err error - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Invoke the callback with all the unmarshaled arguments err = w.Handler.PostNodeSysReport(ctx) @@ -244,9 +247,9 @@ func (w *ServerInterfaceWrapper) PostNodeSysReport(ctx echo.Context) error { func (w *ServerInterfaceWrapper) PostSystem(ctx echo.Context) error { var err error - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Invoke the callback with all the unmarshaled arguments err = w.Handler.PostSystem(ctx) @@ -257,9 +260,9 @@ func (w *ServerInterfaceWrapper) PostSystem(ctx echo.Context) error { func (w *ServerInterfaceWrapper) PostObjectConfig(ctx echo.Context) error { var err error - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Invoke the callback with all the unmarshaled arguments err = w.Handler.PostObjectConfig(ctx) @@ -275,6 +278,19 @@ func (w *ServerInterfaceWrapper) GetSwagger(ctx echo.Context) error { return err } +// PostSANSwitch converts echo context to params. +func (w *ServerInterfaceWrapper) PostSANSwitch(ctx echo.Context) error { + var err error + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.PostSANSwitch(ctx) + return err +} + // GetVersion converts echo context to params. func (w *ServerInterfaceWrapper) GetVersion(ctx echo.Context) error { var err error @@ -299,101 +315,130 @@ type EchoRouter interface { TRACE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route } +// RegisterHandlersOptions configures RegisterHandlersWithOptions. +type RegisterHandlersOptions struct { + // BaseURL is prepended to every registered path so the API can be served + // under a prefix. + BaseURL string + // OperationMiddlewares lets the caller attach per-operation middleware at + // registration time. The map key is the OpenAPI `operationId` value as it + // appears in the spec (the raw, un-normalized form). Operations that have + // no entry are registered with no extra middleware. A nil map disables + // per-operation middleware entirely. + OperationMiddlewares map[string][]echo.MiddlewareFunc +} + // RegisterHandlers adds each server route to the EchoRouter. func RegisterHandlers(router EchoRouter, si ServerInterface) { - RegisterHandlersWithBaseURL(router, si, "") + RegisterHandlersWithOptions(router, si, RegisterHandlersOptions{}) } -// Registers handlers, and prepends BaseURL to the paths, so that the paths -// can be served under a prefix. +// RegisterHandlersWithBaseURL registers handlers and prepends BaseURL to the +// paths so the API can be served under a prefix. func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL string) { + RegisterHandlersWithOptions(router, si, RegisterHandlersOptions{BaseURL: baseURL}) +} + +// RegisterHandlersWithOptions registers handlers using the supplied options, +// including any per-operation middleware. +func RegisterHandlersWithOptions(router EchoRouter, si ServerInterface, options RegisterHandlersOptions) { wrapper := ServerInterfaceWrapper{ Handler: si, } - router.POST(baseURL+"/checks", wrapper.PostChecks) - router.POST(baseURL+"/daemon/ping", wrapper.PostDaemonPing) - router.POST(baseURL+"/daemon/status", wrapper.PostDaemonStatus) - router.POST(baseURL+"/instance/action", wrapper.PostInstanceAction) - router.PUT(baseURL+"/instance/action", wrapper.PutInstanceActionEnd) - router.POST(baseURL+"/instance/resource_info", wrapper.PostInstanceResourceInfo) - router.POST(baseURL+"/instance/status", wrapper.PostInstanceStatus) - router.GET(baseURL+"/node/actionq", wrapper.GetNodeActionQueued) - router.POST(baseURL+"/node/actionq/done", wrapper.PostNodeActionQueuedDone) - router.POST(baseURL+"/node/actionq/running", wrapper.PostNodeActionQueuedRunning) - router.POST(baseURL+"/node/disk", wrapper.PostNodeDisk) - router.POST(baseURL+"/node/sysreport", wrapper.PostNodeSysReport) - router.POST(baseURL+"/node/system", wrapper.PostSystem) - router.POST(baseURL+"/object/config", wrapper.PostObjectConfig) - router.GET(baseURL+"/openapi.json", wrapper.GetSwagger) - router.GET(baseURL+"/version", wrapper.GetVersion) + router.POST(options.BaseURL+"/checks", wrapper.PostChecks, options.OperationMiddlewares["PostChecks"]...) + router.POST(options.BaseURL+"/daemon/ping", wrapper.PostDaemonPing, options.OperationMiddlewares["PostDaemonPing"]...) + router.POST(options.BaseURL+"/daemon/status", wrapper.PostDaemonStatus, options.OperationMiddlewares["PostDaemonStatus"]...) + router.POST(options.BaseURL+"/instance/action", wrapper.PostInstanceAction, options.OperationMiddlewares["PostInstanceAction"]...) + router.PUT(options.BaseURL+"/instance/action", wrapper.PutInstanceActionEnd, options.OperationMiddlewares["PutInstanceActionEnd"]...) + router.POST(options.BaseURL+"/instance/resource_info", wrapper.PostInstanceResourceInfo, options.OperationMiddlewares["PostInstanceResourceInfo"]...) + router.POST(options.BaseURL+"/instance/status", wrapper.PostInstanceStatus, options.OperationMiddlewares["PostInstanceStatus"]...) + router.GET(options.BaseURL+"/node/actionq", wrapper.GetNodeActionQueued, options.OperationMiddlewares["GetNodeActionQueued"]...) + router.POST(options.BaseURL+"/node/actionq/done", wrapper.PostNodeActionQueuedDone, options.OperationMiddlewares["PostNodeActionQueuedDone"]...) + router.POST(options.BaseURL+"/node/actionq/running", wrapper.PostNodeActionQueuedRunning, options.OperationMiddlewares["PostNodeActionQueuedRunning"]...) + router.POST(options.BaseURL+"/node/disk", wrapper.PostNodeDisk, options.OperationMiddlewares["PostNodeDisk"]...) + router.POST(options.BaseURL+"/node/sysreport", wrapper.PostNodeSysReport, options.OperationMiddlewares["PostNodeSysReport"]...) + router.POST(options.BaseURL+"/node/system", wrapper.PostSystem, options.OperationMiddlewares["PostSystem"]...) + router.POST(options.BaseURL+"/object/config", wrapper.PostObjectConfig, options.OperationMiddlewares["PostObjectConfig"]...) + router.GET(options.BaseURL+"/openapi.json", wrapper.GetSwagger, options.OperationMiddlewares["GetSwagger"]...) + router.POST(options.BaseURL+"/sanswitch", wrapper.PostSANSwitch, options.OperationMiddlewares["PostSANSwitch"]...) + router.GET(options.BaseURL+"/version", wrapper.GetVersion, options.OperationMiddlewares["GetVersion"]...) } -// Base64 encoded, gzipped, json marshaled Swagger object +// Base64 encoded, compressed with deflate, json marshaled OpenAPI spec. +// Stored as a slice of fixed-width chunks rather than one concatenated +// const string: with thousands of chunks the chained `+` fold is several +// times slower for the Go compiler than parsing a slice literal. var swaggerSpec = []string{ - - "H4sIAAAAAAAC/+xbWXMbuRH+K6hJHjZVtChLzkP05jPlJGV7RW/yYKtYINAcYj0DjHHQ5rr431O45sRw", - "KFn0bmI/WRxg+vi60ehj/CUjoqwEB65VdvUlq7DEJWiQ7hfjPxuQu8WOE/8zu8o+2ifZLOO4hOwqU3Zt", - "limygRLbTXpX2ecrIQrAPNvv97NMgqoEV+CIPjo/t/8QwTVwbf/EVVUwgjUTfP6rEtw+awj+WcI6u8r+", - "NG8knftVNX8jxaqA0nOhoIhklSWTXWVPMEXX8NGA0tl+lj06f/gtuP7CsdEbIdlvQD3by2/B9oWQK0Yp", - "cMvzr98G4Jdcg+S4QAuQW5DouZRCWv7PMJSCv2E8f0wIVBrorcSppKhAaua9hQsKy09Mb5aY2BeWHw0Y", - "T7ErTsGURmKNSGGUBonsiwrZN1EFnDKeI/8q8oRUNsuYhlINSbVJODefRa9WWjKeWyXDAywl3tnfYvUr", - "EO0kFUYvieBrlo9L6bcjS10hvcEaSfhomASF3rxevEVzXLG53zQPtEbFbdGalrR54F9LWZY6AyKlsTYK", - "aVaC0risLJpFgVaAJKwlqA1QtBYepsbuC/fWD8v/H1j+kLn3MeY7sR4TT6Av4NsNoBXkjCMhEfBoAacy", - "KP2eZ7Oe1XFNaaAOlvl2yEJvABFRlphTVDAOCMvclO4+a+E2aUUn5ZC6Fz5IXZ8ExDi6fvH08vLyb68w", - "FxaWEuuUCYjsKFPfirMMeMKVWxDdgZlV39/bUe1Dod3b7F+MQ9KrJQuADNhUWG/SCyyhUlDHriVEloyq", - "tE1rT1Gi2AJFbmeCggKlbHQwxnMfbnDOPCpYWJ6NvbgsROI0+18rQH33SxGKoiX520UfBzZ4a08LcISV", - "YjkHiqixNFALD++nCSZbkCp5Bu3LogKutgSRggHXiGKNUXxhQMslbC4k0ezqnTf3LB7McAy9sYP9am9p", - "pAieH3TvWSmeNn8Iagt1EI/efDOIWrOs5bmDW+NW5ziFY9KJWwZwMaZiFLE1KgFzxvO1KUZ8e8IhJ1xu", - "uGxWCnRiqWeyCK/02Pu3osk6IAdZxlEOKXT7Pu8CPnLuehK5XSkuz5j6MCRK0/qPAFoKCkVyJdzNoxFL", - "Qj522yj2m3OvEG6vMsb15UVjZ8Y15OASXqOgLVhrZQucCjkNjzNMW9jAP9CuCUVdZxahFJwvudKYE7gG", - "JYwk8JKvxRBeFp7W90R3+QPs1OHlJGJbXBgLWV85uz+upmTuXz3yGIfyru0kPYbmqAdoUYlC5LtpjsEu", - "DrtD0C/q493zaazbBXLz4qhspw7pTqKGTUqpV4KCPaIH9Dkq2XDH/IiUdJa9dn89rbPoXnpYVUmo7BUc", - "aozBGpXV0iWthxa7Dj+ZLgLfJvetC/i8LPHndDjwq520qr+qscw7Ib61oRScaSGBLmU43ksiDB/ZLSTZ", - "gNISa7hdGifxp1YVU8e/1U4nsxtFRAW3Q++Why7lmG+E0k83QFKeucVF15zxj5Qovd9bLG/lCj153esz", - "L8GY2E1/JF30quNK3OOqWHS7MvYI3u0C9p5K0xOGOg9oo97hcNeYZyyKkw3meS9aJDUXErFwIxwDwPjt", - "IGHLhFFLU1GsgS6x7hxL+/CBzWiTlccd3jmZKcJ1ExGcsERoPA4MoOGzHsr2GG1MifkDCZjiVQEIPlcF", - "5tiXeBUQtmYEaYH0hikkCDFSAidgHVtv4D2vPL+z99N6OAlSMv/sukxNL6TnOb5KTN9C4DtUtzIUG0k6", - "6+ZVitMd+ByqV7ZkOVblbMmIEKnctxGrC0bNoiHYUnBWg3qwkmnb5ZnwVeNofRdahRKUKTSqpCCgFFC0", - "2rky3PJOtK3u1YByLAFQmoKUI5UjFUYfiXYXYemKw0CgZjIF5LXhPHmFJTs68RLpNGKRbx6MxFE82Jws", - "vg5ex5bBlCKJII+bhaOy287Bn5IpEk/Jtdipa6iE1Il0GwoIBfjxidaaFd0idsU4duO7iVAdmAUKKVEr", - "TD7gPNGBwZKk80p3HRbFLQ/JaCRTLD+AweFyaiJn8LGludecSoGyZ5xCRO2UTt1YLaSO8qa4/6hyqaVU", - "LwluFuAzLivrCNn52fnZw0nrj9/Lrt9KjGR6t7DShp4bVow8Nr6ccFq4Xrd92vDaaF35RjuWIONu/+tF", - "9IR//OdtHCY7Em61T2O/n9UdDM20UyzmJWsAChLhirUMeJVdnp2fPXJZbgXcLvpH55kvg5wWc9KUE0Il", - "cow3Rm2Q3+RuAIu2SzBeUrvaFCQeTVD6iaC7+xvFNgz2XYtpaaA/Zb/wQ+CuBq//2TFhdvWuY7x3N/vZ", - "l46B3t3srRPgXFm/CADdWBpzPyqaV/EOSEJ27SdHde0wNlkcwbNVKZ0O0xaTo3C9GCNa75snJuD7WXZx", - "/miIUMmUYjzvIRPnbLMwEwxgh1WmUC3k19gT5xbAjjmbXO8OBj1oxUVs8p/WjoHN/VqyN9N233WcT79s", - "NzWfnkztfdj6XmRq72XrO4/De+2m+/KRWM/OmyFt2kue+GlLPXCx7oxRzrbAY/vAht0Rf4mN1Mdx4nQK", - "j4nJ2tF+co9c+zOVxCC+Pe1D+Ht2vFlWmYSLPef0bg5mev713FWPfwgXS7qA/yTgR+TxkadufMcEMB2A", - "fnF9LyQkIhLsX5EAigSQJTARgDpDtNP4SJLVXT0mraRNra0jDb7muX/rTGUPCy1k00O8OHvY2CWkNhRr", - "fDZhljqTaH+s+i6Nc7Nl3v6Y1WpySnPeJgs5P2DIgIpyUx+kDCGg1NoUxQ79pHacbKTgwqi/+PTyYppS", - "8ylXjCnoJ9yn9F2GGJtuh8Tmo+UcpnBdOHPQrY9xVOxQ2evHPTZ6A1xb3wHatAq7rvx30K8EDbeP7xxl", - "aae4F5fstroSqYYtCn9nvOc0dGXTYUOB7iMugQDbJtqyw7DRB9t1gE9z/AeN5rvf/c2F//taRrbavEnj", - "RPQRJh+4+FQAzUF5+1QaYU79xSMNd4Zai6IQn2zF2/SAUcGUPjvSfLHvfHoLRk7/u0ak8eOq45IkZ0b7", - "jkJ+/m+8LQ5Yxn3XcRpTNJ+e3NUAY/qcMBVysKudkk0XP91LFEp7vOvNB1BuxgKHoC5NoVmFpZ7bpO9B", - "nCgfh3bD4q5o14r8KFeiF8RxwLgL+E3WSYnYgtyNOMHC0zrNQQuCfoXdnQpY44n/IPJd+kL3v3IcH4xD", - "G+OYQNz5ZO40PtJh8dX16beKxmHacxZ1DTn9IB9ffMJ57gZNX5WGT/73Gp9q/yFcO8JVmVXBSMCrNTNM", - "lj8StJEc4Yq1PvoZoPnveulkRU3kfj/lTD3fwhVesYK5EerN3nuh3Mb+gpFFdpWdzbP9zf6/AQAA//9A", - "q0GlODsAAA==", + "7BvJkhu39VdQnRycqjY50iiH8DZelFKSkmXRTg4aFQsEHtnwdAMtLBzRLv57CluvaJIzGspO7JOGDeDt", + "eHibfsmIqGrBgWuVLX7JaixxBRqk+8X49wbkfrnnxP/MFtkH+yXLM44ryBaZsmt5pkgBFbab9L6239dC", + "lIB5djgc8kyCqgVX4IC+uLqy/xDBNXBt/8R1XTKCNRN8/pMS3H5rAf5ZwiZbZH+at5TO/aqav5FiXULl", + "sVBQRLLagskW2VeYorfwwYDS2SHPXlw9+xxYf+TY6EJI9jNQj/b6c6B9KeSaUQrc4vzr5xHwK65Bclyi", + "JcgdSPStlEJa/N9gqAR/w/j2hhCoNdAHkVNLUYPUzFsLFxRW90wXK0zsgdUHA8ZD7JNTMqWR2CBSGqVB", + "IntQIXsS1cAp41vkjyIPSGV5xjRUagyqC8KZeR6tWmnJ+NYyGT5gKfHe/hbrn4BoR6kwekUE37DtNJV+", + "O7LQFdIF1kjCB8MkKPTmu+UPaI5rNveb5gHWJLkdWKcpbT/4YynNUqdApDTWRiHNKlAaV7WVZlmiNSAJ", + "GwmqAIo2woup1fvSnfpD8/8Hmj+m7kP0+Y6sG+IBDAn8oQC0hi3jSEgEPGrAsQxK3/IsH2gdN5BG7GC5", + "3Y1R6AIQEVWFOUUl44Cw3JrKvWcduZ3UoqNyDN0TH6hubgJiHL19+fX19fXfXmMurFgqrFMqILLHTPMq", + "5hnwhCl3RPQIZJZ9/25Hto+5dq+zfzEOSauWLAhkhKbGukgvsARLgR27liBZMqrSOm0sRYlyBxS5nQkI", + "CpSy3sEYj328wRnzJGFhOZ86uCpF4jb7X2tAQ/NLAYqkJfHbRe8HCryztwU4wkqxLQeKqLEwUEce3k4T", + "SHYgVfIO2sOiBq52BJGSAdeIYo1RPDCC5QI255Jotnjn1Z3HixmuoVd20F9jLS0VwfID7wMtxdvmL0Gj", + "oZ7EozW/H3mtPOtY7ujVeNA9TskxacQdBTgfUzOK2AZVgDnj240pJ2z7hEGeMLnxslkr0ImlgcqieKWX", + "vT8VVdYTcqBlWsohhO6+532BT9y7AUVuVwrLN0zdjYHSNP8TAq0EhTK5Et7mSY8lYTv12ij2szOv4G4X", + "GeP6+nmrZ8Y1bMEFvEZBl7DOyg44FfK0eJxiusQG/AF2AyjymlsJpcT5iiuNOYG3oISRBF7xjRiLl4Wv", + "zTvRX76DvTq+nJTYDpfGimzInN0fV1M0D58eeY5BedN2lJ4Dc9ICtKhFKbb70xiDXpzsjol+2VzvgU1j", + "3U2Q24OTtF3apTuKWjQppl4LCvaKHuHnrGDDXfMzQtI8+8799XUTRQ/Cw7pOiso+wSHHGK1RWa9c0Hps", + "sW/wJ8NF4Lvkvk0JH1cV/ph2B361F1YNVzWW256L72yoBGdaSKArGa73igjDJ3YLSQpQWmINDwvjJL7v", + "ZDGN/1vvdTK6UUTU8DDpPfDSpQzzjVD66wJIyjJ3uOyrM/6RImXwe4flg0xhQK87nnsKpshu6yPppFed", + "l+Kel8Wih6WxZ+DuJrBPlJpe0NV5gbbsHXd3rXqmvDgpMN8OvEWScyERCy/COQKYfh0k7JgwamVqijXQ", + "Fda9a2k/fmkj2mTm8YgzF1NFeG6iBE9oIhQeRwrQ8FGPabtBhakw/1ICpnhdAoKPdYk59ileDYRtGEFa", + "IF0whQQhRkrgBKxh6wJuee3xzW5P8+EoSNH8vasytbWQgeX4LDH9CoGvUD1IUWwi6GyKVylMj8BzLF/Z", + "kdVUlrMjE0SkYt+WrL4wGhQtwA6DeSPUo5lMVy/fCJ81TuZ3oVQoQZlSo1oKAkoBReu9S8Mt7kTZ6kkV", + "KKcCAKUpSDmROVJh9JnS7ktYuuQwAGiQnBLkW8N58glLVnTiI9IrxCJfPJjwo3i0OZl8HX2OLYJTjCSc", + "PG4Xzopuexf/FE0ReIqu5c3r5T3TpJgOtzGlzALA5Zu+Xxz7lKGFS3yPhNG1caoATAqkHLZYwcqtlcdq", + "lr1hM/RSSIRv+VoKgikswgFViPsccWX/RXbzz4KD/dHzny1f0ROMabIrvr61tQ+KtFS5wjhE2u6ZS1Ym", + "XtAUTCrZzgYqmw6YHN0XzDKM9wpZqt3TxZTFSF0lylSudOIZ7WhnKrDoRDbh+U5qdK/eQi2kTmgUStAw", + "UW3SEpM7oGjDSlAobEWCN04IKWbfL6YVKrGykrNYcoTVLdcFMIls7Ky6R5xuzo/SLerUtdS4ka2nzhpA", + "tBpvXwr5V54GKu1eS+Utj2Q666ugWts4FVdA0a25urom0be7XzC3COZ+xbLjvyIhb3lyO6lo2N1+nKGb", + "IBxLtZOkvX9I8HKPCqwQFxy83ba5DuPYdbnHCZ4py4n3Q5KC7QAVoqQKwQ7k3sknIZ4oPkv9wscf9v6E", + "YnJZAtFCBkAbIVudWxBdXFSApV/fciwBSajEDmj3CrZt+DxVeCB3eJsoolrw6QKcjWjL8oHv3GQwotj2", + "iCUer4icdTvb0NSx1FxXizh1W9Ve6VTQ2ZHUWQ9C3H9WxaPD1CCPbRfgI65qex2zq9nV7NnJGHU6tHYt", + "E2Ik0/ulpTaUzbFi5Mb4ioDjwlmP/driKrSufa8MS5Bxt//1MlrCP/7zQ5wHcSDc6hDG4ZA3RUjNtGMs", + "phYbAAoS4Zp1FLjIrmdXsxcuUa2B20X/6SrzlQzHxZy0FQGhEmnCG6MK5De5W2Kl7XKEV9SutjUFL01Q", + "+itB9083TdEiOPQ1pqWB4aDMcz/H0efgu3/2VJgt3vWU9+79If+lp6B37w/WCPBWWbsIAnpvYcx9t3de", + "xzAuKbK3vvnbpP9TwwET8uwUOy4n0w6Ss+T6fApos2+eGGI55NnzqxdjCVVMKca3A8nEVnke2vpB2GHV", + "BR6ByE/Rp4ua+ups07VHKPSoFpexT3dZPQY0T6vJwViKG826On3Ybmqnx07tfdYZ+Tq197ozqnV8r930", + "VDYSS1Lzds4ibSVf+YZp0zO15ozRlu2AxwqgC8jS9hJ7ITexaXwJi4n51tl28oRYh23RxCxNt2GP8O/Z", + "8PKsNgkT+5bTxxmYGdjXt64A9JswsaQJ+KmePzyP9zxN7yoGgGkH9KMrXSMhEZFg/4oAUASALIATDqjX", + "B7+MjSRRPdZi0kza0Noa0mgg7+m1cyp6WGoh2zbA89mzVi8htKFY49kJtTSRRHfe/F1azu2WeXce3XJy", + "SXU+JAq5OqLIIBXlGrdIGUJAqY0pyz36Qu05KaTgwqi/+PDy+WlI7TRm9CnoCzyE9Lt0MTbcDoHNB4s5", + "NNL74tyC7szTqVhkjmUWbHQBXFvbAdpWzfqm/HfQrwUNr48v/mZpo3gSk+xXqxOhhk0Kf2V5z2lorKTd", + "hgI9lLgEAmyX6KyM3cZQ2K6Jc5nrP+oVPf7tbx/8X1czstOpSSqnLS+SOy7uS6BbUF4/tXY1R/fwSONL", + "yRtRluLeZrxtGweVTOnZmeqLraPLazBi+t9VIo3zkecFSU6N9oxCfoTHeF0c0YwbzbqMKtrpsccqYIqf", + "C4ZCTuxqr2TbtknXEoXSoRMTNx+RctsHOibqypSa1VjquQ36vow9v/Ok3aJ4rLQbRv5IV6IVxHbAtAn4", + "TdZIidiB3E8YwdLDusxFC4R+gt4dC1jjE//H63dpC/3/jXW+Mw5ljHMccW/q9TI20kPxyfnp5/LGodsz", + "i7yGmH4Ujy/v8XbrGk2fFIaf/B9yPtT+TZh2FFdt1iUjQV4Kc9VOkByzU99s7mpRbBBGy5vXzcgEVp3R", + "DMZ3wLWQDChieuGmDDojJao/bxE73ioOXtileyHvQKIaSwUKMa6Fh+KPgMr9HIkLOXHJsN2l8boENUM3", + "/q1tqVC+cR7PukmIPj8USImlBRuGIKyeqSkhjr9MBaztGM5lrmIL/7H3sCfoEzfxIV77iW5tp3OdTMIl", + "aCM5wjXrTI+O7vS/m6WLpdYR+9Mk1U2XFdd4zUrmGvnvD16qcherXEaW2SKbzbPD+8N/AwAA//8=", } -// GetSwagger returns the content of the embedded swagger specification file -// or error if failed to decode +// decodeSpec returns the embedded OpenAPI spec as raw JSON bytes, +// after base64-decoding and flate-decompressing the embedded blob. func decodeSpec() ([]byte, error) { - zipped, err := base64.StdEncoding.DecodeString(strings.Join(swaggerSpec, "")) + encoded := strings.Join(swaggerSpec, "") + compressed, err := base64.StdEncoding.DecodeString(encoded) if err != nil { return nil, fmt.Errorf("error base64 decoding spec: %w", err) } - zr, err := gzip.NewReader(bytes.NewReader(zipped)) - if err != nil { - return nil, fmt.Errorf("error decompressing spec: %w", err) - } + zr := flate.NewReader(bytes.NewReader(compressed)) var buf bytes.Buffer - _, err = buf.ReadFrom(zr) - if err != nil { - return nil, fmt.Errorf("error decompressing spec: %w", err) + if _, err := buf.ReadFrom(zr); err != nil { + return nil, fmt.Errorf("read flate: %w", err) + } + if err := zr.Close(); err != nil { + return nil, fmt.Errorf("close flate reader: %w", err) } return buf.Bytes(), nil @@ -401,7 +446,7 @@ func decodeSpec() ([]byte, error) { var rawSpec = decodeSpecCached() -// a naive cached of a decoded swagger spec +// a naive cache of the decoded OpenAPI spec func decodeSpecCached() func() ([]byte, error) { data, err := decodeSpec() return func() ([]byte, error) { @@ -419,12 +464,12 @@ func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error) { return res } -// GetSwagger returns the Swagger specification corresponding to the generated code -// in this file. The external references of Swagger specification are resolved. -// The logic of resolving external references is tightly connected to "import-mapping" feature. -// Externally referenced files must be embedded in the corresponding golang packages. -// Urls can be supported but this task was out of the scope. -func GetSwagger() (swagger *openapi3.T, err error) { +// GetSpec returns the OpenAPI specification corresponding to the generated +// code in this file. External references in the spec are resolved through +// PathToRawSpec; externally-referenced files must be embedded in their +// corresponding Go packages (via the import-mapping feature). URL-based +// external refs are not supported. +func GetSpec() (swagger *openapi3.T, err error) { resolvePath := PathToRawSpec("") loader := openapi3.NewLoader() @@ -450,3 +495,22 @@ func GetSwagger() (swagger *openapi3.T, err error) { } return } + +// GetSpecJSON returns the raw JSON bytes of the embedded OpenAPI +// specification: decompressed but not unmarshaled. External references +// are not resolved here; the bytes are the spec exactly as embedded by +// codegen. The result is cached at package init time, so repeated calls +// are cheap. +func GetSpecJSON() ([]byte, error) { + return rawSpec() +} + +// GetSwagger returns the OpenAPI specification corresponding to the +// generated code in this file. +// +// Deprecated: GetSwagger predates kin-openapi renaming openapi3.Swagger +// to openapi3.T. Use [GetSpec] instead. This wrapper is retained for +// backwards compatibility. +func GetSwagger() (*openapi3.T, error) { + return GetSpec() +} diff --git a/feeder/codegen_type_gen.go b/feeder/codegen_type_gen.go index ef13d301..afb62737 100644 --- a/feeder/codegen_type_gen.go +++ b/feeder/codegen_type_gen.go @@ -1,6 +1,6 @@ // Package feeder provides primitives to interact with the openapi HTTP API. // -// Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.5.1 DO NOT EDIT. +// Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.7.1 DO NOT EDIT. package feeder import ( @@ -10,10 +10,25 @@ import ( ) const ( - BasicAuthScopes = "basicAuth.Scopes" - BearerAuthScopes = "bearerAuth.Scopes" + BasicAuthScopes basicAuthContextKey = "basicAuth.Scopes" + BearerAuthScopes bearerAuthContextKey = "bearerAuth.Scopes" ) +// Defines values for SANSwitchType. +const ( + Brocade SANSwitchType = "brocade" +) + +// Valid indicates whether the value is a known member of the SANSwitchType enum. +func (e SANSwitchType) Valid() bool { + switch e { + case Brocade: + return true + default: + return false + } +} + // Action The begin or end action request type Action struct { Action string `json:"action"` @@ -194,10 +209,37 @@ type QueuedActions struct { Actions []QueuedAction `json:"actions"` } +// SANSwitch defines model for SANSwitch. +type SANSwitch struct { + // Data the raw output of each switch command, by command name. For a + // brocade: switchshow, nsshow and zoneshow. + Data map[string]string `json:"data"` + + // Name the name the agent reaches the switch with + Name string `json:"name"` + + // Type the driver of the switch, which says how data is read + Type SANSwitchType `json:"type"` +} + +// SANSwitchType the driver of the switch, which says how data is read +type SANSwitchType string + // SysReport defines model for SysReport. type SysReport struct { - Deleted []string `json:"deleted"` - File openapi_types.File `json:"file"` + // Deleted the tracked files deleted on the node since its last report, as + // their paths on the node + Deleted *[]string `json:"deleted,omitempty"` + + // File a tar of the files and command outputs changed since the last + // report, each member named /file/ or + // /cmd/. A report of deletions only has none. + File *openapi_types.File `json:"file,omitempty"` + + // Full the archive holds every file and command output of the node: the + // ones the collector holds for the node and the archive does not + // are removed + Full *bool `json:"full,omitempty"` } // Package defines model for package. @@ -253,6 +295,12 @@ type DaemonStatusAccepted struct { ObjectWithoutConfig *[]string `json:"object_without_config,omitempty"` } +// basicAuthContextKey is the context key for basicAuth security scheme +type basicAuthContextKey string + +// bearerAuthContextKey is the context key for bearerAuth security scheme +type bearerAuthContextKey string + // PostInstanceStatusParams defines parameters for PostInstanceStatus. type PostInstanceStatusParams struct { Sync *InQuerySync `form:"sync,omitempty" json:"sync,omitempty"` @@ -296,3 +344,6 @@ type PostSystemJSONRequestBody = System // PostObjectConfigJSONRequestBody defines body for PostObjectConfig for application/json ContentType. type PostObjectConfigJSONRequestBody = ObjectConfig + +// PostSANSwitchJSONRequestBody defines body for PostSANSwitch for application/json ContentType. +type PostSANSwitchJSONRequestBody = SANSwitch diff --git a/feeder/handlers/post_feed_san_switch.go b/feeder/handlers/post_feed_san_switch.go new file mode 100644 index 00000000..c37a564a --- /dev/null +++ b/feeder/handlers/post_feed_san_switch.go @@ -0,0 +1,56 @@ +package feederhandlers + +import ( + "encoding/json" + "net/http" + "strings" + + "github.com/labstack/echo/v4" + + "github.com/opensvc/oc3/cachekeys" + "github.com/opensvc/oc3/feeder" + "github.com/opensvc/oc3/util/logkey" +) + +// PostSANSwitch will populate FeedSANSwitchH @ with the posted +// switch configuration, and queue its parsing. +// +// A switch is keyed by its name and not by the node reporting it: the +// switches of a fabric are inventoried by a couple of nodes of the whole +// infrastructure, and the latest report of a switch is the one to parse, +// whichever node sent it. +func (a *Api) PostSANSwitch(c echo.Context) error { + nodeID, log := getNodeIDAndLogger(c, "PostSANSwitch") + if nodeID == "" { + return JSONNodeAuthProblem(c) + } + + var payload feeder.PostSANSwitchJSONRequestBody + if err := c.Bind(&payload); err != nil { + return JSONProblem(c, http.StatusBadRequest, err.Error()) + } + switch { + case payload.Name == "", strings.Contains(payload.Name, "@"): + return JSONProblemf(c, http.StatusBadRequest, "invalid switch name: %q", payload.Name) + case !payload.Type.Valid(): + return JSONProblemf(c, http.StatusBadRequest, "unsupported switch type: %q", payload.Type) + } + b, err := json.Marshal(payload) + if err != nil { + log.Warn("Marshal", logkey.Error, err) + return JSONError(c) + } + ctx := c.Request().Context() + idx := string(payload.Type) + "@" + payload.Name + log.Debug("HSet keyH") + if err := a.Redis.HSet(ctx, cachekeys.FeedSANSwitchH, idx, b).Err(); err != nil { + log.Error("HSet keyH", logkey.Error, err) + return JSONError(c) + } + + if err := a.pushNotPending(ctx, log, cachekeys.FeedSANSwitchPendingH, cachekeys.FeedSANSwitchQ, idx); err != nil { + log.Error("pushNotPending", logkey.Error, err) + return JSONError(c) + } + return c.JSON(http.StatusAccepted, nil) +} diff --git a/feeder/handlers/post_feed_sysreport.go b/feeder/handlers/post_feed_sysreport.go index 102c5d4a..656a2fd3 100644 --- a/feeder/handlers/post_feed_sysreport.go +++ b/feeder/handlers/post_feed_sysreport.go @@ -3,18 +3,20 @@ package feederhandlers import ( "archive/tar" "encoding/json" + "fmt" "io" "io/fs" "log/slog" + "mime/multipart" "net/http" "os" "path/filepath" + "strconv" "strings" "github.com/labstack/echo/v4" "github.com/opensvc/oc3/cachekeys" - "github.com/opensvc/oc3/feeder" "github.com/opensvc/oc3/util/echolog" "github.com/opensvc/oc3/util/logkey" @@ -27,37 +29,68 @@ type sysreportData struct { NodeID string `json:"node_id"` } +// PostNodeSysReport stores the files and command outputs a node tracks, as +// the tree /sysreport//{file,cmd}/..., and queues the +// commit of the tree the scheduler versions. +// +// The form carries the tar of what changed, the tracked files deleted, and +// the full flag of a report holding everything the node tracks. A report of +// deletions only has no tar. +// +// Every path is confined to the tree of the node: a member or a deleted path +// climbing out of it with ".." lands inside it, as rooted there. func (a *Api) PostNodeSysReport(ctx echo.Context) error { log := echolog.GetLogHandler(ctx, "PostNodeSysReport") - file, err := ctx.FormFile("file") + nodeID, ok := ctx.Get(XNodeID).(string) + if !ok || nodeID == "" { + return JSONNodeAuthProblem(ctx) + } + form, err := ctx.MultipartForm() if err != nil { - return JSONProblemf(ctx, http.StatusBadRequest, "FormFile: %s", err) + return JSONProblemf(ctx, http.StatusBadRequest, "multipart form: %s", err) } - - var payload feeder.SysReport - if values, ok := ctx.Request().MultipartForm.Value["deleted"]; ok { - payload.Deleted = values + deleted := form.Value["deleted"] + full := false + if l := form.Value["full"]; len(l) > 0 { + if full, err = strconv.ParseBool(l[0]); err != nil { + return JSONProblemf(ctx, http.StatusBadRequest, "full: %s", err) + } + } + var file *multipart.FileHeader + if l := form.File["file"]; len(l) > 0 { + file = l[0] + } + if file == nil && full { + return JSONProblem(ctx, http.StatusBadRequest, "a full report needs its archive") } - payload.File.InitFromMultipart(file) uploadDir := viper.GetString("scheduler.directories.uploads") - sysreportDir := filepath.Join(uploadDir, "sysreport") - if err := os.MkdirAll(sysreportDir, 0755); err != nil { + nodeDir := filepath.Join(uploadDir, "sysreport", nodeID) + if err := os.MkdirAll(nodeDir, 0755); err != nil { log.Error("can't create sysreport dir", logkey.Error, err) return JSONProblem(ctx, http.StatusInternalServerError, "can't create sysreport dir") } - nodeID := ctx.Get(XNodeID).(string) - - needCommit := false - needCommit = sendSysreportDelete(log, payload.Deleted, sysreportDir, nodeID) || needCommit - needCommit = sendSysreportArchive(log, payload, file.Filename, sysreportDir, nodeID) || needCommit - - // TODO: Add metric PostNodeSysReport File size + needCommit := sysreportDelete(log, deleted, nodeDir) + if file != nil { + written, err := sysreportExtract(file, nodeDir) + if err != nil { + log.Error("sysreportExtract", logkey.Error, err) + return JSONProblemf(ctx, http.StatusBadRequest, "archive: %s", err) + } + if len(written) > 0 { + needCommit = true + } + if full { + if n := sysreportRemoveOthers(log, nodeDir, written); n > 0 { + needCommit = true + } + } + } v := sysreportData{ NeedCommit: needCommit, - Deleted: payload.Deleted, + Deleted: deleted, NodeID: nodeID, } if b, err := json.Marshal(v); err != nil { @@ -71,44 +104,45 @@ func (a *Api) PostNodeSysReport(ctx echo.Context) error { return ctx.JSON(http.StatusAccepted, "sysreport accepted") } -func sendSysreportDelete(l *slog.Logger, deleted []string, sysreportDir string, nodeID string) bool { +// confine returns the path rel names inside base, rel rooted at base: a rel +// climbing with ".." stops at base, and never leaves it. +func confine(base, rel string) string { + return filepath.Join(base, filepath.Clean("/"+rel)) +} + +// sysreportDelete removes the files of the node tree the node deleted, +// named by their path on the node, and says whether it was given any. +func sysreportDelete(l *slog.Logger, deleted []string, nodeDir string) bool { if len(deleted) == 0 { return false } - nodeDir := filepath.Join(sysreportDir, nodeID) + fileDir := filepath.Join(nodeDir, "file") for _, fpath := range deleted { fpath = strings.TrimSpace(fpath) - var relpath string - if filepath.IsAbs(fpath) { - relpath = "file" + fpath - } else { - relpath = filepath.Join("file", fpath) + if fpath == "" { + continue } - pathToDelete := filepath.Join(nodeDir, relpath) - if err := os.Remove(pathToDelete); err != nil && !os.IsNotExist(err) { - l.Warn("sendSysreportDelete", logkey.Error, err) + if err := os.Remove(confine(fileDir, fpath)); err != nil && !os.IsNotExist(err) { + l.Warn("sysreportDelete", logkey.Error, err) } } return true } -func sendSysreportArchive(l *slog.Logger, payload feeder.SysReport, filename string, sysreportDir string, nodeID string) bool { - if filename == "" { - return false - } - fPath := filepath.Join(sysreportDir, filename) - - if !strings.HasSuffix(fPath, ".tar") { - return false - } - - reader, err := payload.File.Reader() +// sysreportExtract writes the regular files of the archive in the node tree, +// the first component of their name, the node name, replaced by the tree, +// and returns the paths written. Each file is closed once written. +func sysreportExtract(file *multipart.FileHeader, nodeDir string) (map[string]bool, error) { + reader, err := file.Open() if err != nil { - l.Error("sendSysreportArchive", logkey.Error, err) - return false + return nil, err } defer reader.Close() + return sysreportExtractReader(reader, nodeDir) +} +func sysreportExtractReader(reader io.Reader, nodeDir string) (map[string]bool, error) { + written := make(map[string]bool) tr := tar.NewReader(reader) for { header, err := tr.Next() @@ -116,46 +150,67 @@ func sendSysreportArchive(l *slog.Logger, payload feeder.SysReport, filename str break } if err != nil { - l.Error("sendSysreportArchive", logkey.Error, err) - return false + return written, err } - idx := strings.Index(header.Name, "/") - if idx == -1 { + if header.Typeflag != tar.TypeReg { continue } - targetName := nodeID + header.Name[idx:] - targetPath := filepath.Join(sysreportDir, targetName) - - if info, err := os.Stat(targetPath); err == nil { - // enable write - _ = os.Chmod(targetPath, info.Mode()|0200) - } - - if err := os.MkdirAll(filepath.Dir(targetPath), 0755); err != nil { - l.Error("sendSysreportArchive", logkey.Error, err) - return false - } - - outFile, err := os.OpenFile(targetPath, os.O_CREATE|os.O_RDWR|os.O_TRUNC, fs.FileMode(header.Mode)) - if err != nil { - l.Error("sendSysreportArchive OpenFile", logkey.Error, err) - return false - } else { - defer func() { - _ = outFile.Close() - }() + _, rel, ok := strings.Cut(header.Name, "/") + if !ok || rel == "" { + continue } - - if _, err := io.Copy(outFile, tr); err != nil { - l.Error("sendSysreportArchive Copy", logkey.Error, err) - return false + targetPath := confine(nodeDir, rel) + if err := writeSysreportFile(targetPath, fs.FileMode(header.Mode).Perm(), tr); err != nil { + return written, err } + written[targetPath] = true + } + return written, nil +} - if info, err := os.Stat(targetPath); err == nil { - // restore read only - _ = os.Chmod(targetPath, info.Mode()|0400) - } +func writeSysreportFile(targetPath string, mode fs.FileMode, r io.Reader) error { + if info, err := os.Stat(targetPath); err == nil { + // enable write + _ = os.Chmod(targetPath, info.Mode()|0200) + } + if err := os.MkdirAll(filepath.Dir(targetPath), 0755); err != nil { + return err + } + f, err := os.OpenFile(targetPath, os.O_CREATE|os.O_RDWR|os.O_TRUNC, mode|0600) + if err != nil { + return fmt.Errorf("open %s: %w", targetPath, err) + } + if _, err := io.Copy(f, r); err != nil { + _ = f.Close() + return fmt.Errorf("write %s: %w", targetPath, err) + } + if err := f.Close(); err != nil { + return fmt.Errorf("close %s: %w", targetPath, err) + } + return os.Chmod(targetPath, mode|0400) +} +// sysreportRemoveOthers removes the files of the node tree a full report does +// not hold, and returns how many it removed. The git history of the tree is +// left alone. +func sysreportRemoveOthers(l *slog.Logger, nodeDir string, written map[string]bool) int { + n := 0 + for _, sub := range []string{"file", "cmd"} { + root := filepath.Join(nodeDir, sub) + _ = filepath.WalkDir(root, func(path string, d fs.DirEntry, err error) error { + if err != nil { + return nil + } + if d.IsDir() || written[path] { + return nil + } + if err := os.Remove(path); err != nil { + l.Warn("sysreportRemoveOthers", logkey.Error, err) + return nil + } + n++ + return nil + }) } - return true + return n } diff --git a/feeder/handlers/post_feed_sysreport_test.go b/feeder/handlers/post_feed_sysreport_test.go new file mode 100644 index 00000000..9a0e36b2 --- /dev/null +++ b/feeder/handlers/post_feed_sysreport_test.go @@ -0,0 +1,161 @@ +package feederhandlers + +import ( + "archive/tar" + "bytes" + "log/slog" + "os" + "path/filepath" + "strings" + "testing" +) + +func testTar(t *testing.T, entries map[string]string, symlinks map[string]string) *bytes.Buffer { + t.Helper() + var buf bytes.Buffer + tw := tar.NewWriter(&buf) + for name, content := range entries { + if err := tw.WriteHeader(&tar.Header{Name: name, Mode: 0644, Size: int64(len(content)), Typeflag: tar.TypeReg}); err != nil { + t.Fatal(err) + } + if _, err := tw.Write([]byte(content)); err != nil { + t.Fatal(err) + } + } + for name, target := range symlinks { + if err := tw.WriteHeader(&tar.Header{Name: name, Linkname: target, Typeflag: tar.TypeSymlink}); err != nil { + t.Fatal(err) + } + } + if err := tw.Close(); err != nil { + t.Fatal(err) + } + return &buf +} + +func readFile(t *testing.T, p string) string { + t.Helper() + b, err := os.ReadFile(p) + if err != nil { + t.Fatalf("read %s: %s", p, err) + } + return string(b) +} + +// A path climbing out of the base with ".." stops at the base. +func TestConfine(t *testing.T) { + for rel, want := range map[string]string{ + "file/etc/hosts": "/base/file/etc/hosts", + "/etc/hosts": "/base/etc/hosts", + "../../etc/passwd": "/base/etc/passwd", + "file/../../../etc/shadow": "/base/etc/shadow", + } { + if got := confine("/base", rel); got != want { + t.Errorf("%s: got %s, want %s", rel, got, want) + } + } +} + +// The members of the archive land in the node tree, the node name replaced +// by it, a member climbing with ".." included, and a symlink is not written. +func TestSysreportExtract(t *testing.T) { + root := t.TempDir() + nodeDir := filepath.Join(root, "sysreport", "node1") + archive := testTar(t, map[string]string{ + "dev2n1/file/etc/hosts": "hosts", + "dev2n1/cmd/uname": "Linux", + "dev2n1/../../../escaped": "escaped", + "dev2n1/file/../../../../outer": "outer", + }, map[string]string{ + "dev2n1/file/etc/link": "/etc/shadow", + }) + written, err := sysreportExtractReader(archive, nodeDir) + if err != nil { + t.Fatal(err) + } + if got := readFile(t, filepath.Join(nodeDir, "file/etc/hosts")); got != "hosts" { + t.Errorf("hosts: %q", got) + } + if got := readFile(t, filepath.Join(nodeDir, "cmd/uname")); got != "Linux" { + t.Errorf("uname: %q", got) + } + for _, p := range []string{filepath.Join(root, "escaped"), filepath.Join(root, "outer"), filepath.Join(filepath.Dir(root), "outer")} { + if _, err := os.Stat(p); err == nil { + t.Errorf("%s written out of the node tree", p) + } + } + if _, err := os.Lstat(filepath.Join(nodeDir, "file/etc/link")); err == nil { + t.Error("a symlink member is written") + } + for p := range written { + if !strings.HasPrefix(p, nodeDir+"/") { + t.Errorf("%s written out of the node tree", p) + } + } +} + +// The deleted files are removed from the file tree of the node, and a path +// climbing with ".." does not reach out of it. +func TestSysreportDelete(t *testing.T) { + root := t.TempDir() + nodeDir := filepath.Join(root, "sysreport", "node1") + victim := filepath.Join(root, "victim") + if err := os.WriteFile(victim, []byte("x"), 0644); err != nil { + t.Fatal(err) + } + if _, err := sysreportExtractReader(testTar(t, map[string]string{"n/file/etc/motd": "hi"}, nil), nodeDir); err != nil { + t.Fatal(err) + } + log := slog.Default() + if !sysreportDelete(log, []string{"/etc/motd", "../../../victim"}, nodeDir) { + t.Error("deletions not reported") + } + if _, err := os.Stat(filepath.Join(nodeDir, "file/etc/motd")); err == nil { + t.Error("deleted file still there") + } + if _, err := os.Stat(victim); err != nil { + t.Error("a file out of the node tree was deleted") + } + if sysreportDelete(log, nil, nodeDir) { + t.Error("no deletion reported as one") + } +} + +// A full report removes the files the node no longer holds, and leaves the +// git history alone. +func TestSysreportRemoveOthers(t *testing.T) { + nodeDir := filepath.Join(t.TempDir(), "sysreport", "node1") + if _, err := sysreportExtractReader(testTar(t, map[string]string{ + "n/file/etc/old": "old", + "n/cmd/oldcmd": "old", + }, nil), nodeDir); err != nil { + t.Fatal(err) + } + gitFile := filepath.Join(nodeDir, ".git", "HEAD") + if err := os.MkdirAll(filepath.Dir(gitFile), 0755); err != nil { + t.Fatal(err) + } + if err := os.WriteFile(gitFile, []byte("ref"), 0644); err != nil { + t.Fatal(err) + } + written, err := sysreportExtractReader(testTar(t, map[string]string{ + "n/file/etc/new": "new", + "n/cmd/newcmd": "new", + }, nil), nodeDir) + if err != nil { + t.Fatal(err) + } + if n := sysreportRemoveOthers(slog.Default(), nodeDir, written); n != 2 { + t.Errorf("removed %d files, want 2", n) + } + for _, p := range []string{"file/etc/old", "cmd/oldcmd"} { + if _, err := os.Stat(filepath.Join(nodeDir, p)); err == nil { + t.Errorf("%s not removed", p) + } + } + for _, p := range []string{"file/etc/new", "cmd/newcmd", ".git/HEAD"} { + if _, err := os.Stat(filepath.Join(nodeDir, p)); err != nil { + t.Errorf("%s removed", p) + } + } +} diff --git a/go.mod b/go.mod index 8241691a..cfb36d2f 100644 --- a/go.mod +++ b/go.mod @@ -12,11 +12,12 @@ require ( github.com/gorilla/websocket v1.5.3 github.com/labstack/echo-contrib v0.17.4 github.com/labstack/echo/v4 v4.15.3 - github.com/oapi-codegen/runtime v1.1.2 + github.com/oapi-codegen/runtime v1.7.0 github.com/prometheus/client_golang v1.23.2 github.com/shaj13/go-guardian/v2 v2.11.6 github.com/spf13/cobra v1.10.1 github.com/spf13/viper v1.21.0 + gopkg.in/yaml.v3 v3.0.1 ) require ( @@ -64,7 +65,6 @@ require ( golang.org/x/time v0.15.0 // indirect golang.org/x/tools v0.44.0 // indirect google.golang.org/protobuf v1.36.10 // indirect - gopkg.in/yaml.v3 v3.0.1 // indirect ) tool github.com/oapi-codegen/oapi-codegen/v2/cmd/oapi-codegen diff --git a/go.sum b/go.sum index 3ffde083..8fca6b90 100644 --- a/go.sum +++ b/go.sum @@ -157,10 +157,12 @@ github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+ github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= +github.com/oapi-codegen/nullable v1.1.0 h1:eAh8JVc5430VtYVnq00Hrbpag9PFRGWLjxR1/3KntMs= +github.com/oapi-codegen/nullable v1.1.0/go.mod h1:KUZ3vUzkmEKY90ksAmit2+5juDIhIZhfDl+0PwOQlFY= github.com/oapi-codegen/oapi-codegen/v2 v2.7.1 h1:a7Ab7YlpqkVG5HKrTaeFstm32Z5QOnyjnbsCO0jiMYM= github.com/oapi-codegen/oapi-codegen/v2 v2.7.1/go.mod h1:qzFy6iuobJw/hD1aRILee4G87/ShmhR0xYCwcUtZMCw= -github.com/oapi-codegen/runtime v1.1.2 h1:P2+CubHq8fO4Q6fV1tqDBZHCwpVpvPg7oKiYzQgXIyI= -github.com/oapi-codegen/runtime v1.1.2/go.mod h1:SK9X900oXmPWilYR5/WKPzt3Kqxn/uS/+lbpREv+eCg= +github.com/oapi-codegen/runtime v1.7.0 h1:t7358VYPvNbWJ9gdAkIK/smVeHpBf6yp8VTsaZsb/7k= +github.com/oapi-codegen/runtime v1.7.0/go.mod h1:GwV7hC2hviaMzj+ITfHVRESK5J2W/GefVwIND/bMGvU= github.com/oasdiff/yaml v0.1.1 h1:6nHx+pn9gBRM6YpBlFZFQGCCd1nuvqOBtTD3KKTgGxY= github.com/oasdiff/yaml v0.1.1/go.mod h1:EYJNoyktvWMJ0Hmhx+6qTaqMOsalUaRGT8Sj1hNcegU= github.com/oasdiff/yaml3 v0.0.14 h1:aLJee3hxBK2H5wdXd9iPcIXb93Nty1Ge0pT171eHtkw= diff --git a/schema/relations.go b/schema/relations.go index c64cf0c9..fb2e01ef 100644 --- a/schema/relations.go +++ b/schema/relations.go @@ -14,7 +14,17 @@ func init() { NodeIPNodeID.Ref = NodesNodeID + NodesClusterID.Ref = ClustersClusterID + + ActionQueueNodeID.Ref = NodesNodeID + ActionQueueSvcID.Ref = ServicesSvcID + + PackagesNodeID.Ref = NodesNodeID + NodeHWNodeID.Ref = NodesNodeID + PackagesPkgSig.Ref = PkgSigProviderSigID + SvcmonSvcID.Ref = ServicesSvcID + SvcmonNodeID.Ref = NodesNodeID SvcmonLogSvcID.Ref = ServicesSvcID ServicesLogSvcID.Ref = ServicesSvcID } diff --git a/server/api.yaml b/server/api.yaml index 1892f3c6..ef92bdac 100644 --- a/server/api.yaml +++ b/server/api.yaml @@ -22,6 +22,7 @@ paths: - $ref: '#/components/parameters/inQueryMeta' - $ref: '#/components/parameters/inQueryStats' - $ref: '#/components/parameters/inQueryOrderby' + - $ref: '#/components/parameters/inQueryFilter' - $ref: '#/components/parameters/inQueryGroupby' tags: - collector @@ -80,6 +81,66 @@ paths: security: - basicAuth: [ ] - bearerAuth: [ ] + put: + operationId: PutActions + description: | + Enqueue agent actions, as the historical collector's PUT /actions does. The + body is one entry, or a list of entries; the fields present select the + target: + + - node_id and svc_id: an action on that instance of the service, acting on + that node only (--local), or on the resources given by rid (--rid). + Requires the NodeExec privilege and responsibility for the service. + - svc_id alone: an action on the whole service, posted for a node of the + service seen alive in the last 15 minutes. Same requirements. + - node_id alone: a node action. Requires the NodeExec privilege and + responsibility for the node. + + Accepted actions: push resinfo, push config, freeze and thaw on a service + or an instance; pushasset, pushdisks, pushpkg, pushpatch, pushstats, + checks, sysreport, scanscsi, freeze and thaw on a node. Compliance actions + (module, moduleset, ruleset) and agent options are not supported. + + One entry answers with the queued action, as GET /actions/{id} does, or + with a problem. A list always answers 200, with the queued actions in + data and one message per refused entry in error; entries differing only + by rid are merged into one action on those resources. + requestBody: + required: true + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/ActionEnqueue' + - type: array + items: + $ref: '#/components/schemas/ActionEnqueue' + tags: + - collector + responses: + 200: + description: | + The queued action for one entry; for a list, an object with the + queued actions in data and the refusals in error. + content: + application/json: + schema: + type: object + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' + 409: + $ref: '#/components/responses/409' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] /actions/{id}: get: @@ -175,7 +236,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ListResponse' + $ref: '#/components/schemas/AlertListResponse' 500: $ref: '#/components/responses/500' security: @@ -306,7 +367,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ListResponse' + $ref: '#/components/schemas/AlertListResponse' 404: $ref: '#/components/responses/404' 500: @@ -451,6 +512,7 @@ paths: - $ref: '#/components/parameters/inQueryStats' - $ref: '#/components/parameters/inQueryOrderby' - $ref: '#/components/parameters/inQueryGroupby' + - $ref: '#/components/parameters/inQueryFilter' tags: - collector responses: @@ -459,7 +521,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ListResponse' + $ref: '#/components/schemas/AppListResponse' 500: $ref: '#/components/responses/500' security: @@ -494,7 +556,7 @@ paths: content: application/json: schema: - type: object + $ref: '#/components/schemas/AppRow' 400: $ref: '#/components/responses/400' 401: @@ -590,7 +652,7 @@ paths: content: application/json: schema: - type: object + $ref: '#/components/schemas/AppRow' 400: $ref: '#/components/responses/400' 401: @@ -623,7 +685,7 @@ paths: content: application/json: schema: - type: object + $ref: '#/components/schemas/AppRow' 404: $ref: '#/components/responses/404' 500: @@ -649,7 +711,7 @@ paths: content: application/json: schema: - type: object + $ref: '#/components/schemas/InfoResponse' 401: $ref: '#/components/responses/401' 403: @@ -1374,6 +1436,7 @@ paths: - $ref: '#/components/parameters/inQueryStats' - $ref: '#/components/parameters/inQueryOrderby' - $ref: '#/components/parameters/inQueryGroupby' + - $ref: '#/components/parameters/inQueryFilter' tags: - collector responses: @@ -1382,7 +1445,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ListResponse' + $ref: '#/components/schemas/DiskListResponse' 500: $ref: '#/components/responses/500' security: @@ -1487,7 +1550,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ListResponse' + $ref: '#/components/schemas/DiskListResponse' 404: $ref: '#/components/responses/404' 500: @@ -1516,7 +1579,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ListResponse' + $ref: '#/components/schemas/FilterListResponse' 500: $ref: '#/components/responses/500' security: @@ -1560,7 +1623,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ListResponse' + $ref: '#/components/schemas/FilterListResponse' 400: $ref: '#/components/responses/400' 401: @@ -1621,7 +1684,10 @@ paths: /filters/{filter_id}: post: operationId: PostFilter - description: Modify a filter properties + description: | + Modify a filter definition. The resulting definition is validated as on + creation: known table and operator, existing column, no other filter with + the same definition. `f_label` is computed from the definition. parameters: - in: path name: filter_id @@ -1642,10 +1708,12 @@ paths: type: string f_op: type: string + enum: ['=', 'LIKE', '>', '>=', '<', '<=', 'IN'] f_value: type: string f_label: type: string + description: Rejected with a 400; the label is computed from the definition. tags: - collector responses: @@ -1654,7 +1722,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ListResponse' + $ref: '#/components/schemas/FilterListResponse' 400: $ref: '#/components/responses/400' 401: @@ -1663,6 +1731,8 @@ paths: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' + 409: + $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' security: @@ -1726,7 +1796,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ListResponse' + $ref: '#/components/schemas/FilterListResponse' 404: $ref: '#/components/responses/404' 500: @@ -1747,6 +1817,7 @@ paths: - $ref: '#/components/parameters/inQueryStats' - $ref: '#/components/parameters/inQueryOrderby' - $ref: '#/components/parameters/inQueryGroupby' + - $ref: '#/components/parameters/inQueryFilter' tags: - collector responses: @@ -1755,7 +1826,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ListResponse' + $ref: '#/components/schemas/FiltersetListResponse' 500: $ref: '#/components/responses/500' security: @@ -1781,6 +1852,7 @@ paths: description: Name of the filterset to create, or of the filterset to update fset_stats: type: string + enum: ['T', 'F'] description: Whether the filterset is a stats filterset (T or F) tags: - collector @@ -1790,7 +1862,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ListResponse' + $ref: '#/components/schemas/FiltersetListResponse' 400: $ref: '#/components/responses/400' 401: @@ -1872,6 +1944,7 @@ paths: type: string fset_stats: type: string + enum: ['T', 'F'] tags: - collector responses: @@ -1880,7 +1953,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ListResponse' + $ref: '#/components/schemas/FiltersetListResponse' 400: $ref: '#/components/responses/400' 401: @@ -1952,7 +2025,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ListResponse' + $ref: '#/components/schemas/FiltersetListResponse' 404: $ref: '#/components/responses/404' 500: @@ -1981,7 +2054,7 @@ paths: content: application/json: schema: - type: object + $ref: '#/components/schemas/FiltersetUsageResponse' 404: $ref: '#/components/responses/404' 500: @@ -2009,7 +2082,7 @@ paths: content: application/json: schema: - type: object + $ref: '#/components/schemas/FiltersetExport' 500: $ref: '#/components/responses/500' security: @@ -2033,6 +2106,7 @@ paths: - $ref: '#/components/parameters/inQueryMeta' - $ref: '#/components/parameters/inQueryStats' - $ref: '#/components/parameters/inQueryOrderby' + - $ref: '#/components/parameters/inQueryFilter' - $ref: '#/components/parameters/inQueryGroupby' tags: - collector @@ -2042,7 +2116,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ListResponse' + $ref: '#/components/schemas/NodeListResponse' 404: $ref: '#/components/responses/404' 500: @@ -2068,6 +2142,7 @@ paths: - $ref: '#/components/parameters/inQueryMeta' - $ref: '#/components/parameters/inQueryStats' - $ref: '#/components/parameters/inQueryOrderby' + - $ref: '#/components/parameters/inQueryFilter' - $ref: '#/components/parameters/inQueryGroupby' tags: - collector @@ -2077,7 +2152,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ListResponse' + $ref: '#/components/schemas/ServiceListResponse' 404: $ref: '#/components/responses/404' 500: @@ -2112,7 +2187,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ListResponse' + $ref: '#/components/schemas/FiltersetFilterListResponse' 404: $ref: '#/components/responses/404' 500: @@ -2149,6 +2224,7 @@ paths: type: integer f_log_op: type: string + enum: ['AND', 'AND NOT', 'OR', 'OR NOT'] tags: - collector responses: @@ -2240,7 +2316,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ListResponse' + $ref: '#/components/schemas/FiltersetListResponse' 404: $ref: '#/components/responses/404' 500: @@ -2277,6 +2353,7 @@ paths: type: integer f_log_op: type: string + enum: ['AND', 'AND NOT', 'OR', 'OR NOT'] tags: - collector responses: @@ -2367,6 +2444,7 @@ paths: description: Filter record id, or filter label f_log_op: type: string + enum: ['AND', 'AND NOT', 'OR', 'OR NOT'] description: Logical operator joining this filter to the previous one f_order: type: integer @@ -2465,6 +2543,7 @@ paths: description: Child filterset record id, or name f_log_op: type: string + enum: ['AND', 'AND NOT', 'OR', 'OR NOT'] description: Logical operator joining this filterset to the previous entry f_order: type: integer @@ -2542,12 +2621,92 @@ paths: - basicAuth: [ ] - bearerAuth: [ ] - /groups: + /form_output_results/{results_id}: get: - operationId: GetGroups + operationId: GetFormOutputResults description: | - List existing groups. Managers can see all groups; other users only see - the groups they belong to. + Show the results structure of a form submission. + parameters: + - in: path + name: results_id + required: true + description: Results id + schema: + type: integer + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 404: + $ref: '#/components/responses/404' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + put: + operationId: PutFormOutputResults + description: | + Add a result or log lines to an output of a form submission results. + parameters: + - in: path + name: results_id + required: true + description: Results id + schema: + type: integer + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + output_id: + type: string + description: The id of the form output for which to store the result + result: + description: The result to add for output_id, a JSON document or its string form + log: + description: The log lines to append to output_id logs, [[lvl, fmt, data], ...], lvl 0 for info, 1 for error + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + + /forms: + get: + operationId: GetForms + description: | + List the forms. A manager sees every form, others the forms published to + one of their groups. form_definition is form_yaml parsed. parameters: - $ref: '#/components/parameters/inQueryProps' - $ref: '#/components/parameters/inQueryLimit' @@ -2556,6 +2715,7 @@ paths: - $ref: '#/components/parameters/inQueryStats' - $ref: '#/components/parameters/inQueryOrderby' - $ref: '#/components/parameters/inQueryGroupby' + - $ref: '#/components/parameters/inQueryFilter' tags: - collector responses: @@ -2564,35 +2724,36 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ListResponse' + $ref: '#/components/schemas/FormListResponse' + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' 500: $ref: '#/components/responses/500' security: - basicAuth: [ ] - bearerAuth: [ ] - post: - operationId: PostGroups + operationId: PostForms description: | - Create or update a group. + Create forms, as the historical collector's POST /forms: one entry or a list. + form_name is mandatory, the other keys are forms columns (form_yaml, + form_type, form_folder...). The author and the creation date are set, and + the form is published to and made the responsibility of the creator's + default group. Requires the FormsManager privilege. requestBody: required: true content: application/json: schema: - type: object - properties: - id: - type: string - description: Existing group id (selects update instead of create) - role: - type: string - description: Group role/name - description: - type: string - privilege: - type: string - description: "'T' for a privilege group, 'F' otherwise" + oneOf: + - type: object + additionalProperties: true + - type: array + items: + type: object + additionalProperties: true tags: - collector responses: @@ -2601,36 +2762,37 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ListResponse' + type: object 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' + 409: + $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' security: - basicAuth: [ ] - bearerAuth: [ ] - delete: - operationId: DeleteGroups + operationId: DeleteForms description: | - Delete a group. + Delete forms: an entry with the 'id' key, or a list of them. Same + requirements as DELETE /forms/{form_id}. requestBody: required: true content: application/json: schema: - type: object - properties: - id: - type: string - description: Group record id - role: - type: string - description: Group role/name + oneOf: + - type: object + additionalProperties: true + - type: array + items: + type: object + additionalProperties: true tags: - collector responses: @@ -2640,34 +2802,33 @@ paths: application/json: schema: type: object - properties: - info: - type: string 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' 500: $ref: '#/components/responses/500' security: - basicAuth: [ ] - bearerAuth: [ ] - /groups/{group_id}: + /forms/{form_id}: get: - operationId: GetGroup + operationId: GetForm description: | - Display group properties. Managers can see all groups; other users only - see the groups they belong to. + Show a form, as GET /forms restricted to one id: empty when the form does + not exist or is not published to the caller. parameters: - in: path - name: group_id + name: form_id required: true - description: Group identifier (auth_group.id or role) + description: Form id schema: - type: string + type: integer - $ref: '#/components/parameters/inQueryProps' - $ref: '#/components/parameters/inQueryLimit' - $ref: '#/components/parameters/inQueryOffset' @@ -2675,6 +2836,7 @@ paths: - $ref: '#/components/parameters/inQueryStats' - $ref: '#/components/parameters/inQueryOrderby' - $ref: '#/components/parameters/inQueryGroupby' + - $ref: '#/components/parameters/inQueryFilter' tags: - collector responses: @@ -2683,39 +2845,36 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ListResponse' - 404: - $ref: '#/components/responses/404' + $ref: '#/components/schemas/FormListResponse' + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' 500: $ref: '#/components/responses/500' security: - basicAuth: [ ] - bearerAuth: [ ] post: - operationId: PostGroup + operationId: PostForm description: | - Modify a group's properties + Modify a form. The keys are forms columns; form_definition, a JSON document + or its string form, is stored as form_yaml. A new form_yaml is recorded in + the form's revision history. Requires the FormsManager privilege. parameters: - in: path - name: group_id + name: form_id required: true - description: Group identifier (auth_group.id or role) + description: Form id schema: - type: string + type: integer requestBody: required: true content: application/json: schema: - type: object - properties: - role: - type: string - description: - type: string - privilege: - type: string - description: "'T' for a privilege group, 'F' otherwise" + type: object + additionalProperties: true tags: - collector responses: @@ -2724,32 +2883,49 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ListResponse' + $ref: '#/components/schemas/FormListResponse' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' + 409: + $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' security: - basicAuth: [ ] - bearerAuth: [ ] - delete: - operationId: DeleteGroup + put: + operationId: PutForm description: | - Delete a group and cascade delete its membership, apps/forms/rulesets/modulesets - responsibilities and publications. Requires the GroupManager privilege. Managers - can delete any group; other users only the non-privilege groups they belong to. - The immutable 'Everybody' group cannot be deleted. + Submit a form: validate the data against the form inputs and run its + outputs (db, rest, script, mail, workflow). The body may also be + form-encoded, data given as its JSON string, as in the historical examples. The answer is the results + structure, also stored and readable with GET /form_output_results/{id}. A + negative id designates an internal form. The form must be published to the + caller, unless a manager. parameters: - in: path - name: group_id + name: form_id required: true - description: Group identifier (auth_group.id or role) + description: Form id schema: - type: string + type: integer + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + data: + description: The information the form expects, as an object, a list of objects or their JSON string form. + prev_wfid: + description: The previous step id in an existing workflow. tags: - collector responses: @@ -2765,32 +2941,25 @@ paths: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' 500: $ref: '#/components/responses/500' security: - basicAuth: [ ] - bearerAuth: [ ] - - /groups/{group_id}/apps: - get: - operationId: GetGroupApps + delete: + operationId: DeleteForm description: | - List the apps the group is responsible for. Managers can see all groups; - other users only see the groups they belong to. + Delete a form, with its publications and responsibles. Requires the + FormsManager privilege and responsibility for the form. parameters: - in: path - name: group_id + name: form_id required: true - description: Group identifier (auth_group.id or role) + description: Form id schema: - type: string - - $ref: '#/components/parameters/inQueryProps' - - $ref: '#/components/parameters/inQueryLimit' - - $ref: '#/components/parameters/inQueryOffset' - - $ref: '#/components/parameters/inQueryMeta' - - $ref: '#/components/parameters/inQueryStats' - - $ref: '#/components/parameters/inQueryOrderby' - - $ref: '#/components/parameters/inQueryGroupby' + type: integer tags: - collector responses: @@ -2799,33 +2968,34 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ListResponse' + type: object + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' 500: $ref: '#/components/responses/500' security: - basicAuth: [ ] - bearerAuth: [ ] - /groups/{group_id}/nodes: + /forms/{form_id}/am_i_responsible: get: - operationId: GetGroupNodes + operationId: GetFormAmIResponsible description: | - List the nodes the group is responsible for. Managers can see all groups; - other users only see the groups they belong to. + Tell whether the caller is responsible for the form, as {"data": true} or + {"data": false}. parameters: - in: path - name: group_id + name: form_id required: true - description: Group identifier (auth_group.id or role) + description: Form id schema: - type: string - - $ref: '#/components/parameters/inQueryProps' - - $ref: '#/components/parameters/inQueryLimit' - - $ref: '#/components/parameters/inQueryOffset' - - $ref: '#/components/parameters/inQueryMeta' - - $ref: '#/components/parameters/inQueryStats' - - $ref: '#/components/parameters/inQueryOrderby' - - $ref: '#/components/parameters/inQueryGroupby' + type: integer tags: - collector responses: @@ -2834,33 +3004,42 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ListResponse' + type: object + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' 500: $ref: '#/components/responses/500' security: - basicAuth: [ ] - bearerAuth: [ ] - /groups/{group_id}/services: + /forms/{form_id}/diff/{cid}: get: - operationId: GetGroupServices + operationId: GetFormDiff description: | - List the services the group is responsible for. Managers can see all - groups; other users only see the groups they belong to. + Show the change made by a revision, or the differences between cid and + other when set, as git prints them. parameters: - in: path - name: group_id + name: form_id required: true - description: Group identifier (auth_group.id or role) + description: Form id + schema: + type: integer + - in: path + name: cid + required: true + description: Git commit id of a form revision + schema: + type: string + - in: query + name: other + required: false + description: Another revision to compare cid with schema: type: string - - $ref: '#/components/parameters/inQueryProps' - - $ref: '#/components/parameters/inQueryLimit' - - $ref: '#/components/parameters/inQueryOffset' - - $ref: '#/components/parameters/inQueryMeta' - - $ref: '#/components/parameters/inQueryStats' - - $ref: '#/components/parameters/inQueryOrderby' - - $ref: '#/components/parameters/inQueryGroupby' tags: - collector responses: @@ -2869,26 +3048,30 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ListResponse' + type: object + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' 500: $ref: '#/components/responses/500' security: - basicAuth: [ ] - bearerAuth: [ ] - /groups/{group_id}/modulesets: + /forms/{form_id}/publications: get: - operationId: GetGroupModulesets + operationId: GetFormPublications description: | - List the modulesets published to the group. Restricted to the groups the - user belongs to. + List the groups the form is published to. Requires the form to be + published to the caller, unless a manager. parameters: - in: path - name: group_id + name: form_id required: true - description: Group identifier (auth_group.id or role) + description: Form id schema: - type: string + type: integer - $ref: '#/components/parameters/inQueryProps' - $ref: '#/components/parameters/inQueryLimit' - $ref: '#/components/parameters/inQueryOffset' @@ -2896,6 +3079,7 @@ paths: - $ref: '#/components/parameters/inQueryStats' - $ref: '#/components/parameters/inQueryOrderby' - $ref: '#/components/parameters/inQueryGroupby' + - $ref: '#/components/parameters/inQueryFilter' tags: - collector responses: @@ -2905,32 +3089,37 @@ paths: application/json: schema: $ref: '#/components/schemas/ListResponse' + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 404: + $ref: '#/components/responses/404' 500: $ref: '#/components/responses/500' security: - basicAuth: [ ] - bearerAuth: [ ] - /groups/{group_id}/rulesets: - get: - operationId: GetGroupRulesets + /forms/{form_id}/publications/{group_id}: + post: + operationId: PostFormPublication description: | - List the rulesets published to the group. Restricted to the groups the - user belongs to. + Publish the form to a group. Requires the FormsManager privilege and + responsibility for the form. An existing link answers with an info message. parameters: + - in: path + name: form_id + required: true + description: Form id + schema: + type: integer - in: path name: group_id required: true - description: Group identifier (auth_group.id or role) + description: Group id or role schema: type: string - - $ref: '#/components/parameters/inQueryProps' - - $ref: '#/components/parameters/inQueryLimit' - - $ref: '#/components/parameters/inQueryOffset' - - $ref: '#/components/parameters/inQueryMeta' - - $ref: '#/components/parameters/inQueryStats' - - $ref: '#/components/parameters/inQueryOrderby' - - $ref: '#/components/parameters/inQueryGroupby' tags: - collector responses: @@ -2939,34 +3128,38 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ListResponse' + type: object + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' 500: $ref: '#/components/responses/500' security: - basicAuth: [ ] - bearerAuth: [ ] - - /groups/{group_id}/users: - get: - operationId: GetGroupUsers + delete: + operationId: DeleteFormPublication description: | - List the users member of the group. Managers can see all groups; other - users only see the groups they belong to. The password and - registration_key columns are never exposed. + Unpublish the form from a group. Requires the FormsManager privilege + and responsibility for the form. A missing link answers with an info message. parameters: + - in: path + name: form_id + required: true + description: Form id + schema: + type: integer - in: path name: group_id required: true - description: Group identifier (auth_group.id or role) + description: Group id or role schema: type: string - - $ref: '#/components/parameters/inQueryProps' - - $ref: '#/components/parameters/inQueryLimit' - - $ref: '#/components/parameters/inQueryOffset' - - $ref: '#/components/parameters/inQueryMeta' - - $ref: '#/components/parameters/inQueryStats' - - $ref: '#/components/parameters/inQueryOrderby' - - $ref: '#/components/parameters/inQueryGroupby' tags: - collector responses: @@ -2975,26 +3168,34 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ListResponse' + type: object + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' 500: $ref: '#/components/responses/500' security: - basicAuth: [ ] - bearerAuth: [ ] - /groups/{group_id}/hidden_menu_entries: + /forms/{form_id}/responsibles: get: - operationId: GetGroupHiddenMenuEntries + operationId: GetFormResponsibles description: | - List the menu entries hidden from the menu for the group. Managers can - see all groups; other users only see the groups they belong to. + List the groups the form is the responsibility of. Requires the form to be + published to the caller, unless a manager. parameters: - in: path - name: group_id + name: form_id required: true - description: Group identifier (auth_group.id or role) + description: Form id schema: - type: string + type: integer - $ref: '#/components/parameters/inQueryProps' - $ref: '#/components/parameters/inQueryLimit' - $ref: '#/components/parameters/inQueryOffset' @@ -3002,6 +3203,7 @@ paths: - $ref: '#/components/parameters/inQueryStats' - $ref: '#/components/parameters/inQueryOrderby' - $ref: '#/components/parameters/inQueryGroupby' + - $ref: '#/components/parameters/inQueryFilter' tags: - collector responses: @@ -3013,35 +3215,35 @@ paths: $ref: '#/components/schemas/ListResponse' 400: $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 404: + $ref: '#/components/responses/404' 500: $ref: '#/components/responses/500' security: - basicAuth: [ ] - bearerAuth: [ ] + + /forms/{form_id}/responsibles/{group_id}: post: - operationId: PostGroupHiddenMenuEntries + operationId: PostFormResponsible description: | - Hide a menu entry for the group. The user must hold the GroupManager - privilege. The action is logged and a change notification is emitted. + Make a group responsible for the form. Requires the FormsManager privilege and + responsibility for the form. An existing link answers with an info message. parameters: + - in: path + name: form_id + required: true + description: Form id + schema: + type: integer - in: path name: group_id required: true - description: Group identifier (auth_group.id or role) + description: Group id or role schema: type: string - requestBody: - required: true - content: - application/json: - schema: - type: object - required: - - menu_entry - properties: - menu_entry: - type: string - description: Menu entry key to hide tags: - collector responses: @@ -3051,44 +3253,37 @@ paths: application/json: schema: type: object - properties: - info: - type: string 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' 500: $ref: '#/components/responses/500' security: - basicAuth: [ ] - bearerAuth: [ ] delete: - operationId: DeleteGroupHiddenMenuEntries + operationId: DeleteFormResponsible description: | - Unhide a menu entry for the group. The user must hold the GroupManager - privilege. The action is logged and a change notification is emitted. + Remove a responsible group from the form. Requires the FormsManager privilege + and responsibility for the form. A missing link answers with an info message. parameters: + - in: path + name: form_id + required: true + description: Form id + schema: + type: integer - in: path name: group_id required: true - description: Group identifier (auth_group.id or role) + description: Group id or role schema: type: string - requestBody: - required: true - content: - application/json: - schema: - type: object - required: - - menu_entry - properties: - menu_entry: - type: string - description: Menu entry key to unhide tags: - collector responses: @@ -3098,35 +3293,33 @@ paths: application/json: schema: type: object - properties: - info: - type: string 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' 500: $ref: '#/components/responses/500' security: - basicAuth: [ ] - bearerAuth: [ ] - /frontend/hidden_menu_entries: + /forms/{form_id}/revisions: get: - operationId: GetFrontendHiddenMenuEntries + operationId: GetFormRevisions description: | - List the menu entries hidden from the menu for every group. Managers - see all groups; other users only see the groups they belong to. + List the revisions of the form definition, from its git history: an empty + list when the form is not published to the caller. parameters: - - $ref: '#/components/parameters/inQueryProps' - - $ref: '#/components/parameters/inQueryLimit' - - $ref: '#/components/parameters/inQueryOffset' - - $ref: '#/components/parameters/inQueryMeta' - - $ref: '#/components/parameters/inQueryStats' - - $ref: '#/components/parameters/inQueryOrderby' - - $ref: '#/components/parameters/inQueryGroupby' + - in: path + name: form_id + required: true + description: Form id + schema: + type: integer tags: - collector responses: @@ -3135,29 +3328,35 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ListResponse' + type: object 400: $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' 500: $ref: '#/components/responses/500' security: - basicAuth: [ ] - bearerAuth: [ ] - /ips: + /forms/{form_id}/revisions/{cid}: get: - operationId: GetIps + operationId: GetFormRevision description: | - List ips detected on nodes. Managers see all ips; other users only see - ips of nodes whose app they are responsible for. + Show the form definition at a revision, as {"data": {"oid", "content"}}. parameters: - - $ref: '#/components/parameters/inQueryProps' - - $ref: '#/components/parameters/inQueryLimit' - - $ref: '#/components/parameters/inQueryOffset' - - $ref: '#/components/parameters/inQueryMeta' - - $ref: '#/components/parameters/inQueryStats' - - $ref: '#/components/parameters/inQueryOrderby' - - $ref: '#/components/parameters/inQueryGroupby' + - in: path + name: form_id + required: true + description: Form id + schema: + type: integer + - in: path + name: cid + required: true + description: Git commit id of a form revision + schema: + type: string tags: - collector responses: @@ -3166,29 +3365,36 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ListResponse' + type: object + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' 500: $ref: '#/components/responses/500' security: - basicAuth: [ ] - bearerAuth: [ ] - delete: - operationId: DeleteIps + + /forms/{form_id}/rollback/{cid}: + post: + operationId: PostFormRollback description: | - Delete a node ip (bulk form). The 'id' key is mandatory in the body and - selects the target ip; the deletion is then handled as DELETE /ips/{id}. - requestBody: - required: true - content: - application/json: - schema: - type: object - required: - - id - properties: - id: - type: string - description: Ip identifier (node_ip.id) + Restore the form definition of a revision, recorded as a new revision. + Requires the FormsManager privilege and responsibility for the form. + parameters: + - in: path + name: form_id + required: true + description: Form id + schema: + type: integer + - in: path + name: cid + required: true + description: Git commit id of a form revision + schema: + type: string tags: - collector responses: @@ -3198,9 +3404,6 @@ paths: application/json: schema: type: object - properties: - info: - type: string 400: $ref: '#/components/responses/400' 401: @@ -3215,26 +3418,24 @@ paths: - basicAuth: [ ] - bearerAuth: [ ] - /ips/{id}: - get: - operationId: GetIp + /forms_publications: + post: + operationId: PostFormsPublications description: | - Display a node ip properties. The identifier can be either the numeric - ip id or the ip address. - parameters: - - in: path - name: id - required: true - description: Ip identifier (v_nodenetworks.id) or ip address - schema: - type: string - - $ref: '#/components/parameters/inQueryProps' - - $ref: '#/components/parameters/inQueryLimit' - - $ref: '#/components/parameters/inQueryOffset' - - $ref: '#/components/parameters/inQueryMeta' - - $ref: '#/components/parameters/inQueryStats' - - $ref: '#/components/parameters/inQueryOrderby' - - $ref: '#/components/parameters/inQueryGroupby' + Same as POST /forms/{form_id}/publications/{group_id}, the form_id and + group_id keys given in the body: one entry or a list. + requestBody: + required: true + content: + application/json: + schema: + oneOf: + - type: object + additionalProperties: true + - type: array + items: + type: object + additionalProperties: true tags: - collector responses: @@ -3243,7 +3444,13 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ListResponse' + type: object + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 500: @@ -3252,18 +3459,22 @@ paths: - basicAuth: [ ] - bearerAuth: [ ] delete: - operationId: DeleteIp + operationId: DeleteFormsPublications description: | - Delete a node ip. The user must hold the NodeManager privilege and be - responsible for the node the ip belongs to. The action is logged and a - change notification is emitted. - parameters: - - in: path - name: id - required: true - description: Ip identifier (node_ip.id) - schema: - type: string + Same as DELETE /forms/{form_id}/publications/{group_id}, the form_id and + group_id keys given in the body: one entry or a list. + requestBody: + required: true + content: + application/json: + schema: + oneOf: + - type: object + additionalProperties: true + - type: array + items: + type: object + additionalProperties: true tags: - collector responses: @@ -3273,9 +3484,8 @@ paths: application/json: schema: type: object - properties: - info: - type: string + 400: + $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: @@ -3288,31 +3498,24 @@ paths: - basicAuth: [ ] - bearerAuth: [ ] - /logs: + /forms_responsibles: post: - operationId: PostLogs + operationId: PostFormsResponsibles description: | - Create a log event. The entry type is forced to 'message', the default - level is 'info', and empty log events are discarded. + Same as POST /forms/{form_id}/responsibles/{group_id}, the form_id and + group_id keys given in the body: one entry or a list. requestBody: required: true content: application/json: schema: - type: object - required: - - log_fmt - properties: - log_fmt: - type: string - log_level: - type: string - log_dict: - type: object - node_id: - type: string - svc_id: - type: string + oneOf: + - type: object + additionalProperties: true + - type: array + items: + type: object + additionalProperties: true tags: - collector responses: @@ -3321,26 +3524,103 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ListResponse' + type: object + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + delete: + operationId: DeleteFormsResponsibles + description: | + Same as DELETE /forms/{form_id}/responsibles/{group_id}, the form_id and + group_id keys given in the body: one entry or a list. + requestBody: + required: true + content: + application/json: + schema: + oneOf: + - type: object + additionalProperties: true + - type: array + items: + type: object + additionalProperties: true + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + type: object 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' 500: $ref: '#/components/responses/500' security: - basicAuth: [ ] - bearerAuth: [ ] + + /forms_revisions: get: - operationId: GetLogs - description: List events in the collector log + operationId: GetFormsRevisions + description: | + List the form revisions stored for workflows. parameters: - - in: query - name: fset_id - required: false - description: Restrict to log events matching this filterset (gen_filtersets.id or fset_name) + - $ref: '#/components/parameters/inQueryProps' + - $ref: '#/components/parameters/inQueryLimit' + - $ref: '#/components/parameters/inQueryOffset' + - $ref: '#/components/parameters/inQueryMeta' + - $ref: '#/components/parameters/inQueryStats' + - $ref: '#/components/parameters/inQueryOrderby' + - $ref: '#/components/parameters/inQueryGroupby' + - $ref: '#/components/parameters/inQueryFilter' + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ListResponse' + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + + /forms_revisions/{revision_id}: + get: + operationId: GetFormsRevision + description: | + Show a form revision, by id or by md5. + parameters: + - in: path + name: revision_id + required: true + description: Revision id or md5 schema: type: string - $ref: '#/components/parameters/inQueryProps' @@ -3350,6 +3630,7 @@ paths: - $ref: '#/components/parameters/inQueryStats' - $ref: '#/components/parameters/inQueryOrderby' - $ref: '#/components/parameters/inQueryGroupby' + - $ref: '#/components/parameters/inQueryFilter' tags: - collector responses: @@ -3359,23 +3640,62 @@ paths: application/json: schema: $ref: '#/components/schemas/ListResponse' + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' 500: $ref: '#/components/responses/500' security: - basicAuth: [ ] - bearerAuth: [ ] - /logs/{log_id}: + /forms_store: get: - operationId: GetLog - description: Display a collector log event properties + operationId: GetFormsStore + description: | + List the forms stored by workflows, with the revision they were submitted + with. + parameters: + - $ref: '#/components/parameters/inQueryProps' + - $ref: '#/components/parameters/inQueryLimit' + - $ref: '#/components/parameters/inQueryOffset' + - $ref: '#/components/parameters/inQueryMeta' + - $ref: '#/components/parameters/inQueryStats' + - $ref: '#/components/parameters/inQueryOrderby' + - $ref: '#/components/parameters/inQueryGroupby' + - $ref: '#/components/parameters/inQueryFilter' + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ListResponse' + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + + /forms_store/{store_id}: + get: + operationId: GetFormStore + description: | + Show a form stored by a workflow. parameters: - in: path - name: log_id + name: store_id required: true - description: Log event identifier (log.id) + description: Stored form id schema: - type: string + type: integer - $ref: '#/components/parameters/inQueryProps' - $ref: '#/components/parameters/inQueryLimit' - $ref: '#/components/parameters/inQueryOffset' @@ -3383,6 +3703,7 @@ paths: - $ref: '#/components/parameters/inQueryStats' - $ref: '#/components/parameters/inQueryOrderby' - $ref: '#/components/parameters/inQueryGroupby' + - $ref: '#/components/parameters/inQueryFilter' tags: - collector responses: @@ -3392,6 +3713,42 @@ paths: application/json: schema: $ref: '#/components/schemas/ListResponse' + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + + /forms_store/{store_id}/dump: + get: + operationId: GetFormStoreDump + description: | + Show a form stored by a workflow, with its workflow, the workflow head and + tail stored forms. + parameters: + - in: path + name: store_id + required: true + description: Stored form id + schema: + type: integer + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' 404: $ref: '#/components/responses/404' 500: @@ -3400,10 +3757,40 @@ paths: - basicAuth: [ ] - bearerAuth: [ ] - /nodes: + /groups: + get: + operationId: GetGroups + description: | + List existing groups. Managers can see all groups; other users only see + the groups they belong to. + parameters: + - $ref: '#/components/parameters/inQueryProps' + - $ref: '#/components/parameters/inQueryLimit' + - $ref: '#/components/parameters/inQueryOffset' + - $ref: '#/components/parameters/inQueryMeta' + - $ref: '#/components/parameters/inQueryStats' + - $ref: '#/components/parameters/inQueryOrderby' + - $ref: '#/components/parameters/inQueryGroupby' + - $ref: '#/components/parameters/inQueryFilter' + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/GroupListResponse' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + post: - operationId: PostNodes - description: Create or update a node (by nodename or node_id) + operationId: PostGroups + description: | + Create or update a group. requestBody: required: true content: @@ -3411,155 +3798,17 @@ paths: schema: type: object properties: - nodename: + id: type: string - node_id: + description: Existing group id (selects update instead of create) + role: type: string - team_responsible: + description: Group role/name + description: type: string - app: - type: string - cluster_id: - type: string - warranty_end: - type: string - maintenance_end: - type: string - status: - type: string - role: - type: string - listener_port: - type: integer - version: - type: string - collector: - type: string - connect_to: - type: string - tz: - type: string - asset_env: - type: string - type: - type: string - fqdn: - type: string - manufacturer: - type: string - loc_addr: - type: string - loc_city: - type: string - loc_zip: - type: string - loc_rack: - type: string - loc_floor: - type: string - loc_country: - type: string - loc_building: - type: string - loc_room: - type: string - power_supply_nb: - type: integer - power_cabinet1: - type: string - power_cabinet2: - type: string - power_protect: - type: string - power_protect_breaker: - type: string - power_breaker1: - type: string - power_breaker2: - type: string - enclosure: - type: string - enclosureslot: - type: string - assetname: - type: string - sec_zone: - type: string - action_type: - type: string - enum: [push, pull] - hvpool: - type: string - hvvdc: - type: string - hv: - type: string - hw_obs_warn_date: - type: string - hw_obs_alert_date: - type: string - os_obs_warn_date: - type: string - os_obs_alert_date: - type: string - notifications: - type: boolean - snooze_till: - type: string - node_frozen: - type: boolean - node_frozen_at: - type: string - bios_version: - type: string - cpu_cores: - type: integer - cpu_dies: - type: integer - cpu_freq: - type: string - cpu_model: - type: string - cpu_threads: - type: integer - cpu_vendor: - type: string - last_boot: - type: string - last_comm: - type: string - mem_banks: - type: integer - mem_bytes: - type: integer - mem_slots: - type: integer - model: - type: string - node_env: - type: string - os_arch: - type: string - os_concat: - type: string - os_kernel: - type: string - os_name: - type: string - os_release: - type: string - os_vendor: - type: string - serial: - type: string - sp_version: - type: string - team_integ: - type: string - team_support: - type: string - updated: + privilege: type: string + description: "'T' for a privilege group, 'F' otherwise" tags: - collector responses: @@ -3568,7 +3817,7 @@ paths: content: application/json: schema: - type: object + $ref: '#/components/schemas/GroupListResponse' 400: $ref: '#/components/responses/400' 401: @@ -3581,49 +3830,23 @@ paths: - basicAuth: [ ] - bearerAuth: [ ] - get: - operationId: GetNodes - description: List nodes - parameters: - - $ref: '#/components/parameters/inQueryProps' - - $ref: '#/components/parameters/inQueryLimit' - - $ref: '#/components/parameters/inQueryOffset' - - $ref: '#/components/parameters/inQueryMeta' - - $ref: '#/components/parameters/inQueryStats' - - $ref: '#/components/parameters/inQueryOrderby' - - $ref: '#/components/parameters/inQueryGroupby' - tags: - - collector - responses: - 200: - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/ListResponse' - 500: - $ref: '#/components/responses/500' - security: - - basicAuth: [ ] - - bearerAuth: [ ] delete: - operationId: DeleteNodes + operationId: DeleteGroups description: | - Delete a node (bulk form). The 'node_id' key is mandatory in the body - and selects the target node; the deletion is then handled as DELETE - /nodes/{node_id} (cascade delete + audit log + change notification). + Delete a group. requestBody: required: true content: application/json: schema: type: object - required: - - node_id properties: - node_id: + id: type: string - description: Node identifier (node_id or nodename) + description: Group record id + role: + type: string + description: Group role/name tags: - collector responses: @@ -3632,7 +3855,7 @@ paths: content: application/json: schema: - type: object + $ref: '#/components/schemas/InfoResponse' properties: info: type: string @@ -3642,46 +3865,25 @@ paths: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' - 404: - $ref: '#/components/responses/404' - 500: - $ref: '#/components/responses/500' - security: - - basicAuth: [ ] - - bearerAuth: [ ] - - /nodes/hardware: - get: - operationId: GetNodesHardware - description: List all nodes PCI and memory hardware - parameters: - - $ref: '#/components/parameters/inQueryProps' - - $ref: '#/components/parameters/inQueryLimit' - - $ref: '#/components/parameters/inQueryOffset' - - $ref: '#/components/parameters/inQueryMeta' - - $ref: '#/components/parameters/inQueryStats' - - $ref: '#/components/parameters/inQueryOrderby' - - $ref: '#/components/parameters/inQueryGroupby' - tags: - - collector - responses: - 200: - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/ListResponse' 500: $ref: '#/components/responses/500' security: - basicAuth: [ ] - bearerAuth: [ ] - /nodes/hbas: + /groups/{group_id}: get: - operationId: GetNodesHbas - description: List all nodes FC and iSCSI host bus adapters + operationId: GetGroup + description: | + Display group properties. Managers can see all groups; other users only + see the groups they belong to. parameters: + - in: path + name: group_id + required: true + description: Group identifier (auth_group.id or role) + schema: + type: string - $ref: '#/components/parameters/inQueryProps' - $ref: '#/components/parameters/inQueryLimit' - $ref: '#/components/parameters/inQueryOffset' @@ -3697,22 +3899,23 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ListResponse' + $ref: '#/components/schemas/GroupListResponse' + 404: + $ref: '#/components/responses/404' 500: $ref: '#/components/responses/500' security: - basicAuth: [ ] - bearerAuth: [ ] - - /nodes/{node_id}: post: - operationId: PostNode - description: Update a node properties + operationId: PostGroup + description: | + Modify a group's properties parameters: - in: path - name: node_id + name: group_id required: true - description: Node identifier (node_id UUID or nodename) + description: Group identifier (auth_group.id or role) schema: type: string requestBody: @@ -3722,153 +3925,13 @@ paths: schema: type: object properties: - nodename: - type: string - team_responsible: - type: string - app: - type: string - cluster_id: - type: string - warranty_end: - type: string - maintenance_end: + role: type: string - status: + description: type: string - role: - type: string - listener_port: - type: integer - version: - type: string - collector: - type: string - connect_to: - type: string - tz: - type: string - asset_env: - type: string - type: - type: string - fqdn: - type: string - manufacturer: - type: string - loc_addr: - type: string - loc_city: - type: string - loc_zip: - type: string - loc_rack: - type: string - loc_floor: - type: string - loc_country: - type: string - loc_building: - type: string - loc_room: - type: string - power_supply_nb: - type: integer - power_cabinet1: - type: string - power_cabinet2: - type: string - power_protect: - type: string - power_protect_breaker: - type: string - power_breaker1: - type: string - power_breaker2: - type: string - enclosure: - type: string - enclosureslot: - type: string - assetname: - type: string - sec_zone: - type: string - action_type: - type: string - enum: [push, pull] - hvpool: - type: string - hvvdc: - type: string - hv: - type: string - hw_obs_warn_date: - type: string - hw_obs_alert_date: - type: string - os_obs_warn_date: - type: string - os_obs_alert_date: - type: string - notifications: - type: boolean - snooze_till: - type: string - node_frozen: - type: boolean - node_frozen_at: - type: string - bios_version: - type: string - cpu_cores: - type: integer - cpu_dies: - type: integer - cpu_freq: - type: string - cpu_model: - type: string - cpu_threads: - type: integer - cpu_vendor: - type: string - last_boot: - type: string - last_comm: - type: string - mem_banks: - type: integer - mem_bytes: - type: integer - mem_slots: - type: integer - model: - type: string - node_env: - type: string - os_arch: - type: string - os_concat: - type: string - os_kernel: - type: string - os_name: - type: string - os_release: - type: string - os_vendor: - type: string - serial: - type: string - sp_version: - type: string - team_integ: - type: string - team_support: - type: string - updated: + privilege: type: string + description: "'T' for a privilege group, 'F' otherwise" tags: - collector responses: @@ -3877,38 +3940,32 @@ paths: content: application/json: schema: - type: object + $ref: '#/components/schemas/GroupListResponse' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' - 404: - $ref: '#/components/responses/404' 500: $ref: '#/components/responses/500' security: - basicAuth: [ ] - bearerAuth: [ ] - - get: - operationId: GetNode - description: List entries for a specific node + delete: + operationId: DeleteGroup + description: | + Delete a group and cascade delete its membership, apps/forms/rulesets/modulesets + responsibilities and publications. Requires the GroupManager privilege. Managers + can delete any group; other users only the non-privilege groups they belong to. + The immutable 'Everybody' group cannot be deleted. parameters: - in: path - name: node_id + name: group_id required: true - description: Node identifier (node_id UUID or nodename) + description: Group identifier (auth_group.id or role) schema: type: string - - $ref: '#/components/parameters/inQueryProps' - - $ref: '#/components/parameters/inQueryLimit' - - $ref: '#/components/parameters/inQueryOffset' - - $ref: '#/components/parameters/inQueryMeta' - - $ref: '#/components/parameters/inQueryStats' - - $ref: '#/components/parameters/inQueryOrderby' - - $ref: '#/components/parameters/inQueryGroupby' tags: - collector responses: @@ -3917,25 +3974,39 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ListResponse' - 404: - $ref: '#/components/responses/404' + $ref: '#/components/schemas/InfoResponse' + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' 500: $ref: '#/components/responses/500' security: - basicAuth: [ ] - bearerAuth: [ ] - delete: - operationId: DeleteNode - description: Delete an OpenSVC node and cascade delete its related entries. + /groups/{group_id}/apps: + get: + operationId: GetGroupApps + description: | + List the apps the group is responsible for. Managers can see all groups; + other users only see the groups they belong to. parameters: - in: path - name: node_id + name: group_id required: true - description: Node identifier (node_id UUID or nodename) + description: Group identifier (auth_group.id or role) schema: type: string + - $ref: '#/components/parameters/inQueryProps' + - $ref: '#/components/parameters/inQueryLimit' + - $ref: '#/components/parameters/inQueryOffset' + - $ref: '#/components/parameters/inQueryMeta' + - $ref: '#/components/parameters/inQueryStats' + - $ref: '#/components/parameters/inQueryOrderby' + - $ref: '#/components/parameters/inQueryGroupby' tags: - collector responses: @@ -3944,28 +4015,24 @@ paths: content: application/json: schema: - type: object - 401: - $ref: '#/components/responses/401' - 403: - $ref: '#/components/responses/403' - 404: - $ref: '#/components/responses/404' + $ref: '#/components/schemas/ListResponse' 500: $ref: '#/components/responses/500' security: - basicAuth: [ ] - bearerAuth: [ ] - /nodes/{node_id}/alerts: + /groups/{group_id}/nodes: get: - operationId: GetNodeAlerts - description: List a node alerts + operationId: GetGroupNodes + description: | + List the nodes the group is responsible for. Managers can see all groups; + other users only see the groups they belong to. parameters: - in: path - name: node_id + name: group_id required: true - description: Node identifier (node_id UUID or nodename) + description: Group identifier (auth_group.id or role) schema: type: string - $ref: '#/components/parameters/inQueryProps' @@ -3984,23 +4051,23 @@ paths: application/json: schema: $ref: '#/components/schemas/ListResponse' - 404: - $ref: '#/components/responses/404' 500: $ref: '#/components/responses/500' security: - basicAuth: [ ] - bearerAuth: [ ] - /nodes/{node_id}/checks: + /groups/{group_id}/services: get: - operationId: GetNodeChecks - description: List a node checks + operationId: GetGroupServices + description: | + List the services the group is responsible for. Managers can see all + groups; other users only see the groups they belong to. parameters: - in: path - name: node_id + name: group_id required: true - description: Node identifier (node_id UUID or nodename) + description: Group identifier (auth_group.id or role) schema: type: string - $ref: '#/components/parameters/inQueryProps' @@ -4019,23 +4086,23 @@ paths: application/json: schema: $ref: '#/components/schemas/ListResponse' - 404: - $ref: '#/components/responses/404' 500: $ref: '#/components/responses/500' security: - basicAuth: [ ] - bearerAuth: [ ] - /nodes/{node_id}/candidate_tags: + /groups/{group_id}/modulesets: get: - operationId: GetNodeCandidateTags - description: List tags attachable to a node (not yet attached and not excluded) + operationId: GetGroupModulesets + description: | + List the modulesets published to the group. Restricted to the groups the + user belongs to. parameters: - in: path - name: node_id + name: group_id required: true - description: Node identifier (node_id UUID or nodename) + description: Group identifier (auth_group.id or role) schema: type: string - $ref: '#/components/parameters/inQueryProps' @@ -4054,21 +4121,25 @@ paths: application/json: schema: $ref: '#/components/schemas/ListResponse' - 404: - $ref: '#/components/responses/404' 500: $ref: '#/components/responses/500' security: - basicAuth: [ ] - bearerAuth: [ ] - /nodes/{node_id}/compliance/candidate_modulesets: + /groups/{group_id}/rulesets: get: + operationId: GetGroupRulesets description: | - Get candidate modulesets for a node - operationId: GetNodeComplianceCandidateModulesets + List the rulesets published to the group. Restricted to the groups the + user belongs to. parameters: - - $ref: '#/components/parameters/inPathNodeId' + - in: path + name: group_id + required: true + description: Group identifier (auth_group.id or role) + schema: + type: string - $ref: '#/components/parameters/inQueryProps' - $ref: '#/components/parameters/inQueryLimit' - $ref: '#/components/parameters/inQueryOffset' @@ -4076,30 +4147,35 @@ paths: - $ref: '#/components/parameters/inQueryStats' - $ref: '#/components/parameters/inQueryOrderby' - $ref: '#/components/parameters/inQueryGroupby' + tags: + - collector responses: 200: - description: List of candidate modulesets + description: OK content: application/json: schema: $ref: '#/components/schemas/ListResponse' - 404: - description: Node not found 500: - description: Internal server error + $ref: '#/components/responses/500' security: - basicAuth: [ ] - bearerAuth: [ ] - tags: - - collector - /nodes/{node_id}/compliance/candidate_rulesets: + /groups/{group_id}/users: get: + operationId: GetGroupUsers description: | - Get candidate rulesets for a node - operationId: GetNodeComplianceCandidateRulesets + List the users member of the group. Managers can see all groups; other + users only see the groups they belong to. The password and + registration_key columns are never exposed. parameters: - - $ref: '#/components/parameters/inPathNodeId' + - in: path + name: group_id + required: true + description: Group identifier (auth_group.id or role) + schema: + type: string - $ref: '#/components/parameters/inQueryProps' - $ref: '#/components/parameters/inQueryLimit' - $ref: '#/components/parameters/inQueryOffset' @@ -4107,61 +4183,34 @@ paths: - $ref: '#/components/parameters/inQueryStats' - $ref: '#/components/parameters/inQueryOrderby' - $ref: '#/components/parameters/inQueryGroupby' - responses: - 200: - description: List of candidate rulesets - content: - application/json: - schema: - $ref: '#/components/schemas/ListResponse' - 404: - description: Node not found - 500: - description: Internal server error - security: - - basicAuth: [ ] - - bearerAuth: [ ] tags: - collector - - /nodes/{node_id}/compliance/logs: - get: - description: | - Get compliance logs for a node - operationId: GetNodeComplianceLogs - parameters: - - $ref: '#/components/parameters/inPathNodeId' - - $ref: '#/components/parameters/inQueryProps' - - $ref: '#/components/parameters/inQueryLimit' - - $ref: '#/components/parameters/inQueryOffset' - - $ref: '#/components/parameters/inQueryMeta' - - $ref: '#/components/parameters/inQueryStats' - - $ref: '#/components/parameters/inQueryOrderby' - - $ref: '#/components/parameters/inQueryGroupby' responses: 200: - description: Compliance logs for the node + description: OK content: application/json: schema: $ref: '#/components/schemas/ListResponse' - 404: - $ref: '#/components/responses/404' 500: $ref: '#/components/responses/500' security: - basicAuth: [ ] - bearerAuth: [ ] - tags: - - collector - /nodes/{node_id}/compliance/modulesets: + /groups/{group_id}/hidden_menu_entries: get: + operationId: GetGroupHiddenMenuEntries description: | - Get modulesets attached to a node - operationId: GetNodeComplianceModulesets + List the menu entries hidden from the menu for the group. Managers can + see all groups; other users only see the groups they belong to. parameters: - - $ref: '#/components/parameters/inPathNodeId' + - in: path + name: group_id + required: true + description: Group identifier (auth_group.id or role) + schema: + type: string - $ref: '#/components/parameters/inQueryProps' - $ref: '#/components/parameters/inQueryLimit' - $ref: '#/components/parameters/inQueryOffset' @@ -4169,59 +4218,58 @@ paths: - $ref: '#/components/parameters/inQueryStats' - $ref: '#/components/parameters/inQueryOrderby' - $ref: '#/components/parameters/inQueryGroupby' + tags: + - collector responses: 200: - description: List of attached modulesets + description: OK content: application/json: schema: $ref: '#/components/schemas/ListResponse' - 404: - description: Node not found - 500: - description: Internal server error - security: - - basicAuth: [ ] - - bearerAuth: [ ] - tags: - - collector - - /nodes/{node_id}/compliance/modulesets/{mset_id}: - delete: - description: | - Detach a moduleset from a node - operationId: DeleteNodeComplianceModuleset - parameters: - - $ref: '#/components/parameters/inPathNodeId' - - $ref: '#/components/parameters/inPathMsetId' - responses: - 204: - description: Moduleset successfully detached - 404: - description: Node or moduleset not found + 400: + $ref: '#/components/responses/400' 500: - description: Internal server error + $ref: '#/components/responses/500' security: - basicAuth: [ ] - bearerAuth: [ ] - tags: - - collector post: + operationId: PostGroupHiddenMenuEntries description: | - Attach a moduleset to a node - operationId: PostNodeComplianceModuleset + Hide a menu entry for the group. The user must hold the GroupManager + privilege. The action is logged and a change notification is emitted. parameters: - - $ref: '#/components/parameters/inPathNodeId' - - $ref: '#/components/parameters/inPathMsetId' + - in: path + name: group_id + required: true + description: Group identifier (auth_group.id or role) + schema: + type: string requestBody: required: true content: application/json: schema: type: object + required: + - menu_entry + properties: + menu_entry: + type: string + description: Menu entry key to hide + tags: + - collector responses: - 202: - description: Moduleset attached + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + info: + type: string 400: $ref: '#/components/responses/400' 401: @@ -4233,76 +4281,42 @@ paths: security: - basicAuth: [ ] - bearerAuth: [ ] - tags: - - collector - - /nodes/{node_id}/compliance/rulesets: - get: - description: | - Get rulesets attached to a node - operationId: GetNodeComplianceRulesets - parameters: - - $ref: '#/components/parameters/inPathNodeId' - - $ref: '#/components/parameters/inQueryProps' - - $ref: '#/components/parameters/inQueryLimit' - - $ref: '#/components/parameters/inQueryOffset' - - $ref: '#/components/parameters/inQueryMeta' - - $ref: '#/components/parameters/inQueryStats' - - $ref: '#/components/parameters/inQueryOrderby' - - $ref: '#/components/parameters/inQueryGroupby' - responses: - 200: - description: List of attached rulesets - content: - application/json: - schema: - $ref: '#/components/schemas/ListResponse' - 404: - description: Node not found - 500: - description: Internal server error - security: - - basicAuth: [ ] - - bearerAuth: [ ] - tags: - - collector - - /nodes/{node_id}/compliance/rulesets/{rset_id}: delete: + operationId: DeleteGroupHiddenMenuEntries description: | - Detach a ruleset from a node - operationId: DeleteNodeComplianceRuleset - parameters: - - $ref: '#/components/parameters/inPathNodeId' - - $ref: '#/components/parameters/inPathRsetId' - responses: - 204: - description: Ruleset successfully detached - 404: - description: Node or ruleset not found - 500: - description: Internal server error - security: - - basicAuth: [ ] - - bearerAuth: [ ] - tags: - - collector - post: - description: | - Attach a ruleset to a node - operationId: PostNodeComplianceRuleset + Unhide a menu entry for the group. The user must hold the GroupManager + privilege. The action is logged and a change notification is emitted. parameters: - - $ref: '#/components/parameters/inPathNodeId' - - $ref: '#/components/parameters/inPathRsetId' + - in: path + name: group_id + required: true + description: Group identifier (auth_group.id or role) + schema: + type: string requestBody: required: true content: application/json: schema: type: object + required: + - menu_entry + properties: + menu_entry: + type: string + description: Menu entry key to unhide + tags: + - collector responses: - 202: - description: Ruleset attached + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + info: + type: string 400: $ref: '#/components/responses/400' 401: @@ -4314,16 +4328,14 @@ paths: security: - basicAuth: [ ] - bearerAuth: [ ] - tags: - - collector - /nodes/{node_id}/compliance/status: + /frontend/hidden_menu_entries: get: + operationId: GetFrontendHiddenMenuEntries description: | - List compliance modules last check run status for a node - operationId: GetNodeComplianceStatus + List the menu entries hidden from the menu for every group. Managers + see all groups; other users only see the groups they belong to. parameters: - - $ref: '#/components/parameters/inPathNodeId' - $ref: '#/components/parameters/inQueryProps' - $ref: '#/components/parameters/inQueryLimit' - $ref: '#/components/parameters/inQueryOffset' @@ -4331,40 +4343,37 @@ paths: - $ref: '#/components/parameters/inQueryStats' - $ref: '#/components/parameters/inQueryOrderby' - $ref: '#/components/parameters/inQueryGroupby' + tags: + - collector responses: 200: - description: Compliance status entries for the node + description: OK content: application/json: schema: $ref: '#/components/schemas/ListResponse' - 404: - description: Node not found + 400: + $ref: '#/components/responses/400' 500: - description: Internal server error + $ref: '#/components/responses/500' security: - basicAuth: [ ] - bearerAuth: [ ] - tags: - - collector - /nodes/{node_id}/disks: + /ips: get: - operationId: GetNodeDisks - description: List disks of a specific node + operationId: GetIps + description: | + List ips detected on nodes. Managers see all ips; other users only see + ips of nodes whose app they are responsible for. parameters: - - in: path - name: node_id - required: true - description: Node identifier (node_id UUID or nodename) - schema: - type: string - $ref: '#/components/parameters/inQueryProps' - $ref: '#/components/parameters/inQueryLimit' - $ref: '#/components/parameters/inQueryOffset' - $ref: '#/components/parameters/inQueryMeta' - $ref: '#/components/parameters/inQueryStats' - $ref: '#/components/parameters/inQueryOrderby' + - $ref: '#/components/parameters/inQueryFilter' - $ref: '#/components/parameters/inQueryGroupby' tags: - collector @@ -4374,7 +4383,47 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ListResponse' + $ref: '#/components/schemas/IpListResponse' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + delete: + operationId: DeleteIps + description: | + Delete a node ip (bulk form). The 'id' key is mandatory in the body and + selects the target ip; the deletion is then handled as DELETE /ips/{id}. + requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - id + properties: + id: + type: string + description: Ip identifier (node_ip.id) + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + info: + type: string + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 500: @@ -4383,15 +4432,17 @@ paths: - basicAuth: [ ] - bearerAuth: [ ] - /nodes/{node_id}/hbas: + /ips/{id}: get: - operationId: GetNodeHbas - description: List a node storage host bus adapters + operationId: GetIp + description: | + Display a node ip properties. The identifier can be either the numeric + ip id or the ip address. parameters: - in: path - name: node_id + name: id required: true - description: Node identifier (node_id UUID or nodename) + description: Ip identifier (v_nodenetworks.id) or ip address schema: type: string - $ref: '#/components/parameters/inQueryProps' @@ -4409,7 +4460,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ListResponse' + $ref: '#/components/schemas/IpListResponse' 404: $ref: '#/components/responses/404' 500: @@ -4417,25 +4468,19 @@ paths: security: - basicAuth: [ ] - bearerAuth: [ ] - - /nodes/{node_id}/hardware: - get: - operationId: GetNodeHardware - description: List a node PCI and memory hardware + delete: + operationId: DeleteIp + description: | + Delete a node ip. The user must hold the NodeManager privilege and be + responsible for the node the ip belongs to. The action is logged and a + change notification is emitted. parameters: - in: path - name: node_id + name: id required: true - description: Node identifier (node_id UUID or nodename) + description: Ip identifier (node_ip.id) schema: type: string - - $ref: '#/components/parameters/inQueryProps' - - $ref: '#/components/parameters/inQueryLimit' - - $ref: '#/components/parameters/inQueryOffset' - - $ref: '#/components/parameters/inQueryMeta' - - $ref: '#/components/parameters/inQueryStats' - - $ref: '#/components/parameters/inQueryOrderby' - - $ref: '#/components/parameters/inQueryGroupby' tags: - collector responses: @@ -4444,7 +4489,14 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ListResponse' + type: object + properties: + info: + type: string + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 500: @@ -4453,15 +4505,59 @@ paths: - basicAuth: [ ] - bearerAuth: [ ] - /nodes/{node_id}/ips: + /logs: + post: + operationId: PostLogs + description: | + Create a log event. The entry type is forced to 'message', the default + level is 'info', and empty log events are discarded. + requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - log_fmt + properties: + log_fmt: + type: string + log_level: + type: string + log_dict: + type: object + node_id: + type: string + svc_id: + type: string + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ListResponse' + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] get: - operationId: GetNodeIps - description: List a node IP addresses + operationId: GetLogs + description: List events in the collector log parameters: - - in: path - name: node_id - required: true - description: Node identifier (node_id UUID or nodename) + - in: query + name: fset_id + required: false + description: Restrict to log events matching this filterset (gen_filtersets.id or fset_name) schema: type: string - $ref: '#/components/parameters/inQueryProps' @@ -4479,24 +4575,22 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ListResponse' - 404: - $ref: '#/components/responses/404' + $ref: '#/components/schemas/LogListResponse' 500: $ref: '#/components/responses/500' security: - basicAuth: [ ] - bearerAuth: [ ] - /nodes/{node_id}/interfaces: + /logs/{log_id}: get: - operationId: GetNodeInterfaces - description: List a node network interfaces + operationId: GetLog + description: Display a collector log event properties parameters: - in: path - name: node_id + name: log_id required: true - description: Node identifier (node_id UUID or nodename) + description: Log event identifier (log.id) schema: type: string - $ref: '#/components/parameters/inQueryProps' @@ -4514,7 +4608,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ListResponse' + $ref: '#/components/schemas/LogListResponse' 404: $ref: '#/components/responses/404' 500: @@ -4523,23 +4617,74 @@ paths: - basicAuth: [ ] - bearerAuth: [ ] - /nodes/{node_id}/tags: + /search: get: - operationId: GetNodeTags - description: List tags attached to a node + operationId: GetSearch + description: | + Search the main kinds of objects for the text, as the historical collector's + search: nodes, services, instances, applications, node addresses, disks, tags, + users, teams, requests, modulesets, rulesets, filtersets and forms. For each + kind, the objects whose name or another identifying prop contains the text, + case-insensitively, are read through the kind's own list and its access + control. A request also matches by its number. Groups come in that order, one + per kind, with `more` set when other objects match beyond `limit`. A kind that + cannot be searched reports it in its `error` without failing the others. A + text shorter than 2 characters returns no group. parameters: - - in: path - name: node_id + - in: query + name: q required: true - description: Node identifier (node_id UUID or nodename) + description: The text to search for. + schema: + type: string + - in: query + name: kinds + description: | + Comma-separated kinds to search, all by default: node, service, instance, + app, network, disk, tag, user, group, request, moduleset, ruleset, + filterset, form. schema: type: string + - in: query + name: limit + description: Hits returned per kind, 5 by default, 20 at most. + schema: + type: integer + minimum: 1 + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/SearchResponse' + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + + /networks: + get: + operationId: GetNetworks + description: | + List the declared networks, by name then address. Every authenticated user + may read them. `begin`, `end` and `broadcast` are computed from `network` and + `netmask`. + parameters: - $ref: '#/components/parameters/inQueryProps' - $ref: '#/components/parameters/inQueryLimit' - $ref: '#/components/parameters/inQueryOffset' - $ref: '#/components/parameters/inQueryMeta' - $ref: '#/components/parameters/inQueryStats' - $ref: '#/components/parameters/inQueryOrderby' + - $ref: '#/components/parameters/inQueryFilter' - $ref: '#/components/parameters/inQueryGroupby' tags: - collector @@ -4549,72 +4694,119 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ListResponse' - 404: - $ref: '#/components/responses/404' + $ref: '#/components/schemas/NetworkListResponse' + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' 500: $ref: '#/components/responses/500' security: - basicAuth: [ ] - bearerAuth: [ ] - - /nodes/{node_id}/snooze: post: - operationId: PostNodeSnooze + operationId: PostNetworks description: | - Snooze or unsnooze notifications on a node. - If duration is provided, snooze until now + duration (e.g. "1h", "2d"). - If duration is omitted, unsnooze the node. - The node can snooze itself. Users must be NodeManager and responsible for the node. - parameters: - - $ref: '#/components/parameters/inPathNodeId' + Declare a network. Requires the NetworkManager privilege. `network` must be + the IPv4 network address for `netmask`; `begin`, `end` and `broadcast` are + computed by the database. `team_responsible` defaults to the caller's primary + group. A name or an address already declared is refused with a 409. requestBody: - required: false + required: true content: application/json: schema: type: object + required: + - network + - netmask properties: - duration: + name: type: string - description: Duration string (e.g. "1h", "30m", "2d"). Omit to unsnooze. + network: + type: string + description: IPv4 network address, for example 192.168.10.0 + netmask: + type: integer + minimum: 0 + maximum: 32 + description: Prefix length + gateway: + type: string + description: IPv4 address inside the network + comment: + type: string + pvid: + type: integer + description: VLAN id + prio: + type: integer + minimum: 0 + maximum: 99 + description: Priority among overlapping networks + team_responsible: + type: string + description: Organisational group responsible for the network + tags: + - collector responses: 200: description: OK content: application/json: schema: - type: object - properties: - info: - type: string + $ref: '#/components/schemas/NetworkListResponse' 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' - 404: - $ref: '#/components/responses/404' + 409: + $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' security: - basicAuth: [ ] - bearerAuth: [ ] - tags: - - collector - /nodes/{node_id}/am_i_responsible: - get: - operationId: GetNodeAmIResponsible - description: Return true if the requester is responsible for this node. + /networks/{net_id}/segments: + post: + operationId: PostNetworkSegments + description: | + Declare a segment of a network: an address range whose responsible groups + may allocate its addresses. Requires the NetworkManager privilege and, unless + the caller is a manager, membership of the network's responsible team. The + range must lie inside the network and must not overlap another segment of it + (409). The caller's primary group becomes responsible for the segment. parameters: - in: path - name: node_id + name: net_id required: true - description: Node identifier (node_id UUID or nodename) + description: Record id of the network schema: type: string + requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - seg_begin + - seg_end + properties: + seg_type: + type: string + enum: [static, dynamic] + default: static + description: How the addresses of the segment are allocated + seg_begin: + type: string + description: First IPv4 address of the segment + seg_end: + type: string + description: Last IPv4 address of the segment tags: - collector responses: @@ -4623,30 +4815,183 @@ paths: content: application/json: schema: - type: object + $ref: '#/components/schemas/NetworkSegmentListResponse' + 400: + $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' - 500: + 409: + $ref: '#/components/responses/409' + 500: $ref: '#/components/responses/500' security: - basicAuth: [ ] - bearerAuth: [ ] - /nodes/{node_id}/uuid: - get: - operationId: GetNodeUUID - description: Display node uuid. Only node responsibles and managers are allowed. - parameters: - - in: path - name: node_id - required: true - description: Node identifier (node_id UUID or nodename) - schema: - type: string + /nodes: + post: + operationId: PostNodes + description: Create or update a node (by nodename or node_id) + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + nodename: + type: string + node_id: + type: string + team_responsible: + type: string + app: + type: string + cluster_id: + type: string + warranty_end: + type: string + maintenance_end: + type: string + status: + type: string + role: + type: string + listener_port: + type: integer + version: + type: string + collector: + type: string + connect_to: + type: string + tz: + type: string + asset_env: + type: string + type: + type: string + fqdn: + type: string + manufacturer: + type: string + loc_addr: + type: string + loc_city: + type: string + loc_zip: + type: string + loc_rack: + type: string + loc_floor: + type: string + loc_country: + type: string + loc_building: + type: string + loc_room: + type: string + power_supply_nb: + type: integer + power_cabinet1: + type: string + power_cabinet2: + type: string + power_protect: + type: string + power_protect_breaker: + type: string + power_breaker1: + type: string + power_breaker2: + type: string + enclosure: + type: string + enclosureslot: + type: string + assetname: + type: string + sec_zone: + type: string + action_type: + type: string + enum: [push, pull] + hvpool: + type: string + hvvdc: + type: string + hv: + type: string + hw_obs_warn_date: + type: string + hw_obs_alert_date: + type: string + os_obs_warn_date: + type: string + os_obs_alert_date: + type: string + notifications: + type: boolean + snooze_till: + type: string + node_frozen: + type: boolean + node_frozen_at: + type: string + bios_version: + type: string + cpu_cores: + type: integer + cpu_dies: + type: integer + cpu_freq: + type: string + cpu_model: + type: string + cpu_threads: + type: integer + cpu_vendor: + type: string + last_boot: + type: string + last_comm: + type: string + mem_banks: + type: integer + mem_bytes: + type: integer + mem_slots: + type: integer + model: + type: string + node_env: + type: string + os_arch: + type: string + os_concat: + type: string + os_kernel: + type: string + os_name: + type: string + os_release: + type: string + os_vendor: + type: string + serial: + type: string + sp_version: + type: string + team_integ: + type: string + team_support: + type: string + updated: + type: string tags: - collector responses: @@ -4655,36 +5000,30 @@ paths: content: application/json: schema: - type: object + $ref: '#/components/schemas/NodeRow' + 400: + $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' - 404: - $ref: '#/components/responses/404' 500: $ref: '#/components/responses/500' security: - basicAuth: [ ] - bearerAuth: [ ] - /nodes/{node_id}/services: get: - operationId: GetNodeServices - description: List OpenSVC service instances on the specified node + operationId: GetNodes + description: List nodes parameters: - - in: path - name: node_id - required: true - description: Node identifier (node_id UUID or nodename) - schema: - type: string - $ref: '#/components/parameters/inQueryProps' - $ref: '#/components/parameters/inQueryLimit' - $ref: '#/components/parameters/inQueryOffset' - $ref: '#/components/parameters/inQueryMeta' - $ref: '#/components/parameters/inQueryStats' - $ref: '#/components/parameters/inQueryOrderby' + - $ref: '#/components/parameters/inQueryFilter' - $ref: '#/components/parameters/inQueryGroupby' tags: - collector @@ -4694,39 +5033,30 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ListResponse' - 404: - $ref: '#/components/responses/404' + $ref: '#/components/schemas/NodeListResponse' 500: $ref: '#/components/responses/500' security: - basicAuth: [ ] - bearerAuth: [ ] - - /nodes/{node_id}/services/{svc_id}: - get: - operationId: GetNodeService - description: Display service instance status on the specified node - parameters: - - in: path - name: node_id - required: true - description: Node identifier (node_id UUID or nodename) - schema: - type: string - - in: path - name: svc_id - required: true - description: Service identifier (svc_id UUID or svcname) - schema: - type: string - - $ref: '#/components/parameters/inQueryProps' - - $ref: '#/components/parameters/inQueryLimit' - - $ref: '#/components/parameters/inQueryOffset' - - $ref: '#/components/parameters/inQueryMeta' - - $ref: '#/components/parameters/inQueryStats' - - $ref: '#/components/parameters/inQueryOrderby' - - $ref: '#/components/parameters/inQueryGroupby' + delete: + operationId: DeleteNodes + description: | + Delete a node (bulk form). The 'node_id' key is mandatory in the body + and selects the target node; the deletion is then handled as DELETE + /nodes/{node_id} (cascade delete + audit log + change notification). + requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - node_id + properties: + node_id: + type: string + description: Node identifier (node_id or nodename) tags: - collector responses: @@ -4735,7 +5065,16 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ListResponse' + type: object + properties: + info: + type: string + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 500: @@ -4744,10 +5083,12 @@ paths: - basicAuth: [ ] - bearerAuth: [ ] - /obsolescence/settings: + /nodes/hardware: get: - operationId: GetObsolescenceSettings - description: List obsolescence settings + operationId: GetNodesHardware + description: | + List the PCI and memory hardware of the nodes the user can see, as their + agents report it. The `nodes.` properties come from the joined nodes table. parameters: - $ref: '#/components/parameters/inQueryProps' - $ref: '#/components/parameters/inQueryLimit' @@ -4755,6 +5096,7 @@ paths: - $ref: '#/components/parameters/inQueryMeta' - $ref: '#/components/parameters/inQueryStats' - $ref: '#/components/parameters/inQueryOrderby' + - $ref: '#/components/parameters/inQueryFilter' - $ref: '#/components/parameters/inQueryGroupby' tags: - collector @@ -4764,35 +5106,27 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ListResponse' + $ref: '#/components/schemas/NodeHardwareListResponse' + 401: + $ref: '#/components/responses/401' 500: $ref: '#/components/responses/500' security: - basicAuth: [ ] - bearerAuth: [ ] - post: - operationId: PostObsolescenceSettings - description: | - Modify an obsolescence setting. Requires the ObsManager privilege. - requestBody: - required: true - content: - application/json: - schema: - type: object - required: - - id - properties: - id: - type: string - description: Obsolescence setting record id - obs_warn_date: - type: string - description: Date from which nodes matching this setting are flagged as a warning - obs_alert_date: - type: string - description: Date from which nodes matching this setting are flagged as obsolete + /nodes/hbas: + get: + operationId: GetNodesHbas + description: List all nodes FC and iSCSI host bus adapters + parameters: + - $ref: '#/components/parameters/inQueryProps' + - $ref: '#/components/parameters/inQueryLimit' + - $ref: '#/components/parameters/inQueryOffset' + - $ref: '#/components/parameters/inQueryMeta' + - $ref: '#/components/parameters/inQueryStats' + - $ref: '#/components/parameters/inQueryOrderby' + - $ref: '#/components/parameters/inQueryGroupby' tags: - collector responses: @@ -4802,36 +5136,177 @@ paths: application/json: schema: $ref: '#/components/schemas/ListResponse' - 400: - $ref: '#/components/responses/400' - 401: - $ref: '#/components/responses/401' - 403: - $ref: '#/components/responses/403' - 404: - $ref: '#/components/responses/404' 500: $ref: '#/components/responses/500' security: - basicAuth: [ ] - bearerAuth: [ ] - delete: - operationId: DeleteObsolescenceSettings - description: | - Delete an obsolescence setting. Requires the ObsManager privilege. + /nodes/{node_id}: + post: + operationId: PostNode + description: Update a node properties + parameters: + - in: path + name: node_id + required: true + description: Node identifier (node_id UUID or nodename) + schema: + type: string requestBody: required: true content: application/json: schema: type: object - required: - - id properties: - id: + nodename: + type: string + team_responsible: + type: string + app: + type: string + cluster_id: + type: string + warranty_end: + type: string + maintenance_end: + type: string + status: + type: string + role: + type: string + listener_port: + type: integer + version: + type: string + collector: + type: string + connect_to: + type: string + tz: + type: string + asset_env: + type: string + type: + type: string + fqdn: + type: string + manufacturer: + type: string + loc_addr: + type: string + loc_city: + type: string + loc_zip: + type: string + loc_rack: + type: string + loc_floor: + type: string + loc_country: + type: string + loc_building: + type: string + loc_room: + type: string + power_supply_nb: + type: integer + power_cabinet1: + type: string + power_cabinet2: + type: string + power_protect: + type: string + power_protect_breaker: + type: string + power_breaker1: + type: string + power_breaker2: + type: string + enclosure: + type: string + enclosureslot: + type: string + assetname: + type: string + sec_zone: + type: string + action_type: + type: string + enum: [push, pull] + hvpool: + type: string + hvvdc: + type: string + hv: + type: string + hw_obs_warn_date: + type: string + hw_obs_alert_date: + type: string + os_obs_warn_date: + type: string + os_obs_alert_date: + type: string + notifications: + type: boolean + snooze_till: + type: string + node_frozen: + type: boolean + node_frozen_at: + type: string + bios_version: + type: string + cpu_cores: + type: integer + cpu_dies: + type: integer + cpu_freq: + type: string + cpu_model: + type: string + cpu_threads: + type: integer + cpu_vendor: + type: string + last_boot: + type: string + last_comm: + type: string + mem_banks: + type: integer + mem_bytes: + type: integer + mem_slots: + type: integer + model: + type: string + node_env: + type: string + os_arch: + type: string + os_concat: + type: string + os_kernel: + type: string + os_name: + type: string + os_release: + type: string + os_vendor: + type: string + serial: + type: string + sp_version: + type: string + team_integ: + type: string + team_support: + type: string + updated: type: string - description: Obsolescence setting record id tags: - collector responses: @@ -4840,10 +5315,7 @@ paths: content: application/json: schema: - type: object - properties: - info: - type: string + $ref: '#/components/schemas/NodeRow' 400: $ref: '#/components/responses/400' 401: @@ -4858,15 +5330,14 @@ paths: - basicAuth: [ ] - bearerAuth: [ ] - /obsolescence/settings/{id}: get: - operationId: GetObsolescenceSetting - description: Display an obsolescence setting + operationId: GetNode + description: List entries for a specific node parameters: - in: path - name: id + name: node_id required: true - description: Obsolescence setting record id + description: Node identifier (node_id UUID or nodename) schema: type: string - $ref: '#/components/parameters/inQueryProps' @@ -4884,7 +5355,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ListResponse' + $ref: '#/components/schemas/NodeListResponse' 404: $ref: '#/components/responses/404' 500: @@ -4893,30 +5364,16 @@ paths: - basicAuth: [ ] - bearerAuth: [ ] - post: - operationId: PostObsolescenceSetting - description: | - Modify an obsolescence setting. Requires the ObsManager privilege. + delete: + operationId: DeleteNode + description: Delete an OpenSVC node and cascade delete its related entries. parameters: - in: path - name: id + name: node_id required: true - description: Obsolescence setting record id + description: Node identifier (node_id UUID or nodename) schema: type: string - requestBody: - required: true - content: - application/json: - schema: - type: object - properties: - obs_warn_date: - type: string - description: Date from which nodes matching this setting are flagged as a warning - obs_alert_date: - type: string - description: Date from which nodes matching this setting are flagged as obsolete tags: - collector responses: @@ -4925,9 +5382,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ListResponse' - 400: - $ref: '#/components/responses/400' + $ref: '#/components/schemas/InfoResponse' 401: $ref: '#/components/responses/401' 403: @@ -4940,17 +5395,24 @@ paths: - basicAuth: [ ] - bearerAuth: [ ] - delete: - operationId: DeleteObsolescenceSetting - description: | - Delete an obsolescence setting. Requires the ObsManager privilege. + /nodes/{node_id}/alerts: + get: + operationId: GetNodeAlerts + description: List a node alerts parameters: - in: path - name: id + name: node_id required: true - description: Obsolescence setting record id + description: Node identifier (node_id UUID or nodename) schema: type: string + - $ref: '#/components/parameters/inQueryProps' + - $ref: '#/components/parameters/inQueryLimit' + - $ref: '#/components/parameters/inQueryOffset' + - $ref: '#/components/parameters/inQueryMeta' + - $ref: '#/components/parameters/inQueryStats' + - $ref: '#/components/parameters/inQueryOrderby' + - $ref: '#/components/parameters/inQueryGroupby' tags: - collector responses: @@ -4959,14 +5421,7 @@ paths: content: application/json: schema: - type: object - properties: - info: - type: string - 401: - $ref: '#/components/responses/401' - 403: - $ref: '#/components/responses/403' + $ref: '#/components/schemas/AlertListResponse' 404: $ref: '#/components/responses/404' 500: @@ -4975,12 +5430,24 @@ paths: - basicAuth: [ ] - bearerAuth: [ ] - /obsolescence/refresh: - put: - operationId: PutObsolescenceRefresh - description: | - Refresh the hardware models and os full names list in the obsolescence settings. - Requires the ObsManager privilege. + /nodes/{node_id}/checks: + get: + operationId: GetNodeChecks + description: List a node checks + parameters: + - in: path + name: node_id + required: true + description: Node identifier (node_id UUID or nodename) + schema: + type: string + - $ref: '#/components/parameters/inQueryProps' + - $ref: '#/components/parameters/inQueryLimit' + - $ref: '#/components/parameters/inQueryOffset' + - $ref: '#/components/parameters/inQueryMeta' + - $ref: '#/components/parameters/inQueryStats' + - $ref: '#/components/parameters/inQueryOrderby' + - $ref: '#/components/parameters/inQueryGroupby' tags: - collector responses: @@ -4989,25 +5456,35 @@ paths: content: application/json: schema: - type: object - properties: - info: - type: string - 401: - $ref: '#/components/responses/401' - 403: - $ref: '#/components/responses/403' + $ref: '#/components/schemas/ListResponse' + 404: + $ref: '#/components/responses/404' 500: $ref: '#/components/responses/500' security: - basicAuth: [ ] - bearerAuth: [ ] - /openapi.json: + /nodes/{node_id}/candidate_tags: get: - operationId: GetSwagger + operationId: GetNodeCandidateTags + description: List tags attachable to a node (not yet attached and not excluded) + parameters: + - in: path + name: node_id + required: true + description: Node identifier (node_id UUID or nodename) + schema: + type: string + - $ref: '#/components/parameters/inQueryProps' + - $ref: '#/components/parameters/inQueryLimit' + - $ref: '#/components/parameters/inQueryOffset' + - $ref: '#/components/parameters/inQueryMeta' + - $ref: '#/components/parameters/inQueryStats' + - $ref: '#/components/parameters/inQueryOrderby' + - $ref: '#/components/parameters/inQueryGroupby' tags: - - public + - collector responses: 200: description: OK @@ -5015,18 +5492,21 @@ paths: application/json: schema: $ref: '#/components/schemas/ListResponse' - 401: - $ref: '#/components/responses/401' - 403: - $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' 500: $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] - /services: + /nodes/{node_id}/compliance/candidate_modulesets: get: - operationId: GetServices - description: List services + description: | + Get candidate modulesets for a node + operationId: GetNodeComplianceCandidateModulesets parameters: + - $ref: '#/components/parameters/inPathNodeId' - $ref: '#/components/parameters/inQueryProps' - $ref: '#/components/parameters/inQueryLimit' - $ref: '#/components/parameters/inQueryOffset' @@ -5034,136 +5514,75 @@ paths: - $ref: '#/components/parameters/inQueryStats' - $ref: '#/components/parameters/inQueryOrderby' - $ref: '#/components/parameters/inQueryGroupby' - tags: - - collector responses: 200: - description: OK + description: List of candidate modulesets content: application/json: schema: $ref: '#/components/schemas/ListResponse' + 404: + description: Node not found 500: - $ref: '#/components/responses/500' + description: Internal server error security: - basicAuth: [ ] - bearerAuth: [ ] - - post: - operationId: PostServices - description: Create or update a service (by svcname or svc_id) - requestBody: - required: true - content: - application/json: - schema: - type: object - properties: - svc_id: - type: string - svcname: - type: string - cluster_id: - type: string - svc_app: - type: string - svc_env: - type: string - svc_comment: - type: string - svc_nodes: - type: string - svc_drpnode: - type: string - svc_drpnodes: - type: string - svc_autostart: - type: string - svc_drptype: - type: string - svc_drnoaction: - type: string - svc_metrocluster: - type: string - svc_wave: - type: integer - svc_topology: - type: string - svc_flex_min_nodes: - type: integer - svc_flex_max_nodes: - type: integer - svc_flex_cpu_low_threshold: - type: integer - svc_flex_cpu_high_threshold: - type: integer - svc_ha: - type: string - svc_frozen: - type: string - svc_provisioned: - type: string - svc_placement: - type: string - svc_notifications: - type: boolean - svc_snooze_till: - type: string tags: - collector + + /nodes/{node_id}/compliance/candidate_rulesets: + get: + description: | + Get candidate rulesets for a node + operationId: GetNodeComplianceCandidateRulesets + parameters: + - $ref: '#/components/parameters/inPathNodeId' + - $ref: '#/components/parameters/inQueryProps' + - $ref: '#/components/parameters/inQueryLimit' + - $ref: '#/components/parameters/inQueryOffset' + - $ref: '#/components/parameters/inQueryMeta' + - $ref: '#/components/parameters/inQueryStats' + - $ref: '#/components/parameters/inQueryOrderby' + - $ref: '#/components/parameters/inQueryGroupby' responses: 200: - description: Service created or updated + description: List of candidate rulesets content: application/json: schema: - type: object - 400: - $ref: '#/components/responses/400' - 401: - $ref: '#/components/responses/401' - 403: - $ref: '#/components/responses/403' + $ref: '#/components/schemas/ListResponse' + 404: + description: Node not found 500: - $ref: '#/components/responses/500' + description: Internal server error security: - basicAuth: [ ] - bearerAuth: [ ] - - delete: - operationId: DeleteServices - description: | - Delete a service. - requestBody: - required: true - content: - application/json: - schema: - type: object - required: - - svc_id - properties: - svc_id: - type: string - description: Service id or name tags: - collector + + /nodes/{node_id}/compliance/logs: + get: + description: | + Get compliance logs for a node + operationId: GetNodeComplianceLogs + parameters: + - $ref: '#/components/parameters/inPathNodeId' + - $ref: '#/components/parameters/inQueryProps' + - $ref: '#/components/parameters/inQueryLimit' + - $ref: '#/components/parameters/inQueryOffset' + - $ref: '#/components/parameters/inQueryMeta' + - $ref: '#/components/parameters/inQueryStats' + - $ref: '#/components/parameters/inQueryOrderby' + - $ref: '#/components/parameters/inQueryGroupby' responses: 200: - description: OK + description: Compliance logs for the node content: application/json: schema: - type: object - properties: - info: - type: string - 400: - $ref: '#/components/responses/400' - 401: - $ref: '#/components/responses/401' - 403: - $ref: '#/components/responses/403' + $ref: '#/components/schemas/ListResponse' 404: $ref: '#/components/responses/404' 500: @@ -5171,19 +5590,16 @@ paths: security: - basicAuth: [ ] - bearerAuth: [ ] + tags: + - collector - - /services/{svc_id}: + /nodes/{node_id}/compliance/modulesets: get: - operationId: GetService - description: List entries for a specific service + description: | + Get modulesets attached to a node + operationId: GetNodeComplianceModulesets parameters: - - in: path - name: svc_id - required: true - description: Service identifier (svc_id UUID or svcname) - schema: - type: string + - $ref: '#/components/parameters/inPathNodeId' - $ref: '#/components/parameters/inQueryProps' - $ref: '#/components/parameters/inQueryLimit' - $ref: '#/components/parameters/inQueryOffset' @@ -5191,183 +5607,161 @@ paths: - $ref: '#/components/parameters/inQueryStats' - $ref: '#/components/parameters/inQueryOrderby' - $ref: '#/components/parameters/inQueryGroupby' - tags: - - collector responses: 200: - description: OK + description: List of attached modulesets content: application/json: schema: - $ref: '#/components/schemas/ListResponse' + $ref: '#/components/schemas/ModulesetListResponse' 404: - $ref: '#/components/responses/404' + description: Node not found 500: - $ref: '#/components/responses/500' + description: Internal server error security: - basicAuth: [ ] - bearerAuth: [ ] + tags: + - collector + /nodes/{node_id}/compliance/modulesets/{mset_id}: + delete: + description: | + Detach a moduleset from a node + operationId: DeleteNodeComplianceModuleset + parameters: + - $ref: '#/components/parameters/inPathNodeId' + - $ref: '#/components/parameters/inPathMsetId' + responses: + 204: + description: Moduleset successfully detached + 404: + description: Node or moduleset not found + 500: + description: Internal server error + security: + - basicAuth: [ ] + - bearerAuth: [ ] + tags: + - collector post: - operationId: PostService - description: Update a service properties + description: | + Attach a moduleset to a node + operationId: PostNodeComplianceModuleset parameters: - - in: path - name: svc_id - required: true - description: Service identifier (svc_id UUID or svcname) - schema: - type: string + - $ref: '#/components/parameters/inPathNodeId' + - $ref: '#/components/parameters/inPathMsetId' requestBody: required: true content: application/json: schema: type: object - properties: - svcname: - type: string - svc_app: - type: string - svc_env: - type: string - svc_comment: - type: string - svc_nodes: - type: string - svc_drpnode: - type: string - svc_drpnodes: - type: string - svc_autostart: - type: string - svc_drptype: - type: string - svc_drnoaction: - type: string - svc_metrocluster: - type: string - svc_wave: - type: integer - svc_topology: - type: string - svc_flex_min_nodes: - type: integer - svc_flex_max_nodes: - type: integer - svc_flex_cpu_low_threshold: - type: integer - svc_flex_cpu_high_threshold: - type: integer - svc_ha: - type: string - svc_frozen: - type: string - svc_provisioned: - type: string - svc_placement: - type: string - svc_notifications: - type: boolean - svc_snooze_till: - type: string - tags: - - collector responses: - 200: - description: Service updated - content: - application/json: - schema: - type: object + 202: + description: Moduleset attached 400: $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' - 404: - $ref: '#/components/responses/404' 500: $ref: '#/components/responses/500' security: - basicAuth: [ ] - bearerAuth: [ ] - - delete: - operationId: DeleteService - description: Delete an OpenSVC service and cascade delete its related entries. - parameters: - - in: path - name: svc_id - required: true - description: Service identifier (svc_id UUID or svcname) - schema: - type: string tags: - collector + + /nodes/{node_id}/compliance/rulesets: + get: + description: | + Get rulesets attached to a node + operationId: GetNodeComplianceRulesets + parameters: + - $ref: '#/components/parameters/inPathNodeId' + - $ref: '#/components/parameters/inQueryProps' + - $ref: '#/components/parameters/inQueryLimit' + - $ref: '#/components/parameters/inQueryOffset' + - $ref: '#/components/parameters/inQueryMeta' + - $ref: '#/components/parameters/inQueryStats' + - $ref: '#/components/parameters/inQueryOrderby' + - $ref: '#/components/parameters/inQueryGroupby' responses: 200: - description: OK + description: List of attached rulesets content: application/json: schema: - type: object - 401: - $ref: '#/components/responses/401' - 403: - $ref: '#/components/responses/403' + $ref: '#/components/schemas/RulesetListResponse' 404: - $ref: '#/components/responses/404' + description: Node not found 500: - $ref: '#/components/responses/500' + description: Internal server error security: - basicAuth: [ ] - bearerAuth: [ ] + tags: + - collector - /services/{svc_id}/am_i_responsible: - get: - operationId: GetServiceAmIResponsible - description: Return true if the requester is responsible for this service. + /nodes/{node_id}/compliance/rulesets/{rset_id}: + delete: + description: | + Detach a ruleset from a node + operationId: DeleteNodeComplianceRuleset parameters: - - in: path - name: svc_id - required: true - description: Service identifier (svc_id UUID or svcname) - schema: - type: string + - $ref: '#/components/parameters/inPathNodeId' + - $ref: '#/components/parameters/inPathRsetId' + responses: + 204: + description: Ruleset successfully detached + 404: + description: Node or ruleset not found + 500: + description: Internal server error + security: + - basicAuth: [ ] + - bearerAuth: [ ] tags: - collector + post: + description: | + Attach a ruleset to a node + operationId: PostNodeComplianceRuleset + parameters: + - $ref: '#/components/parameters/inPathNodeId' + - $ref: '#/components/parameters/inPathRsetId' + requestBody: + required: true + content: + application/json: + schema: + type: object responses: - 200: - description: OK - content: - application/json: - schema: - type: object + 202: + description: Ruleset attached + 400: + $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' - 404: - $ref: '#/components/responses/404' 500: $ref: '#/components/responses/500' security: - basicAuth: [ ] - bearerAuth: [ ] + tags: + - collector - /services/{svc_id}/alerts: + /nodes/{node_id}/compliance/status: get: - operationId: GetServiceAlerts - description: List a service alerts + description: | + List compliance modules last check run status for a node + operationId: GetNodeComplianceStatus parameters: - - in: path - name: svc_id - required: true - description: Service identifier (svc_id UUID or svcname) - schema: - type: string + - $ref: '#/components/parameters/inPathNodeId' - $ref: '#/components/parameters/inQueryProps' - $ref: '#/components/parameters/inQueryLimit' - $ref: '#/components/parameters/inQueryOffset' @@ -5375,32 +5769,32 @@ paths: - $ref: '#/components/parameters/inQueryStats' - $ref: '#/components/parameters/inQueryOrderby' - $ref: '#/components/parameters/inQueryGroupby' - tags: - - collector responses: 200: - description: OK + description: Compliance status entries for the node content: application/json: schema: - $ref: '#/components/schemas/ListResponse' + $ref: '#/components/schemas/ComplianceStatusListResponse' 404: - $ref: '#/components/responses/404' + description: Node not found 500: - $ref: '#/components/responses/500' + description: Internal server error security: - basicAuth: [ ] - bearerAuth: [ ] + tags: + - collector - /services/{svc_id}/checks: + /nodes/{node_id}/disks: get: - operationId: GetServiceChecks - description: List a service checks + operationId: GetNodeDisks + description: List disks of a specific node parameters: - in: path - name: svc_id + name: node_id required: true - description: Service identifier (svc_id UUID or svcname) + description: Node identifier (node_id UUID or nodename) schema: type: string - $ref: '#/components/parameters/inQueryProps' @@ -5418,7 +5812,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ListResponse' + $ref: '#/components/schemas/DiskListResponse' 404: $ref: '#/components/responses/404' 500: @@ -5427,15 +5821,15 @@ paths: - basicAuth: [ ] - bearerAuth: [ ] - /services/{svc_id}/resources/logs: + /nodes/{node_id}/hbas: get: - operationId: GetServiceResourceLogs - description: List a service resources state changes on all nodes + operationId: GetNodeHbas + description: List a node storage host bus adapters parameters: - in: path - name: svc_id + name: node_id required: true - description: Service identifier (svc_id UUID or svcname) + description: Node identifier (node_id UUID or nodename) schema: type: string - $ref: '#/components/parameters/inQueryProps' @@ -5453,7 +5847,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ListResponse' + $ref: '#/components/schemas/HbaListResponse' 404: $ref: '#/components/responses/404' 500: @@ -5462,15 +5856,15 @@ paths: - basicAuth: [ ] - bearerAuth: [ ] - /services/{svc_id}/resources: + /nodes/{node_id}/hardware: get: - operationId: GetServiceResources - description: List a service resources on all nodes + operationId: GetNodeHardware + description: List a node PCI and memory hardware parameters: - in: path - name: svc_id + name: node_id required: true - description: Service identifier (svc_id UUID or svcname) + description: Node identifier (node_id UUID or nodename) schema: type: string - $ref: '#/components/parameters/inQueryProps' @@ -5488,7 +5882,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ListResponse' + $ref: '#/components/schemas/NodeHardwareListResponse' 404: $ref: '#/components/responses/404' 500: @@ -5497,15 +5891,15 @@ paths: - basicAuth: [ ] - bearerAuth: [ ] - /services/{svc_id}/nodes: + /nodes/{node_id}/ips: get: - operationId: GetServiceNodes - description: List a service instance status on each of its nodes + operationId: GetNodeIps + description: List a node IP addresses parameters: - in: path - name: svc_id + name: node_id required: true - description: Service identifier (svc_id UUID or svcname) + description: Node identifier (node_id UUID or nodename) schema: type: string - $ref: '#/components/parameters/inQueryProps' @@ -5523,7 +5917,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ListResponse' + $ref: '#/components/schemas/IpListResponse' 404: $ref: '#/components/responses/404' 500: @@ -5532,17 +5926,11 @@ paths: - basicAuth: [ ] - bearerAuth: [ ] - /services/{svc_id}/nodes/{node_id}: + /nodes/{node_id}/interfaces: get: - operationId: GetServiceNode - description: Display service instance status on the specified node + operationId: GetNodeInterfaces + description: List a node network interfaces parameters: - - in: path - name: svc_id - required: true - description: Service identifier (svc_id UUID or svcname) - schema: - type: string - in: path name: node_id required: true @@ -5573,23 +5961,24 @@ paths: - basicAuth: [ ] - bearerAuth: [ ] - /services/{svc_id}/instances/{node_id}: - delete: - operationId: DeleteServiceInstance - description: Delete a service instance and cascade to dashboard, resmon, resinfo and checks_live + /nodes/{node_id}/tags: + get: + operationId: GetNodeTags + description: List tags attached to a node parameters: - - in: path - name: svc_id - required: true - description: Service identifier (svc_id UUID or svcname) - schema: - type: string - in: path name: node_id required: true description: Node identifier (node_id UUID or nodename) schema: type: string + - $ref: '#/components/parameters/inQueryProps' + - $ref: '#/components/parameters/inQueryLimit' + - $ref: '#/components/parameters/inQueryOffset' + - $ref: '#/components/parameters/inQueryMeta' + - $ref: '#/components/parameters/inQueryStats' + - $ref: '#/components/parameters/inQueryOrderby' + - $ref: '#/components/parameters/inQueryGroupby' tags: - collector responses: @@ -5598,11 +5987,7 @@ paths: content: application/json: schema: - type: object - 401: - $ref: '#/components/responses/401' - 403: - $ref: '#/components/responses/403' + $ref: '#/components/schemas/ListResponse' 404: $ref: '#/components/responses/404' 500: @@ -5611,38 +5996,42 @@ paths: - basicAuth: [ ] - bearerAuth: [ ] - get: - operationId: GetServiceInstance - description: Display service instance details on the specified node + /nodes/{node_id}/snooze: + post: + operationId: PostNodeSnooze + description: | + Snooze or unsnooze notifications on a node. + If duration is provided, snooze until now + duration (e.g. "1h", "2d"). + If duration is omitted, unsnooze the node. + The node can snooze itself. Users must be NodeManager and responsible for the node. parameters: - - in: path - name: svc_id - required: true - description: Service identifier (svc_id UUID or svcname) - schema: - type: string - - in: path - name: node_id - required: true - description: Node identifier (node_id UUID or nodename) - schema: - type: string - - $ref: '#/components/parameters/inQueryProps' - - $ref: '#/components/parameters/inQueryLimit' - - $ref: '#/components/parameters/inQueryOffset' - - $ref: '#/components/parameters/inQueryMeta' - - $ref: '#/components/parameters/inQueryStats' - - $ref: '#/components/parameters/inQueryOrderby' - - $ref: '#/components/parameters/inQueryGroupby' - tags: - - collector + - $ref: '#/components/parameters/inPathNodeId' + requestBody: + required: false + content: + application/json: + schema: + type: object + properties: + duration: + type: string + description: Duration string (e.g. "1h", "30m", "2d"). Omit to unsnooze. responses: 200: description: OK content: application/json: schema: - $ref: '#/components/schemas/ListResponse' + type: object + properties: + info: + type: string + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 500: @@ -5650,31 +6039,20 @@ paths: security: - basicAuth: [ ] - bearerAuth: [ ] + tags: + - collector - /services/{svc_id}/nodes/{node_id}/resources: + /nodes/{node_id}/am_i_responsible: get: - operationId: GetServiceNodeResources - description: Display service instance resources on the specified node + operationId: GetNodeAmIResponsible + description: Return true if the requester is responsible for this node. parameters: - - in: path - name: svc_id - required: true - description: Service identifier (svc_id UUID or svcname) - schema: - type: string - in: path name: node_id required: true description: Node identifier (node_id UUID or nodename) schema: type: string - - $ref: '#/components/parameters/inQueryProps' - - $ref: '#/components/parameters/inQueryLimit' - - $ref: '#/components/parameters/inQueryOffset' - - $ref: '#/components/parameters/inQueryMeta' - - $ref: '#/components/parameters/inQueryStats' - - $ref: '#/components/parameters/inQueryOrderby' - - $ref: '#/components/parameters/inQueryGroupby' tags: - collector responses: @@ -5683,7 +6061,11 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ListResponse' + type: object + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 500: @@ -5692,30 +6074,17 @@ paths: - basicAuth: [ ] - bearerAuth: [ ] - /services/{svc_id}/nodes/{node_id}/resources/logs: + /nodes/{node_id}/uuid: get: - operationId: GetServiceNodeResourceLogs - description: Display a service instance resources state changes on the specified node + operationId: GetNodeUUID + description: Display node uuid. Only node responsibles and managers are allowed. parameters: - - in: path - name: svc_id - required: true - description: Service identifier (svc_id UUID or svcname) - schema: - type: string - in: path name: node_id required: true description: Node identifier (node_id UUID or nodename) schema: type: string - - $ref: '#/components/parameters/inQueryProps' - - $ref: '#/components/parameters/inQueryLimit' - - $ref: '#/components/parameters/inQueryOffset' - - $ref: '#/components/parameters/inQueryMeta' - - $ref: '#/components/parameters/inQueryStats' - - $ref: '#/components/parameters/inQueryOrderby' - - $ref: '#/components/parameters/inQueryGroupby' tags: - collector responses: @@ -5724,7 +6093,11 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ListResponse' + type: object + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 500: @@ -5733,15 +6106,15 @@ paths: - basicAuth: [ ] - bearerAuth: [ ] - /services/{svc_id}/compliance/candidate_modulesets: + /nodes/{node_id}/services: get: - operationId: GetServiceComplianceCandidateModulesets - description: List compliance modulesets attachable to the specified service + operationId: GetNodeServices + description: List OpenSVC service instances on the specified node parameters: - in: path - name: svc_id + name: node_id required: true - description: Service identifier (svc_id UUID or svcname) + description: Node identifier (node_id UUID or nodename) schema: type: string - $ref: '#/components/parameters/inQueryProps' @@ -5768,24 +6141,23 @@ paths: - basicAuth: [ ] - bearerAuth: [ ] - /services/{svc_id}/compliance/candidate_rulesets: + /nodes/{node_id}/services/{svc_id}: get: - operationId: GetServiceComplianceCandidateRulesets - description: List compliance rulesets attachable to the specified service + operationId: GetNodeService + description: Display service instance status on the specified node parameters: + - in: path + name: node_id + required: true + description: Node identifier (node_id UUID or nodename) + schema: + type: string - in: path name: svc_id required: true description: Service identifier (svc_id UUID or svcname) schema: type: string - - in: query - name: slave - required: false - description: If true, list rulesets attachable to the encapsulated service - schema: - type: boolean - default: false - $ref: '#/components/parameters/inQueryProps' - $ref: '#/components/parameters/inQueryLimit' - $ref: '#/components/parameters/inQueryOffset' @@ -5810,18 +6182,11 @@ paths: - basicAuth: [ ] - bearerAuth: [ ] - /services/{svc_id}/compliance/logs: + /obsolescence/settings: get: - description: | - Get compliance logs for a service - operationId: GetServiceComplianceLogs + operationId: GetObsolescenceSettings + description: List obsolescence settings parameters: - - in: path - name: svc_id - required: true - description: Service identifier (svc_id UUID or svcname) - schema: - type: string - $ref: '#/components/parameters/inQueryProps' - $ref: '#/components/parameters/inQueryLimit' - $ref: '#/components/parameters/inQueryOffset' @@ -5829,48 +6194,43 @@ paths: - $ref: '#/components/parameters/inQueryStats' - $ref: '#/components/parameters/inQueryOrderby' - $ref: '#/components/parameters/inQueryGroupby' + tags: + - collector responses: 200: - description: Compliance logs for the service + description: OK content: application/json: schema: - $ref: '#/components/schemas/ListResponse' - 404: - $ref: '#/components/responses/404' + $ref: '#/components/schemas/ObsolescenceSettingListResponse' 500: $ref: '#/components/responses/500' security: - basicAuth: [ ] - bearerAuth: [ ] - tags: - - collector - /services/{svc_id}/compliance/modulesets: - get: - operationId: GetServiceComplianceModulesets - description: List compliance modulesets attached to the specified service - parameters: - - in: path - name: svc_id - required: true - description: Service identifier (svc_id UUID or svcname) - schema: - type: string - - in: query - name: slave - required: false - description: If true, list modulesets attached to the encapsulated service - schema: - type: boolean - default: false - - $ref: '#/components/parameters/inQueryProps' - - $ref: '#/components/parameters/inQueryLimit' - - $ref: '#/components/parameters/inQueryOffset' - - $ref: '#/components/parameters/inQueryMeta' - - $ref: '#/components/parameters/inQueryStats' - - $ref: '#/components/parameters/inQueryOrderby' - - $ref: '#/components/parameters/inQueryGroupby' + post: + operationId: PostObsolescenceSettings + description: | + Modify an obsolescence setting. Requires the ObsManager privilege. + requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - id + properties: + id: + type: string + description: Obsolescence setting record id + obs_warn_date: + type: string + description: Date from which nodes matching this setting are flagged as a warning. "YYYY-MM-DD" or "YYYY-MM-DD hh:mm:ss"; an empty string clears the date. + obs_alert_date: + type: string + description: Date from which nodes matching this setting are flagged as obsolete. "YYYY-MM-DD" or "YYYY-MM-DD hh:mm:ss"; an empty string clears the date. tags: - collector responses: @@ -5879,7 +6239,13 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ListResponse' + $ref: '#/components/schemas/ObsolescenceSettingListResponse' + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' 500: @@ -5888,70 +6254,34 @@ paths: - basicAuth: [ ] - bearerAuth: [ ] - /services/{svc_id}/compliance/modulesets/{mset_id}: delete: - operationId: DeleteServiceComplianceModuleset + operationId: DeleteObsolescenceSettings description: | - Detach a moduleset from a service - parameters: - - in: path - name: svc_id - required: true - description: Service identifier (svc_id UUID or svcname) - schema: - type: string - - $ref: '#/components/parameters/inPathMsetId' - - in: query - name: slave - required: false - description: If true, detach from the encapsulated service - schema: - type: boolean - default: false - tags: - - collector - responses: - 202: - description: Moduleset detached - 400: - $ref: '#/components/responses/400' - 401: - $ref: '#/components/responses/401' - 403: - $ref: '#/components/responses/403' - 404: - $ref: '#/components/responses/404' - 409: - $ref: '#/components/responses/409' - 500: - $ref: '#/components/responses/500' - security: - - basicAuth: [ ] - - bearerAuth: [ ] - post: - operationId: PostServiceComplianceModuleset - description: | - Attach a moduleset to a service - parameters: - - in: path - name: svc_id - required: true - description: Service identifier (svc_id UUID or svcname) - schema: - type: string - - $ref: '#/components/parameters/inPathMsetId' - - in: query - name: slave - required: false - description: If true, attach to the encapsulated service - schema: - type: boolean - default: false + Delete an obsolescence setting. Requires the ObsManager privilege. + requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - id + properties: + id: + type: string + description: Obsolescence setting record id tags: - collector responses: - 202: - description: Moduleset attached + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + info: + type: string 400: $ref: '#/components/responses/400' 401: @@ -5960,32 +6290,23 @@ paths: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' - 409: - $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' security: - basicAuth: [ ] - bearerAuth: [ ] - /services/{svc_id}/compliance/rulesets: + /obsolescence/settings/{id}: get: - operationId: GetServiceComplianceRulesets - description: List compliance rulesets attached to the specified service + operationId: GetObsolescenceSetting + description: Display an obsolescence setting parameters: - in: path - name: svc_id + name: id required: true - description: Service identifier (svc_id UUID or svcname) + description: Obsolescence setting record id schema: type: string - - in: query - name: slave - required: false - description: If true, list rulesets attached to the encapsulated service - schema: - type: boolean - default: false - $ref: '#/components/parameters/inQueryProps' - $ref: '#/components/parameters/inQueryLimit' - $ref: '#/components/parameters/inQueryOffset' @@ -6001,7 +6322,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ListResponse' + $ref: '#/components/schemas/ObsolescenceSettingListResponse' 404: $ref: '#/components/responses/404' 500: @@ -6010,31 +6331,39 @@ paths: - basicAuth: [ ] - bearerAuth: [ ] - /services/{svc_id}/compliance/rulesets/{rset_id}: - delete: - operationId: DeleteServiceComplianceRuleset + post: + operationId: PostObsolescenceSetting description: | - Detach a ruleset from a service + Modify an obsolescence setting. Requires the ObsManager privilege. parameters: - in: path - name: svc_id + name: id required: true - description: Service identifier (svc_id UUID or svcname) + description: Obsolescence setting record id schema: type: string - - $ref: '#/components/parameters/inPathRsetId' - - in: query - name: slave - required: false - description: If true, detach from the encapsulated service - schema: - type: boolean - default: false + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + obs_warn_date: + type: string + description: Date from which nodes matching this setting are flagged as a warning. "YYYY-MM-DD" or "YYYY-MM-DD hh:mm:ss"; an empty string clears the date. + obs_alert_date: + type: string + description: Date from which nodes matching this setting are flagged as obsolete. "YYYY-MM-DD" or "YYYY-MM-DD hh:mm:ss"; an empty string clears the date. tags: - collector responses: - 202: - description: Ruleset detached + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ObsolescenceSettingListResponse' 400: $ref: '#/components/responses/400' 401: @@ -6043,71 +6372,53 @@ paths: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' - 409: - $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' security: - basicAuth: [ ] - bearerAuth: [ ] - post: - operationId: PostServiceComplianceRuleset + + delete: + operationId: DeleteObsolescenceSetting description: | - Attach a ruleset to a service + Delete an obsolescence setting. Requires the ObsManager privilege. parameters: - in: path - name: svc_id + name: id required: true - description: Service identifier (svc_id UUID or svcname) + description: Obsolescence setting record id schema: type: string - - $ref: '#/components/parameters/inPathRsetId' - - in: query - name: slave - required: false - description: If true, attach to the encapsulated service - schema: - type: boolean - default: false tags: - collector responses: - 202: - description: Ruleset attached - 400: - $ref: '#/components/responses/400' + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + info: + type: string 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' - 409: - $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' security: - basicAuth: [ ] - bearerAuth: [ ] - /services/{svc_id}/compliance/status: - get: - operationId: GetServiceComplianceStatus - description: List compliance modules last check run on the specified service - parameters: - - in: path - name: svc_id - required: true - description: Service identifier (svc_id UUID or svcname) - schema: - type: string - - $ref: '#/components/parameters/inQueryProps' - - $ref: '#/components/parameters/inQueryLimit' - - $ref: '#/components/parameters/inQueryOffset' - - $ref: '#/components/parameters/inQueryMeta' - - $ref: '#/components/parameters/inQueryStats' - - $ref: '#/components/parameters/inQueryOrderby' - - $ref: '#/components/parameters/inQueryGroupby' + /obsolescence/refresh: + put: + operationId: PutObsolescenceRefresh + description: | + Refresh the hardware models and os full names list in the obsolescence settings. + Requires the ObsManager privilege. tags: - collector responses: @@ -6116,35 +6427,25 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ListResponse' - 404: - $ref: '#/components/responses/404' + type: object + properties: + info: + type: string + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' 500: $ref: '#/components/responses/500' security: - basicAuth: [ ] - bearerAuth: [ ] - /services/{svc_id}/disks: + /openapi.json: get: - operationId: GetServiceDisks - description: List a service disks - parameters: - - in: path - name: svc_id - required: true - description: Service identifier (svc_id UUID or svcname) - schema: - type: string - - $ref: '#/components/parameters/inQueryProps' - - $ref: '#/components/parameters/inQueryLimit' - - $ref: '#/components/parameters/inQueryOffset' - - $ref: '#/components/parameters/inQueryMeta' - - $ref: '#/components/parameters/inQueryStats' - - $ref: '#/components/parameters/inQueryOrderby' - - $ref: '#/components/parameters/inQueryGroupby' + operationId: GetSwagger tags: - - collector + - public responses: 200: description: OK @@ -6152,31 +6453,29 @@ paths: application/json: schema: $ref: '#/components/schemas/ListResponse' - 404: - $ref: '#/components/responses/404' + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' 500: $ref: '#/components/responses/500' - security: - - basicAuth: [ ] - - bearerAuth: [ ] - /services/{svc_id}/resinfo: + /packages: get: - operationId: GetServiceResinfo - description: List a service resources info key/value pairs + operationId: GetPackages + description: | + List the packages installed on the nodes the user can see, with the + provider of their signing key. Ordered by node name, package name and + architecture by default. The `nodes.` properties come from the joined + nodes table. parameters: - - in: path - name: svc_id - required: true - description: Service identifier (svc_id UUID or svcname) - schema: - type: string - $ref: '#/components/parameters/inQueryProps' - $ref: '#/components/parameters/inQueryLimit' - $ref: '#/components/parameters/inQueryOffset' - $ref: '#/components/parameters/inQueryMeta' - $ref: '#/components/parameters/inQueryStats' - $ref: '#/components/parameters/inQueryOrderby' + - $ref: '#/components/parameters/inQueryFilter' - $ref: '#/components/parameters/inQueryGroupby' tags: - collector @@ -6186,33 +6485,44 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ListResponse' - 404: - $ref: '#/components/responses/404' + $ref: '#/components/schemas/PackageListResponse' + 401: + $ref: '#/components/responses/401' 500: $ref: '#/components/responses/500' security: - basicAuth: [ ] - bearerAuth: [ ] - /services/{svc_id}/candidate_tags: + /packages/diff: get: - operationId: GetServiceCandidateTags - description: List tags attachable to a service (not yet attached and not excluded) + operationId: GetPackagesDiff + description: | + List the differences in installed packages between nodes: the package + versions installed on some of the compared nodes but not on all of them, + one row per node having it. The nodes compared are the given nodes, plus + the nodes running the given services, or with `encap` the encapsulated + nodes of those services (the nodes named after their instances' + `mon_vmname`). Only the nodes and services of the apps the user's groups + are responsible for are compared, unless the user is a manager. + Fewer than two nodes is a 400, except with `encap`, which then returns an + empty list. parameters: - - in: path - name: svc_id - required: true - description: Service identifier (svc_id UUID or svcname) + - in: query + name: node_ids + description: A comma-separated list of node ids to compare schema: type: string - - $ref: '#/components/parameters/inQueryProps' - - $ref: '#/components/parameters/inQueryLimit' - - $ref: '#/components/parameters/inQueryOffset' - - $ref: '#/components/parameters/inQueryMeta' - - $ref: '#/components/parameters/inQueryStats' - - $ref: '#/components/parameters/inQueryOrderby' - - $ref: '#/components/parameters/inQueryGroupby' + - in: query + name: svc_ids + description: A comma-separated list of service ids whose nodes to compare + schema: + type: string + - in: query + name: encap + description: With svc_ids, compare the services' encapsulated nodes instead of their hosts + schema: + type: boolean tags: - collector responses: @@ -6221,32 +6531,29 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ListResponse' - 404: - $ref: '#/components/responses/404' + $ref: '#/components/schemas/PackagesDiffResponse' + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' 500: $ref: '#/components/responses/500' security: - basicAuth: [ ] - bearerAuth: [ ] - /services/{svc_id}/tags: + /services: get: - operationId: GetServiceTags - description: List tags attached to a service + operationId: GetServices + description: List services parameters: - - in: path - name: svc_id - required: true - description: Service identifier (svc_id UUID or svcname) - schema: - type: string - $ref: '#/components/parameters/inQueryProps' - $ref: '#/components/parameters/inQueryLimit' - $ref: '#/components/parameters/inQueryOffset' - $ref: '#/components/parameters/inQueryMeta' - $ref: '#/components/parameters/inQueryStats' - $ref: '#/components/parameters/inQueryOrderby' + - $ref: '#/components/parameters/inQueryFilter' - $ref: '#/components/parameters/inQueryGroupby' tags: - collector @@ -6256,36 +6563,88 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ListResponse' - 404: - $ref: '#/components/responses/404' + $ref: '#/components/schemas/ServiceListResponse' 500: $ref: '#/components/responses/500' security: - basicAuth: [ ] - bearerAuth: [ ] - /services_instances: - get: - operationId: GetServicesInstances - description: List services instances - parameters: - - $ref: '#/components/parameters/inQueryProps' - - $ref: '#/components/parameters/inQueryLimit' - - $ref: '#/components/parameters/inQueryOffset' - - $ref: '#/components/parameters/inQueryMeta' - - $ref: '#/components/parameters/inQueryStats' - - $ref: '#/components/parameters/inQueryOrderby' - - $ref: '#/components/parameters/inQueryGroupby' + post: + operationId: PostServices + description: Create or update a service (by svcname or svc_id) + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + svc_id: + type: string + svcname: + type: string + cluster_id: + type: string + svc_app: + type: string + svc_env: + type: string + svc_comment: + type: string + svc_nodes: + type: string + svc_drpnode: + type: string + svc_drpnodes: + type: string + svc_autostart: + type: string + svc_drptype: + type: string + svc_drnoaction: + type: string + svc_metrocluster: + type: string + svc_wave: + type: integer + svc_topology: + type: string + svc_flex_min_nodes: + type: integer + svc_flex_max_nodes: + type: integer + svc_flex_cpu_low_threshold: + type: integer + svc_flex_cpu_high_threshold: + type: integer + svc_ha: + type: string + svc_frozen: + type: string + svc_provisioned: + type: string + svc_placement: + type: string + svc_notifications: + type: boolean + svc_snooze_till: + type: string tags: - collector responses: 200: - description: OK + description: Service created or updated content: application/json: schema: - $ref: '#/components/schemas/ListResponse' + type: object + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' 500: $ref: '#/components/responses/500' security: @@ -6293,25 +6652,21 @@ paths: - bearerAuth: [ ] delete: - operationId: DeleteServicesInstances + operationId: DeleteServices description: | - Delete a service instance. + Delete a service. requestBody: required: true content: application/json: schema: type: object + required: + - svc_id properties: svc_id: type: string - description: Service id or name, to be used along with node_id - node_id: - type: string - description: Node id or name, to be used along with svc_id - id: - type: integer - description: Service instance record id, as an alternative to svc_id + node_id + description: Service id or name tags: - collector responses: @@ -6339,10 +6694,10 @@ paths: - bearerAuth: [ ] - /services_instances/{svc_id}: + /services/{svc_id}: get: - operationId: GetServicesInstance - description: List instances for a specific service (all nodes) + operationId: GetService + description: List entries for a specific service parameters: - in: path name: svc_id @@ -6365,7 +6720,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ListResponse' + $ref: '#/components/schemas/ServiceListResponse' 404: $ref: '#/components/responses/404' 500: @@ -6374,45 +6729,102 @@ paths: - basicAuth: [ ] - bearerAuth: [ ] - /services_instances_status_log: - get: - operationId: GetServicesInstancesStatusLog - description: List services instances status log. Each entry is a time range where a service instance status was stable. + post: + operationId: PostService + description: Update a service properties parameters: - - $ref: '#/components/parameters/inQueryProps' - - $ref: '#/components/parameters/inQueryLimit' - - $ref: '#/components/parameters/inQueryOffset' - - $ref: '#/components/parameters/inQueryMeta' - - $ref: '#/components/parameters/inQueryStats' - - $ref: '#/components/parameters/inQueryOrderby' - - $ref: '#/components/parameters/inQueryGroupby' + - in: path + name: svc_id + required: true + description: Service identifier (svc_id UUID or svcname) + schema: + type: string + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + svcname: + type: string + svc_app: + type: string + svc_env: + type: string + svc_comment: + type: string + svc_nodes: + type: string + svc_drpnode: + type: string + svc_drpnodes: + type: string + svc_autostart: + type: string + svc_drptype: + type: string + svc_drnoaction: + type: string + svc_metrocluster: + type: string + svc_wave: + type: integer + svc_topology: + type: string + svc_flex_min_nodes: + type: integer + svc_flex_max_nodes: + type: integer + svc_flex_cpu_low_threshold: + type: integer + svc_flex_cpu_high_threshold: + type: integer + svc_ha: + type: string + svc_frozen: + type: string + svc_provisioned: + type: string + svc_placement: + type: string + svc_notifications: + type: boolean + svc_snooze_till: + type: string tags: - collector responses: 200: - description: OK + description: Service updated content: application/json: schema: - $ref: '#/components/schemas/ListResponse' + type: object + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' 500: $ref: '#/components/responses/500' security: - basicAuth: [ ] - bearerAuth: [ ] - /services_status_log: - get: - operationId: GetServicesStatusLog - description: List services status log. Each entry is a time range where a service status was stable. + delete: + operationId: DeleteService + description: Delete an OpenSVC service and cascade delete its related entries. parameters: - - $ref: '#/components/parameters/inQueryProps' - - $ref: '#/components/parameters/inQueryLimit' - - $ref: '#/components/parameters/inQueryOffset' - - $ref: '#/components/parameters/inQueryMeta' - - $ref: '#/components/parameters/inQueryStats' - - $ref: '#/components/parameters/inQueryOrderby' - - $ref: '#/components/parameters/inQueryGroupby' + - in: path + name: svc_id + required: true + description: Service identifier (svc_id UUID or svcname) + schema: + type: string tags: - collector responses: @@ -6421,25 +6833,30 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ListResponse' + type: object + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' 500: $ref: '#/components/responses/500' security: - basicAuth: [ ] - bearerAuth: [ ] - /tags: + /services/{svc_id}/am_i_responsible: get: - operationId: GetTags - description: List existing tags + operationId: GetServiceAmIResponsible + description: Return true if the requester is responsible for this service. parameters: - - $ref: '#/components/parameters/inQueryProps' - - $ref: '#/components/parameters/inQueryLimit' - - $ref: '#/components/parameters/inQueryOffset' - - $ref: '#/components/parameters/inQueryMeta' - - $ref: '#/components/parameters/inQueryStats' - - $ref: '#/components/parameters/inQueryOrderby' - - $ref: '#/components/parameters/inQueryGroupby' + - in: path + name: svc_id + required: true + description: Service identifier (svc_id UUID or svcname) + schema: + type: string tags: - collector responses: @@ -6448,34 +6865,37 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ListResponse' + type: object + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' 500: $ref: '#/components/responses/500' security: - basicAuth: [ ] - bearerAuth: [ ] - post: - operationId: PostTags - description: | - Create a tag. - requestBody: - required: true - content: - application/json: - schema: - type: object - required: - - tag_name - properties: - tag_name: - type: string - tag_exclude: - type: string - description: Regular expression of tag names that can not be attached along with this tag - tag_data: - type: string - description: Free form JSON data attached to the tag + /services/{svc_id}/alerts: + get: + operationId: GetServiceAlerts + description: List a service alerts + parameters: + - in: path + name: svc_id + required: true + description: Service identifier (svc_id UUID or svcname) + schema: + type: string + - $ref: '#/components/parameters/inQueryProps' + - $ref: '#/components/parameters/inQueryLimit' + - $ref: '#/components/parameters/inQueryOffset' + - $ref: '#/components/parameters/inQueryMeta' + - $ref: '#/components/parameters/inQueryStats' + - $ref: '#/components/parameters/inQueryOrderby' + - $ref: '#/components/parameters/inQueryGroupby' tags: - collector responses: @@ -6485,36 +6905,32 @@ paths: application/json: schema: $ref: '#/components/schemas/ListResponse' - 400: - $ref: '#/components/responses/400' - 401: - $ref: '#/components/responses/401' - 403: - $ref: '#/components/responses/403' - 409: - $ref: '#/components/responses/409' + 404: + $ref: '#/components/responses/404' 500: $ref: '#/components/responses/500' security: - basicAuth: [ ] - bearerAuth: [ ] - delete: - operationId: DeleteTags - description: | - Delete a tag (bulk form). - requestBody: - required: true - content: - application/json: - schema: - type: object - required: - - tag_id - properties: - tag_id: - type: string - description: Tag tag_id, or tag record id + /services/{svc_id}/checks: + get: + operationId: GetServiceChecks + description: List a service checks + parameters: + - in: path + name: svc_id + required: true + description: Service identifier (svc_id UUID or svcname) + schema: + type: string + - $ref: '#/components/parameters/inQueryProps' + - $ref: '#/components/parameters/inQueryLimit' + - $ref: '#/components/parameters/inQueryOffset' + - $ref: '#/components/parameters/inQueryMeta' + - $ref: '#/components/parameters/inQueryStats' + - $ref: '#/components/parameters/inQueryOrderby' + - $ref: '#/components/parameters/inQueryGroupby' tags: - collector responses: @@ -6523,16 +6939,7 @@ paths: content: application/json: schema: - type: object - properties: - info: - type: string - 400: - $ref: '#/components/responses/400' - 401: - $ref: '#/components/responses/401' - 403: - $ref: '#/components/responses/403' + $ref: '#/components/schemas/ListResponse' 404: $ref: '#/components/responses/404' 500: @@ -6541,12 +6948,17 @@ paths: - basicAuth: [ ] - bearerAuth: [ ] - - /tags/nodes: + /services/{svc_id}/resources/logs: get: - operationId: GetTagsNodes - description: List all tag-node attachments + operationId: GetServiceResourceLogs + description: List a service resources state changes on all nodes parameters: + - in: path + name: svc_id + required: true + description: Service identifier (svc_id UUID or svcname) + schema: + type: string - $ref: '#/components/parameters/inQueryProps' - $ref: '#/components/parameters/inQueryLimit' - $ref: '#/components/parameters/inQueryOffset' @@ -6563,35 +6975,32 @@ paths: application/json: schema: $ref: '#/components/schemas/ListResponse' + 404: + $ref: '#/components/responses/404' 500: $ref: '#/components/responses/500' security: - basicAuth: [ ] - bearerAuth: [ ] - post: - operationId: PostTagsNodes - description: | - Attach a tag to a node. - requestBody: - required: true - content: - application/json: - schema: - type: object - required: - - tag_id - - node_id - properties: - tag_id: - type: string - description: Tag tag_id, or tag record id - node_id: - type: string - description: Node id - tag_attach_data: - type: string - description: Free form JSON data attached to the attachment + /services/{svc_id}/resources: + get: + operationId: GetServiceResources + description: List a service resources on all nodes + parameters: + - in: path + name: svc_id + required: true + description: Service identifier (svc_id UUID or svcname) + schema: + type: string + - $ref: '#/components/parameters/inQueryProps' + - $ref: '#/components/parameters/inQueryLimit' + - $ref: '#/components/parameters/inQueryOffset' + - $ref: '#/components/parameters/inQueryMeta' + - $ref: '#/components/parameters/inQueryStats' + - $ref: '#/components/parameters/inQueryOrderby' + - $ref: '#/components/parameters/inQueryGroupby' tags: - collector responses: @@ -6600,46 +7009,33 @@ paths: content: application/json: schema: - type: object - properties: - info: - type: string - 400: - $ref: '#/components/responses/400' - 401: - $ref: '#/components/responses/401' - 403: - $ref: '#/components/responses/403' + $ref: '#/components/schemas/ListResponse' 404: $ref: '#/components/responses/404' - 409: - $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' security: - basicAuth: [ ] - bearerAuth: [ ] - delete: - operationId: DeleteTagsNodes - description: | - Detach a tag from a node. - requestBody: - required: true - content: - application/json: - schema: - type: object - required: - - tag_id - - node_id - properties: - tag_id: - type: string - description: Tag tag_id, or tag record id - node_id: - type: string - description: Node id + /services/{svc_id}/nodes: + get: + operationId: GetServiceNodes + description: List a service instance status on each of its nodes + parameters: + - in: path + name: svc_id + required: true + description: Service identifier (svc_id UUID or svcname) + schema: + type: string + - $ref: '#/components/parameters/inQueryProps' + - $ref: '#/components/parameters/inQueryLimit' + - $ref: '#/components/parameters/inQueryOffset' + - $ref: '#/components/parameters/inQueryMeta' + - $ref: '#/components/parameters/inQueryStats' + - $ref: '#/components/parameters/inQueryOrderby' + - $ref: '#/components/parameters/inQueryGroupby' tags: - collector responses: @@ -6648,16 +7044,7 @@ paths: content: application/json: schema: - type: object - properties: - info: - type: string - 400: - $ref: '#/components/responses/400' - 401: - $ref: '#/components/responses/401' - 403: - $ref: '#/components/responses/403' + $ref: '#/components/schemas/ListResponse' 404: $ref: '#/components/responses/404' 500: @@ -6666,12 +7053,23 @@ paths: - basicAuth: [ ] - bearerAuth: [ ] - - /tags/services: + /services/{svc_id}/nodes/{node_id}: get: - operationId: GetTagsServices - description: List all tag-service attachments + operationId: GetServiceNode + description: Display service instance status on the specified node parameters: + - in: path + name: svc_id + required: true + description: Service identifier (svc_id UUID or svcname) + schema: + type: string + - in: path + name: node_id + required: true + description: Node identifier (node_id UUID or nodename) + schema: + type: string - $ref: '#/components/parameters/inQueryProps' - $ref: '#/components/parameters/inQueryLimit' - $ref: '#/components/parameters/inQueryOffset' @@ -6688,35 +7086,31 @@ paths: application/json: schema: $ref: '#/components/schemas/ListResponse' + 404: + $ref: '#/components/responses/404' 500: $ref: '#/components/responses/500' security: - basicAuth: [ ] - bearerAuth: [ ] - post: - operationId: PostTagsServices - description: | - Attach a tag to a service. - requestBody: - required: true - content: - application/json: - schema: - type: object - required: - - tag_id - - svc_id - properties: - tag_id: - type: string - description: Tag tag_id, or tag record id - svc_id: - type: string - description: Service id or name - tag_attach_data: - type: string - description: Free form JSON data attached to the attachment + /services/{svc_id}/instances/{node_id}: + delete: + operationId: DeleteServiceInstance + description: Delete a service instance and cascade to dashboard, resmon, resinfo and checks_live + parameters: + - in: path + name: svc_id + required: true + description: Service identifier (svc_id UUID or svcname) + schema: + type: string + - in: path + name: node_id + required: true + description: Node identifier (node_id UUID or nodename) + schema: + type: string tags: - collector responses: @@ -6726,45 +7120,41 @@ paths: application/json: schema: type: object - properties: - info: - type: string - 400: - $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' - 409: - $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' security: - basicAuth: [ ] - bearerAuth: [ ] - delete: - operationId: DeleteTagsServices - description: | - Detach a tag from a service. - requestBody: - required: true - content: - application/json: - schema: - type: object - required: - - tag_id - - svc_id - properties: - tag_id: - type: string - description: Tag tag_id, or tag record id - svc_id: - type: string - description: Service id or name + get: + operationId: GetServiceInstance + description: Display service instance details on the specified node + parameters: + - in: path + name: svc_id + required: true + description: Service identifier (svc_id UUID or svcname) + schema: + type: string + - in: path + name: node_id + required: true + description: Node identifier (node_id UUID or nodename) + schema: + type: string + - $ref: '#/components/parameters/inQueryProps' + - $ref: '#/components/parameters/inQueryLimit' + - $ref: '#/components/parameters/inQueryOffset' + - $ref: '#/components/parameters/inQueryMeta' + - $ref: '#/components/parameters/inQueryStats' + - $ref: '#/components/parameters/inQueryOrderby' + - $ref: '#/components/parameters/inQueryGroupby' tags: - collector responses: @@ -6773,16 +7163,7 @@ paths: content: application/json: schema: - type: object - properties: - info: - type: string - 400: - $ref: '#/components/responses/400' - 401: - $ref: '#/components/responses/401' - 403: - $ref: '#/components/responses/403' + $ref: '#/components/schemas/InstanceListResponse' 404: $ref: '#/components/responses/404' 500: @@ -6791,31 +7172,30 @@ paths: - basicAuth: [ ] - bearerAuth: [ ] - - /tags/{tag_id}: - post: - operationId: PostTag - description: Update a tag properties + /services/{svc_id}/nodes/{node_id}/resources: + get: + operationId: GetServiceNodeResources + description: Display service instance resources on the specified node parameters: - in: path - name: tag_id + name: svc_id required: true - description: ID of the tag + description: Service identifier (svc_id UUID or svcname) schema: - type: integer - requestBody: - required: true - content: - application/json: - schema: - type: object - properties: - tag_name: - type: string - tag_exclude: - type: string - tag_data: - type: string + type: string + - in: path + name: node_id + required: true + description: Node identifier (node_id UUID or nodename) + schema: + type: string + - $ref: '#/components/parameters/inQueryProps' + - $ref: '#/components/parameters/inQueryLimit' + - $ref: '#/components/parameters/inQueryOffset' + - $ref: '#/components/parameters/inQueryMeta' + - $ref: '#/components/parameters/inQueryStats' + - $ref: '#/components/parameters/inQueryOrderby' + - $ref: '#/components/parameters/inQueryGroupby' tags: - collector responses: @@ -6824,13 +7204,7 @@ paths: content: application/json: schema: - type: object - 400: - $ref: '#/components/responses/400' - 401: - $ref: '#/components/responses/401' - 403: - $ref: '#/components/responses/403' + $ref: '#/components/schemas/ListResponse' 404: $ref: '#/components/responses/404' 500: @@ -6838,16 +7212,31 @@ paths: security: - basicAuth: [ ] - bearerAuth: [ ] - delete: - operationId: DeleteTag - description: Delete the tag and its attachments to nodes and services + + /services/{svc_id}/nodes/{node_id}/resources/logs: + get: + operationId: GetServiceNodeResourceLogs + description: Display a service instance resources state changes on the specified node parameters: - in: path - name: tag_id + name: svc_id required: true - description: ID of the tag + description: Service identifier (svc_id UUID or svcname) schema: - type: integer + type: string + - in: path + name: node_id + required: true + description: Node identifier (node_id UUID or nodename) + schema: + type: string + - $ref: '#/components/parameters/inQueryProps' + - $ref: '#/components/parameters/inQueryLimit' + - $ref: '#/components/parameters/inQueryOffset' + - $ref: '#/components/parameters/inQueryMeta' + - $ref: '#/components/parameters/inQueryStats' + - $ref: '#/components/parameters/inQueryOrderby' + - $ref: '#/components/parameters/inQueryGroupby' tags: - collector responses: @@ -6856,11 +7245,7 @@ paths: content: application/json: schema: - type: object - 401: - $ref: '#/components/responses/401' - 403: - $ref: '#/components/responses/403' + $ref: '#/components/schemas/ListResponse' 404: $ref: '#/components/responses/404' 500: @@ -6868,17 +7253,25 @@ paths: security: - basicAuth: [ ] - bearerAuth: [ ] + + /services/{svc_id}/compliance/candidate_modulesets: get: - operationId: GetTag - description: Display tag property + operationId: GetServiceComplianceCandidateModulesets + description: List compliance modulesets attachable to the specified service parameters: - in: path - name: tag_id + name: svc_id required: true - description: ID of the tag + description: Service identifier (svc_id UUID or svcname) schema: - type: integer + type: string - $ref: '#/components/parameters/inQueryProps' + - $ref: '#/components/parameters/inQueryLimit' + - $ref: '#/components/parameters/inQueryOffset' + - $ref: '#/components/parameters/inQueryMeta' + - $ref: '#/components/parameters/inQueryStats' + - $ref: '#/components/parameters/inQueryOrderby' + - $ref: '#/components/parameters/inQueryGroupby' tags: - collector responses: @@ -6887,7 +7280,7 @@ paths: content: application/json: schema: - type: object + $ref: '#/components/schemas/ListResponse' 404: $ref: '#/components/responses/404' 500: @@ -6896,108 +7289,109 @@ paths: - basicAuth: [ ] - bearerAuth: [ ] - /tags/{tag_id}/nodes: + /services/{svc_id}/compliance/candidate_rulesets: get: - operationId: GetTagNodes - description: Get nodes where the tag is attached + operationId: GetServiceComplianceCandidateRulesets + description: List compliance rulesets attachable to the specified service parameters: - in: path - name: tag_id + name: svc_id required: true - description: ID of the tag + description: Service identifier (svc_id UUID or svcname) schema: - type: integer + type: string + - in: query + name: slave + required: false + description: If true, list rulesets attachable to the encapsulated service + schema: + type: boolean + default: false - $ref: '#/components/parameters/inQueryProps' - $ref: '#/components/parameters/inQueryLimit' - $ref: '#/components/parameters/inQueryOffset' + - $ref: '#/components/parameters/inQueryMeta' + - $ref: '#/components/parameters/inQueryStats' + - $ref: '#/components/parameters/inQueryOrderby' + - $ref: '#/components/parameters/inQueryGroupby' tags: - collector responses: 200: - description: List of nodes with this tag + description: OK content: application/json: schema: - type: array - items: - type: object + $ref: '#/components/schemas/ListResponse' 404: - description: Tag not found + $ref: '#/components/responses/404' 500: $ref: '#/components/responses/500' security: - basicAuth: [ ] - bearerAuth: [ ] - /tags/{tag_id}/nodes/{node_id}: - post: - operationId: PostTagNode - description: Attach a tag to a node + /services/{svc_id}/compliance/logs: + get: + description: | + Get compliance logs for a service + operationId: GetServiceComplianceLogs parameters: - in: path - name: tag_id - required: true - description: ID of the tag - schema: - type: integer - - in: path - name: node_id + name: svc_id required: true - description: ID of the node + description: Service identifier (svc_id UUID or svcname) schema: type: string - requestBody: - required: false - content: - application/json: - schema: - type: object - properties: - tag_attach_data: - type: string - tags: - - collector + - $ref: '#/components/parameters/inQueryProps' + - $ref: '#/components/parameters/inQueryLimit' + - $ref: '#/components/parameters/inQueryOffset' + - $ref: '#/components/parameters/inQueryMeta' + - $ref: '#/components/parameters/inQueryStats' + - $ref: '#/components/parameters/inQueryOrderby' + - $ref: '#/components/parameters/inQueryGroupby' responses: 200: - description: OK + description: Compliance logs for the service content: application/json: schema: - type: object - properties: - info: - type: string - 400: - $ref: '#/components/responses/400' - 401: - $ref: '#/components/responses/401' - 403: - $ref: '#/components/responses/403' + $ref: '#/components/schemas/ListResponse' 404: $ref: '#/components/responses/404' - 409: - $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' security: - basicAuth: [ ] - bearerAuth: [ ] - delete: - operationId: DeleteTagNode - description: Detach a tag from a node + tags: + - collector + + /services/{svc_id}/compliance/modulesets: + get: + operationId: GetServiceComplianceModulesets + description: List compliance modulesets attached to the specified service parameters: - in: path - name: tag_id - required: true - description: ID of the tag - schema: - type: integer - - in: path - name: node_id + name: svc_id required: true - description: ID of the node + description: Service identifier (svc_id UUID or svcname) schema: type: string + - in: query + name: slave + required: false + description: If true, list modulesets attached to the encapsulated service + schema: + type: boolean + default: false + - $ref: '#/components/parameters/inQueryProps' + - $ref: '#/components/parameters/inQueryLimit' + - $ref: '#/components/parameters/inQueryOffset' + - $ref: '#/components/parameters/inQueryMeta' + - $ref: '#/components/parameters/inQueryStats' + - $ref: '#/components/parameters/inQueryOrderby' + - $ref: '#/components/parameters/inQueryGroupby' tags: - collector responses: @@ -7006,14 +7400,7 @@ paths: content: application/json: schema: - type: object - properties: - info: - type: string - 401: - $ref: '#/components/responses/401' - 403: - $ref: '#/components/responses/403' + $ref: '#/components/schemas/ListResponse' 404: $ref: '#/components/responses/404' 500: @@ -7022,44 +7409,31 @@ paths: - basicAuth: [ ] - bearerAuth: [ ] - /tags/{tag_id}/services/{svc_id}: - post: - operationId: PostTagService - description: Attach a tag to a service + /services/{svc_id}/compliance/modulesets/{mset_id}: + delete: + operationId: DeleteServiceComplianceModuleset + description: | + Detach a moduleset from a service parameters: - - in: path - name: tag_id - required: true - description: ID of the tag - schema: - type: integer - in: path name: svc_id required: true - description: ID or name of the service + description: Service identifier (svc_id UUID or svcname) schema: type: string - requestBody: - required: false - content: - application/json: - schema: - type: object - properties: - tag_attach_data: - type: string + - $ref: '#/components/parameters/inPathMsetId' + - in: query + name: slave + required: false + description: If true, detach from the encapsulated service + schema: + type: boolean + default: false tags: - collector responses: - 200: - description: OK - content: - application/json: - schema: - type: object - properties: - info: - type: string + 202: + description: Moduleset detached 400: $ref: '#/components/responses/400' 401: @@ -7075,57 +7449,64 @@ paths: security: - basicAuth: [ ] - bearerAuth: [ ] - delete: - operationId: DeleteTagService - description: Detach a tag from a service + post: + operationId: PostServiceComplianceModuleset + description: | + Attach a moduleset to a service parameters: - - in: path - name: tag_id - required: true - description: ID of the tag - schema: - type: integer - in: path name: svc_id required: true - description: ID or name of the service + description: Service identifier (svc_id UUID or svcname) schema: type: string + - $ref: '#/components/parameters/inPathMsetId' + - in: query + name: slave + required: false + description: If true, attach to the encapsulated service + schema: + type: boolean + default: false tags: - collector responses: - 200: - description: OK - content: - application/json: - schema: - type: object - properties: - info: - type: string + 202: + description: Moduleset attached + 400: + $ref: '#/components/responses/400' 401: $ref: '#/components/responses/401' 403: $ref: '#/components/responses/403' 404: $ref: '#/components/responses/404' + 409: + $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' security: - basicAuth: [ ] - bearerAuth: [ ] - /tags/{tag_id}/services: + /services/{svc_id}/compliance/rulesets: get: - operationId: GetTagServices - description: List services where the tag is attached + operationId: GetServiceComplianceRulesets + description: List compliance rulesets attached to the specified service parameters: - in: path - name: tag_id + name: svc_id required: true - description: ID of the tag + description: Service identifier (svc_id UUID or svcname) schema: - type: integer + type: string + - in: query + name: slave + required: false + description: If true, list rulesets attached to the encapsulated service + schema: + type: boolean + default: false - $ref: '#/components/parameters/inQueryProps' - $ref: '#/components/parameters/inQueryLimit' - $ref: '#/components/parameters/inQueryOffset' @@ -7150,107 +7531,7377 @@ paths: - basicAuth: [ ] - bearerAuth: [ ] - /version: - get: - operationId: GetVersion - description: return api version + /services/{svc_id}/compliance/rulesets/{rset_id}: + delete: + operationId: DeleteServiceComplianceRuleset + description: | + Detach a ruleset from a service + parameters: + - in: path + name: svc_id + required: true + description: Service identifier (svc_id UUID or svcname) + schema: + type: string + - $ref: '#/components/parameters/inPathRsetId' + - in: query + name: slave + required: false + description: If true, detach from the encapsulated service + schema: + type: boolean + default: false tags: - - capabilities + - collector responses: - 200: - description: OK - content: - application/json: - schema: - $ref: '#/components/schemas/version' + 202: + description: Ruleset detached + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' + 409: + $ref: '#/components/responses/409' 500: $ref: '#/components/responses/500' - -components: - - responses: - '200': - description: OK - content: - application/json: + security: + - basicAuth: [ ] + - bearerAuth: [ ] + post: + operationId: PostServiceComplianceRuleset + description: | + Attach a ruleset to a service + parameters: + - in: path + name: svc_id + required: true + description: Service identifier (svc_id UUID or svcname) schema: - $ref: "#/components/schemas/Problem" - '204': - description: No Content - '400': - description: Bad Request - content: - application/json: + type: string + - $ref: '#/components/parameters/inPathRsetId' + - in: query + name: slave + required: false + description: If true, attach to the encapsulated service schema: - $ref: "#/components/schemas/Problem" - '401': - description: Unauthorized - content: - application/json: - schema: - $ref: "#/components/schemas/Problem" - '403': - description: Forbidden - content: - application/json: - schema: - $ref: "#/components/schemas/Problem" - '404': - description: Not Found - content: - application/json: + type: boolean + default: false + tags: + - collector + responses: + 202: + description: Ruleset attached + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' + 409: + $ref: '#/components/responses/409' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + + /services/{svc_id}/compliance/status: + get: + operationId: GetServiceComplianceStatus + description: List compliance modules last check run on the specified service + parameters: + - in: path + name: svc_id + required: true + description: Service identifier (svc_id UUID or svcname) schema: - $ref: "#/components/schemas/Problem" - '408': - description: Request Timeout - content: - application/json: + type: string + - $ref: '#/components/parameters/inQueryProps' + - $ref: '#/components/parameters/inQueryLimit' + - $ref: '#/components/parameters/inQueryOffset' + - $ref: '#/components/parameters/inQueryMeta' + - $ref: '#/components/parameters/inQueryStats' + - $ref: '#/components/parameters/inQueryOrderby' + - $ref: '#/components/parameters/inQueryGroupby' + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ListResponse' + 404: + $ref: '#/components/responses/404' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + + /services/{svc_id}/disks: + get: + operationId: GetServiceDisks + description: List a service disks + parameters: + - in: path + name: svc_id + required: true + description: Service identifier (svc_id UUID or svcname) schema: - $ref: "#/components/schemas/Problem" - '409': - description: Conflict - content: - application/json: + type: string + - $ref: '#/components/parameters/inQueryProps' + - $ref: '#/components/parameters/inQueryLimit' + - $ref: '#/components/parameters/inQueryOffset' + - $ref: '#/components/parameters/inQueryMeta' + - $ref: '#/components/parameters/inQueryStats' + - $ref: '#/components/parameters/inQueryOrderby' + - $ref: '#/components/parameters/inQueryGroupby' + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/DiskListResponse' + 404: + $ref: '#/components/responses/404' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + + /services/{svc_id}/resinfo: + get: + operationId: GetServiceResinfo + description: List a service resources info key/value pairs + parameters: + - in: path + name: svc_id + required: true + description: Service identifier (svc_id UUID or svcname) schema: - $ref: "#/components/schemas/Problem" - '500': - description: Internal Server Error - content: - application/json: + type: string + - $ref: '#/components/parameters/inQueryProps' + - $ref: '#/components/parameters/inQueryLimit' + - $ref: '#/components/parameters/inQueryOffset' + - $ref: '#/components/parameters/inQueryMeta' + - $ref: '#/components/parameters/inQueryStats' + - $ref: '#/components/parameters/inQueryOrderby' + - $ref: '#/components/parameters/inQueryGroupby' + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ListResponse' + 404: + $ref: '#/components/responses/404' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + + /services/{svc_id}/candidate_tags: + get: + operationId: GetServiceCandidateTags + description: List tags attachable to a service (not yet attached and not excluded) + parameters: + - in: path + name: svc_id + required: true + description: Service identifier (svc_id UUID or svcname) schema: - $ref: "#/components/schemas/Problem" - '503': - description: Service Unavailable - content: - application/json: + type: string + - $ref: '#/components/parameters/inQueryProps' + - $ref: '#/components/parameters/inQueryLimit' + - $ref: '#/components/parameters/inQueryOffset' + - $ref: '#/components/parameters/inQueryMeta' + - $ref: '#/components/parameters/inQueryStats' + - $ref: '#/components/parameters/inQueryOrderby' + - $ref: '#/components/parameters/inQueryGroupby' + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ListResponse' + 404: + $ref: '#/components/responses/404' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + + /services/{svc_id}/tags: + get: + operationId: GetServiceTags + description: List tags attached to a service + parameters: + - in: path + name: svc_id + required: true + description: Service identifier (svc_id UUID or svcname) schema: - $ref: "#/components/schemas/Problem" + type: string + - $ref: '#/components/parameters/inQueryProps' + - $ref: '#/components/parameters/inQueryLimit' + - $ref: '#/components/parameters/inQueryOffset' + - $ref: '#/components/parameters/inQueryMeta' + - $ref: '#/components/parameters/inQueryStats' + - $ref: '#/components/parameters/inQueryOrderby' + - $ref: '#/components/parameters/inQueryGroupby' + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ListResponse' + 404: + $ref: '#/components/responses/404' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + + /services_instances: + get: + operationId: GetServicesInstances + description: List services instances + parameters: + - $ref: '#/components/parameters/inQueryProps' + - $ref: '#/components/parameters/inQueryLimit' + - $ref: '#/components/parameters/inQueryOffset' + - $ref: '#/components/parameters/inQueryMeta' + - $ref: '#/components/parameters/inQueryStats' + - $ref: '#/components/parameters/inQueryOrderby' + - $ref: '#/components/parameters/inQueryFilter' + - $ref: '#/components/parameters/inQueryGroupby' + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/InstanceListResponse' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + + delete: + operationId: DeleteServicesInstances + description: | + Delete a service instance. + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + svc_id: + type: string + description: Service id or name, to be used along with node_id + node_id: + type: string + description: Node id or name, to be used along with svc_id + id: + type: integer + description: Service instance record id, as an alternative to svc_id + node_id + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + info: + type: string + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + + + /services_instances/{svc_id}: + get: + operationId: GetServicesInstance + description: List instances for a specific service (all nodes) + parameters: + - in: path + name: svc_id + required: true + description: Service identifier (svc_id UUID or svcname) + schema: + type: string + - $ref: '#/components/parameters/inQueryProps' + - $ref: '#/components/parameters/inQueryLimit' + - $ref: '#/components/parameters/inQueryOffset' + - $ref: '#/components/parameters/inQueryMeta' + - $ref: '#/components/parameters/inQueryStats' + - $ref: '#/components/parameters/inQueryOrderby' + - $ref: '#/components/parameters/inQueryGroupby' + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/InstanceListResponse' + 404: + $ref: '#/components/responses/404' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + + /services_instances_status_log: + get: + operationId: GetServicesInstancesStatusLog + description: List services instances status log. Each entry is a time range where a service instance status was stable. + parameters: + - $ref: '#/components/parameters/inQueryProps' + - $ref: '#/components/parameters/inQueryLimit' + - $ref: '#/components/parameters/inQueryOffset' + - $ref: '#/components/parameters/inQueryMeta' + - $ref: '#/components/parameters/inQueryStats' + - $ref: '#/components/parameters/inQueryOrderby' + - $ref: '#/components/parameters/inQueryGroupby' + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ListResponse' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + + /services_status_log: + get: + operationId: GetServicesStatusLog + description: List services status log. Each entry is a time range where a service status was stable. + parameters: + - $ref: '#/components/parameters/inQueryProps' + - $ref: '#/components/parameters/inQueryLimit' + - $ref: '#/components/parameters/inQueryOffset' + - $ref: '#/components/parameters/inQueryMeta' + - $ref: '#/components/parameters/inQueryStats' + - $ref: '#/components/parameters/inQueryOrderby' + - $ref: '#/components/parameters/inQueryGroupby' + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ListResponse' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + + /tags: + get: + operationId: GetTags + description: List existing tags + parameters: + - $ref: '#/components/parameters/inQueryProps' + - $ref: '#/components/parameters/inQueryLimit' + - $ref: '#/components/parameters/inQueryOffset' + - $ref: '#/components/parameters/inQueryMeta' + - $ref: '#/components/parameters/inQueryStats' + - $ref: '#/components/parameters/inQueryOrderby' + - $ref: '#/components/parameters/inQueryGroupby' + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ListResponse' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + + post: + operationId: PostTags + description: | + Create a tag. + requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - tag_name + properties: + tag_name: + type: string + tag_exclude: + type: string + description: Regular expression of tag names that can not be attached along with this tag + tag_data: + type: string + description: Free form JSON data attached to the tag + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ListResponse' + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 409: + $ref: '#/components/responses/409' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + + delete: + operationId: DeleteTags + description: | + Delete a tag (bulk form). + requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - tag_id + properties: + tag_id: + type: string + description: Tag tag_id, or tag record id + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + info: + type: string + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + + + /tags/nodes: + get: + operationId: GetTagsNodes + description: List all tag-node attachments + parameters: + - $ref: '#/components/parameters/inQueryProps' + - $ref: '#/components/parameters/inQueryLimit' + - $ref: '#/components/parameters/inQueryOffset' + - $ref: '#/components/parameters/inQueryMeta' + - $ref: '#/components/parameters/inQueryStats' + - $ref: '#/components/parameters/inQueryOrderby' + - $ref: '#/components/parameters/inQueryGroupby' + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ListResponse' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + + post: + operationId: PostTagsNodes + description: | + Attach a tag to a node. + requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - tag_id + - node_id + properties: + tag_id: + type: string + description: Tag tag_id, or tag record id + node_id: + type: string + description: Node id + tag_attach_data: + type: string + description: Free form JSON data attached to the attachment + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + info: + type: string + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' + 409: + $ref: '#/components/responses/409' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + + delete: + operationId: DeleteTagsNodes + description: | + Detach a tag from a node. + requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - tag_id + - node_id + properties: + tag_id: + type: string + description: Tag tag_id, or tag record id + node_id: + type: string + description: Node id + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + info: + type: string + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + + + /tags/services: + get: + operationId: GetTagsServices + description: List all tag-service attachments + parameters: + - $ref: '#/components/parameters/inQueryProps' + - $ref: '#/components/parameters/inQueryLimit' + - $ref: '#/components/parameters/inQueryOffset' + - $ref: '#/components/parameters/inQueryMeta' + - $ref: '#/components/parameters/inQueryStats' + - $ref: '#/components/parameters/inQueryOrderby' + - $ref: '#/components/parameters/inQueryGroupby' + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ListResponse' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + + post: + operationId: PostTagsServices + description: | + Attach a tag to a service. + requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - tag_id + - svc_id + properties: + tag_id: + type: string + description: Tag tag_id, or tag record id + svc_id: + type: string + description: Service id or name + tag_attach_data: + type: string + description: Free form JSON data attached to the attachment + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + info: + type: string + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' + 409: + $ref: '#/components/responses/409' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + + delete: + operationId: DeleteTagsServices + description: | + Detach a tag from a service. + requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - tag_id + - svc_id + properties: + tag_id: + type: string + description: Tag tag_id, or tag record id + svc_id: + type: string + description: Service id or name + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + info: + type: string + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + + + /tags/{tag_id}: + post: + operationId: PostTag + description: Update a tag properties + parameters: + - in: path + name: tag_id + required: true + description: ID of the tag + schema: + type: integer + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + tag_name: + type: string + tag_exclude: + type: string + tag_data: + type: string + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + delete: + operationId: DeleteTag + description: Delete the tag and its attachments to nodes and services + parameters: + - in: path + name: tag_id + required: true + description: ID of the tag + schema: + type: integer + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + get: + operationId: GetTag + description: Display tag property + parameters: + - in: path + name: tag_id + required: true + description: ID of the tag + schema: + type: integer + - $ref: '#/components/parameters/inQueryProps' + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + 404: + $ref: '#/components/responses/404' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + + /tags/{tag_id}/nodes: + get: + operationId: GetTagNodes + description: Get nodes where the tag is attached + parameters: + - in: path + name: tag_id + required: true + description: ID of the tag + schema: + type: integer + - $ref: '#/components/parameters/inQueryProps' + - $ref: '#/components/parameters/inQueryLimit' + - $ref: '#/components/parameters/inQueryOffset' + tags: + - collector + responses: + 200: + description: List of nodes with this tag + content: + application/json: + schema: + type: array + items: + type: object + 404: + description: Tag not found + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + + /tags/{tag_id}/nodes/{node_id}: + post: + operationId: PostTagNode + description: Attach a tag to a node + parameters: + - in: path + name: tag_id + required: true + description: ID of the tag + schema: + type: integer + - in: path + name: node_id + required: true + description: ID of the node + schema: + type: string + requestBody: + required: false + content: + application/json: + schema: + type: object + properties: + tag_attach_data: + type: string + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + info: + type: string + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' + 409: + $ref: '#/components/responses/409' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + delete: + operationId: DeleteTagNode + description: Detach a tag from a node + parameters: + - in: path + name: tag_id + required: true + description: ID of the tag + schema: + type: integer + - in: path + name: node_id + required: true + description: ID of the node + schema: + type: string + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + info: + type: string + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + + /tags/{tag_id}/services/{svc_id}: + post: + operationId: PostTagService + description: Attach a tag to a service + parameters: + - in: path + name: tag_id + required: true + description: ID of the tag + schema: + type: integer + - in: path + name: svc_id + required: true + description: ID or name of the service + schema: + type: string + requestBody: + required: false + content: + application/json: + schema: + type: object + properties: + tag_attach_data: + type: string + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + info: + type: string + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' + 409: + $ref: '#/components/responses/409' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + delete: + operationId: DeleteTagService + description: Detach a tag from a service + parameters: + - in: path + name: tag_id + required: true + description: ID of the tag + schema: + type: integer + - in: path + name: svc_id + required: true + description: ID or name of the service + schema: + type: string + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + info: + type: string + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + + /tags/{tag_id}/services: + get: + operationId: GetTagServices + description: List services where the tag is attached + parameters: + - in: path + name: tag_id + required: true + description: ID of the tag + schema: + type: integer + - $ref: '#/components/parameters/inQueryProps' + - $ref: '#/components/parameters/inQueryLimit' + - $ref: '#/components/parameters/inQueryOffset' + - $ref: '#/components/parameters/inQueryMeta' + - $ref: '#/components/parameters/inQueryStats' + - $ref: '#/components/parameters/inQueryOrderby' + - $ref: '#/components/parameters/inQueryGroupby' + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ListResponse' + 404: + $ref: '#/components/responses/404' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + + /users: + get: + operationId: GetUsers + description: | + List existing users. Managers and UserManager can see all users; other + users only see the users sharing one of their organisational groups, + plus themselves. + parameters: + - $ref: '#/components/parameters/inQueryProps' + - $ref: '#/components/parameters/inQueryLimit' + - $ref: '#/components/parameters/inQueryOffset' + - $ref: '#/components/parameters/inQueryMeta' + - $ref: '#/components/parameters/inQueryStats' + - $ref: '#/components/parameters/inQueryOrderby' + - $ref: '#/components/parameters/inQueryGroupby' + - $ref: '#/components/parameters/inQueryFilter' + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/UserListResponse' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + + post: + operationId: PostUsers + description: | + Create a user, with its private group "user_". Requires the UserManager + privilege. An email or username already in use is refused with a 409. Without + a password the account exists but cannot sign in. + requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - email + properties: + email: + type: string + username: + type: string + first_name: + type: string + last_name: + type: string + phone_work: + type: string + password: + type: string + description: At least 8 characters. Stored as a web2py hash. + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/UserListResponse' + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 409: + $ref: '#/components/responses/409' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + + /users/self/password: + post: + operationId: PostUserSelfPassword + description: | + Change the password of the signed-in user, who gives the current one. The new + password must be at least 12 characters long and differ from the current one; + it is stored as a web2py hash, accepted by both collectors. The change is + logged, without the password. Requires user authentication, no privilege. + requestBody: + required: true + content: + application/json: + schema: + type: object + required: [current_password, new_password] + properties: + current_password: + type: string + new_password: + type: string + minLength: 12 + description: At least 12 characters. + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + info: + type: string + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + + /users/{user_id}: + get: + operationId: GetUser + description: | + Display user properties. Managers and UserManager can see all users; + other users only see the users sharing one of their organisational + groups, plus themselves. + parameters: + - in: path + name: user_id + required: true + description: | + User identifier: auth_user.id, the user email when it contains an + "@", or "self" for the authenticated user. + schema: + type: string + - $ref: '#/components/parameters/inQueryProps' + - $ref: '#/components/parameters/inQueryLimit' + - $ref: '#/components/parameters/inQueryOffset' + - $ref: '#/components/parameters/inQueryMeta' + - $ref: '#/components/parameters/inQueryStats' + - $ref: '#/components/parameters/inQueryOrderby' + - $ref: '#/components/parameters/inQueryGroupby' + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/UserListResponse' + 404: + $ref: '#/components/responses/404' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + post: + operationId: PostUser + description: | + Change the first name, last name or email of a user. Any signed-in user may + change their own, as the profile form of the historical collector allows; + another user's requires the UserManager privilege (or Manager), else 403. + Only the keys given are changed; names are trimmed, at most 128 + characters, and may be empty. The email must be a valid address, at most 512 + characters, not used by another user (409): it is the sign-in name, so the + next requests must authenticate with it. The change is logged with the fields + changed. Requires user authentication. Returns the user. + parameters: + - in: path + name: user_id + required: true + description: | + User identifier: auth_user.id, the user email when it contains an + "@", or "self" for the authenticated user. + schema: + type: string + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + first_name: + type: string + maxLength: 128 + last_name: + type: string + maxLength: 128 + email: + type: string + maxLength: 512 + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/UserListResponse' + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' + 409: + $ref: '#/components/responses/409' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + + /users/{user_id}/prefs: + get: + operationId: GetUserPrefs + description: | + Fetch the user preferences: visible columns, column filters, live mode + enabled flag, hidden group entries, ... + + Returns an empty object when the user has no preferences stored, and + also when the user does not exist or is not visible to the caller. + parameters: + - in: path + name: user_id + required: true + description: | + User identifier: auth_user.id, the user email when it contains an + "@", or "self" for the authenticated user. + schema: + type: string + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/UserPrefsResponse' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + + post: + operationId: PostUserPrefs + description: | + Save the user preferences: visible columns, column filters, live mode + enabled flag, hidden group entries, ... + parameters: + - in: path + name: user_id + required: true + description: | + User identifier: auth_user.id, the user email when it contains an + "@", or "self" for the authenticated user. + schema: + type: string + requestBody: + required: true + content: + application/json: + schema: + type: object + required: + - data + properties: + data: + type: object + additionalProperties: true + description: The preferences object, stored verbatim. + uuid: + type: string + description: | + Opaque sender identifier echoed in the user_prefs_change + event, so a client can ignore its own update. + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/InfoResponse' + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + + /version: + get: + operationId: GetVersion + description: return api version + tags: + - capabilities + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/version' + 500: + $ref: '#/components/responses/500' + + /workflows: + get: + operationId: GetWorkflows + description: | + List the requests: the workflows started by the submission of a form with a + workflow output. As the historical API, + every workflow is listed to any authenticated user. `form_name`, + `form_folder` and `form_yaml` are those of the form revision the request + started from. + parameters: + - $ref: '#/components/parameters/inQueryProps' + - $ref: '#/components/parameters/inQueryLimit' + - $ref: '#/components/parameters/inQueryOffset' + - $ref: '#/components/parameters/inQueryMeta' + - $ref: '#/components/parameters/inQueryStats' + - $ref: '#/components/parameters/inQueryOrderby' + - $ref: '#/components/parameters/inQueryFilter' + - $ref: '#/components/parameters/inQueryGroupby' + - in: query + name: assigned + description: | + Keep the pending workflows (status not closed) related to the caller's + team, the caller's full name and the roles of their non-privilege + groups: `team` those whose last assignee is in the team, as the + historical "Assigned to my team"; `tiers` those created by the team and + assigned to someone else, as the historical "Pending tiers action". + schema: + type: string + enum: [team, tiers] + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/WorkflowListResponse' + 401: + $ref: '#/components/responses/401' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + + /compliance/logs: + get: + operationId: GetComplianceLogs + description: | + List the compliance modules' check, fixable and fix runs of the nodes the + user can see: those whose app is published to one of the user's groups, every + node for a manager. The most recent first by default. The nodes.* and + services.* props give the node and service names. + parameters: + - in: query + name: fset_id + required: false + description: Restrict to the runs of the nodes this filterset selects (gen_filtersets.id or fset_name) + schema: + type: string + - $ref: '#/components/parameters/inQueryProps' + - $ref: '#/components/parameters/inQueryLimit' + - $ref: '#/components/parameters/inQueryOffset' + - $ref: '#/components/parameters/inQueryMeta' + - $ref: '#/components/parameters/inQueryStats' + - $ref: '#/components/parameters/inQueryOrderby' + - $ref: '#/components/parameters/inQueryFilter' + - $ref: '#/components/parameters/inQueryGroupby' + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ComplianceLogListResponse' + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + + /compliance/logs/{log_id}: + get: + operationId: GetComplianceLog + description: | + Display the properties of a module run. + parameters: + - in: path + name: log_id + required: true + description: Id of the run (comp_log.id) + schema: + type: string + - $ref: '#/components/parameters/inQueryProps' + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ComplianceLogListResponse' + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 404: + $ref: '#/components/responses/404' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + + /compliance/status: + get: + operationId: GetComplianceStatus + description: | + List the last check run of each module-node-service tuple, for the nodes the + user can see: those whose app is published to one of the user's groups, every + node for a manager. + parameters: + - $ref: '#/components/parameters/inQueryProps' + - $ref: '#/components/parameters/inQueryLimit' + - $ref: '#/components/parameters/inQueryOffset' + - $ref: '#/components/parameters/inQueryMeta' + - $ref: '#/components/parameters/inQueryStats' + - $ref: '#/components/parameters/inQueryOrderby' + - $ref: '#/components/parameters/inQueryFilter' + - $ref: '#/components/parameters/inQueryGroupby' + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ComplianceStatusListResponse' + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + delete: + operationId: DeleteComplianceStatus + description: | + Delete the last check run of a module-node-service tuple, named by the `id` + key of the body. Requires the CompExec privilege and the responsibility of the + node. The deletion is logged. + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + id: + type: integer + description: Id of the run (comp_status.id) + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + info: + type: string + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + + /compliance/status/{status_id}: + get: + operationId: GetComplianceStatusRun + description: | + Display the last check run of a module-node-service tuple. + parameters: + - in: path + name: status_id + required: true + description: Id of the run (comp_status.id) + schema: + type: string + - $ref: '#/components/parameters/inQueryProps' + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ComplianceStatusListResponse' + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 404: + $ref: '#/components/responses/404' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + delete: + operationId: DeleteComplianceStatusRun + description: | + Delete the last check run of a module-node-service tuple. Requires the + CompExec privilege and the responsibility of the node. The deletion is logged. + parameters: + - in: path + name: status_id + required: true + description: Id of the run (comp_status.id) + schema: + type: string + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + info: + type: string + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + + /compliance/rulesets: + get: + operationId: GetComplianceRulesets + description: | + List the rulesets published to one of the user's groups, every ruleset for a + manager. + parameters: + - $ref: '#/components/parameters/inQueryProps' + - $ref: '#/components/parameters/inQueryLimit' + - $ref: '#/components/parameters/inQueryOffset' + - $ref: '#/components/parameters/inQueryMeta' + - $ref: '#/components/parameters/inQueryStats' + - $ref: '#/components/parameters/inQueryOrderby' + - $ref: '#/components/parameters/inQueryFilter' + - $ref: '#/components/parameters/inQueryGroupby' + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/RulesetListResponse' + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + post: + operationId: PostComplianceRulesets + description: | + Create a ruleset named ruleset_name, of type explicit and public unless given, + published to and under the responsibility of the user's default group (the + Manager group without one). When a ruleset of that name exists, its other given + properties are updated instead, as POST /compliance/rulesets/{rset_id}. + Requires the CompManager privilege. The change is logged and the ruleset chains + are rebuilt. + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + ruleset_name: + type: string + ruleset_type: + type: string + enum: [explicit, contextual] + ruleset_public: + description: A boolean, or "T" / "F" as stored. + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/RulesetListResponse' + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 409: + $ref: '#/components/responses/409' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + delete: + operationId: DeleteComplianceRulesets + description: | + Delete the ruleset named by the id key of the body, as + DELETE /compliance/rulesets/{rset_id}. + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + id: + description: Ruleset id or name + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + info: + type: string + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + + /compliance/rulesets/{rset_id}: + get: + operationId: GetComplianceRuleset + description: | + Display a ruleset published to one of the user's groups. + parameters: + - in: path + name: rset_id + required: true + description: Ruleset id or name + schema: + type: string + - $ref: '#/components/parameters/inQueryProps' + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/RulesetListResponse' + 401: + $ref: '#/components/responses/401' + 404: + $ref: '#/components/responses/404' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + post: + operationId: PostComplianceRuleset + description: | + Update the given properties of a ruleset. Requires the CompManager privilege and + the responsibility of the ruleset. The change is logged. + parameters: + - in: path + name: rset_id + required: true + description: Ruleset id or name + schema: + type: string + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + ruleset_name: + type: string + ruleset_type: + type: string + enum: [explicit, contextual] + ruleset_public: + description: A boolean, or "T" / "F" as stored. + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/RulesetListResponse' + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' + 409: + $ref: '#/components/responses/409' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + put: + operationId: PutComplianceRuleset + description: | + Special actions on a ruleset. `clone` copies it as "_clone", with its type, + publicity, variables, children and, for a contextual ruleset, its filterset, + published to and under the responsibility of the user's default group. Requires + the CompManager privilege. + parameters: + - in: path + name: rset_id + required: true + description: Ruleset id or name + schema: + type: string + requestBody: + required: true + content: + application/json: + schema: + type: object + required: [action] + properties: + action: + type: string + enum: [clone] + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + info: + type: string + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' + 409: + $ref: '#/components/responses/409' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + delete: + operationId: DeleteComplianceRuleset + description: | + Delete a ruleset, with its parent and child relations, node and service + attachments, publication and responsible groups, variables, filtersets and + moduleset links. Requires the CompManager privilege and the responsibility of + the ruleset. The deletion is logged. + parameters: + - in: path + name: rset_id + required: true + description: Ruleset id or name + schema: + type: string + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + info: + type: string + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + + /compliance/rulesets/{rset_id}/usage: + get: + operationId: GetComplianceRulesetUsage + description: | + Display what uses a ruleset published to one of the user's groups: the + modulesets and parent rulesets holding it, the nodes and services it is attached + to. + parameters: + - in: path + name: rset_id + required: true + description: Ruleset id or name + schema: + type: string + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + data: + $ref: '#/components/schemas/RulesetUsage' + 401: + $ref: '#/components/responses/401' + 404: + $ref: '#/components/responses/404' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + + /compliance/rulesets/{rset_id}/am_i_responsible: + get: + operationId: GetComplianceRulesetAmIResponsible + description: | + Tell whether one of the user's groups is responsible for the ruleset. + parameters: + - in: path + name: rset_id + required: true + description: Ruleset id or name + schema: + type: string + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + data: + type: boolean + 401: + $ref: '#/components/responses/401' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + + /compliance/rulesets/{rset_id}/variables: + get: + operationId: GetComplianceRulesetVariables + description: | + List the variables of a ruleset published to the user (to one of the user's + groups, or to Everybody). + parameters: + - in: path + name: rset_id + required: true + description: Ruleset id or name + schema: + type: string + - $ref: '#/components/parameters/inQueryProps' + - $ref: '#/components/parameters/inQueryLimit' + - $ref: '#/components/parameters/inQueryOffset' + - $ref: '#/components/parameters/inQueryMeta' + - $ref: '#/components/parameters/inQueryStats' + - $ref: '#/components/parameters/inQueryOrderby' + - $ref: '#/components/parameters/inQueryFilter' + - $ref: '#/components/parameters/inQueryGroupby' + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/RulesetVariableListResponse' + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + post: + operationId: PostComplianceRulesetVariables + description: | + Create a variable named var_name in the ruleset; when the ruleset has one of + that name, its other given properties are updated instead. Requires the + CompManager privilege and the responsibility of the ruleset. The change is + logged. + parameters: + - in: path + name: rset_id + required: true + description: Ruleset id or name + schema: + type: string + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + var_name: + type: string + var_class: + type: string + description: The class of the variable, telling the modules how to read its value. + var_value: + description: The value, a string or any JSON value, stored serialized. + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/RulesetVariableListResponse' + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' + 409: + $ref: '#/components/responses/409' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + + /compliance/rulesets_variables: + get: + operationId: GetComplianceRulesetsVariables + description: | + List the variables of the rulesets published to one of the user's groups, every + ruleset for a manager, as the historical v_comp_rulesets view: a ruleset lists + its own variables, then those of each ruleset it encapsulates, named by + encap_rset and chain, with the ruleset's filterset and its responsible and + publication teams. A ruleset of the chain without variable is listed on a row + with a zero id and empty variable props. + parameters: + - $ref: '#/components/parameters/inQueryProps' + - $ref: '#/components/parameters/inQueryLimit' + - $ref: '#/components/parameters/inQueryOffset' + - $ref: '#/components/parameters/inQueryMeta' + - $ref: '#/components/parameters/inQueryStats' + - $ref: '#/components/parameters/inQueryOrderby' + - $ref: '#/components/parameters/inQueryFilter' + - $ref: '#/components/parameters/inQueryGroupby' + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/RulesetsVariableListResponse' + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + post: + operationId: PostComplianceRulesetsVariables + description: | + Create or update a variable, as POST /compliance/rulesets/{rset_id}/variables, + the ruleset being named by the ruleset_id or ruleset_name key of the body. + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + ruleset_id: + type: integer + ruleset_name: + type: string + var_name: + type: string + var_class: + type: string + var_value: + description: The value, a string or any JSON value, stored serialized. + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/RulesetVariableListResponse' + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' + 409: + $ref: '#/components/responses/409' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + + /compliance/rulesets/{rset_id}/variables/{var_id}: + get: + operationId: GetComplianceRulesetVariable + description: | + Display a variable of a ruleset published to the user. + parameters: + - in: path + name: rset_id + required: true + description: Ruleset id or name + schema: + type: string + - in: path + name: var_id + required: true + description: Variable id or name + schema: + type: string + - $ref: '#/components/parameters/inQueryProps' + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/RulesetVariableListResponse' + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + post: + operationId: PostComplianceRulesetVariable + description: | + Update the given properties of a variable. Requires the CompManager privilege + and the responsibility of the ruleset. The change is logged. + parameters: + - in: path + name: rset_id + required: true + description: Ruleset id or name + schema: + type: string + - in: path + name: var_id + required: true + description: Variable id or name + schema: + type: string + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + var_name: + type: string + var_class: + type: string + description: The class of the variable, telling the modules how to read its value. + var_value: + description: The value, a string or any JSON value, stored serialized. + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/RulesetVariableListResponse' + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' + 409: + $ref: '#/components/responses/409' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + put: + operationId: PutComplianceRulesetVariable + description: | + Special actions on a variable: copy or move it to dst_ruleset (id or name). + Requires the CompManager privilege, the publication of the source ruleset for a + copy or its responsibility for a move, and the responsibility of the destination, + which must not have a variable of the same name. + parameters: + - in: path + name: rset_id + required: true + description: Ruleset id or name + schema: + type: string + - in: path + name: var_id + required: true + description: Variable id or name + schema: + type: string + requestBody: + required: true + content: + application/json: + schema: + type: object + required: [action, dst_ruleset] + properties: + action: + type: string + enum: [copy, move] + dst_ruleset: + description: Id or name of the destination ruleset + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + info: + type: string + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' + 409: + $ref: '#/components/responses/409' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + delete: + operationId: DeleteComplianceRulesetVariable + description: | + Delete a variable. Requires the CompManager privilege and the responsibility of + the ruleset. The deletion is logged. + parameters: + - in: path + name: rset_id + required: true + description: Ruleset id or name + schema: + type: string + - in: path + name: var_id + required: true + description: Variable id or name + schema: + type: string + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + info: + type: string + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + + /compliance/rulesets/{rset_id}/rulesets/{child_rset_id}: + post: + operationId: PostComplianceRulesetRuleset + description: | + Make a ruleset a child of another. Requires the CompManager privilege and the + responsibility of the parent. Attaching a ruleset to itself, twice, or under + one of its own descendants is refused. The change is logged and the ruleset + chains are rebuilt. + parameters: + - in: path + name: rset_id + required: true + description: Parent ruleset id or name + schema: + type: string + - in: path + name: child_rset_id + required: true + description: Child ruleset id or name + schema: + type: string + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + info: + type: string + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' + 409: + $ref: '#/components/responses/409' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + delete: + operationId: DeleteComplianceRulesetRuleset + description: | + Remove a ruleset from the children of another. Requires the CompManager + privilege, the responsibility of the parent and the publication of the child. + The change is logged and the ruleset chains are rebuilt. + parameters: + - in: path + name: rset_id + required: true + description: Parent ruleset id or name + schema: + type: string + - in: path + name: child_rset_id + required: true + description: Child ruleset id or name + schema: + type: string + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + info: + type: string + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + + /compliance/rulesets/{rset_id}/filtersets/{fset_id}: + post: + operationId: PostComplianceRulesetFilterset + description: | + Give a contextual ruleset the filterset selecting the nodes and services it + applies to, replacing its previous one. Requires the CompManager privilege and + the responsibility of the ruleset. The change is logged. + parameters: + - in: path + name: rset_id + required: true + description: Ruleset id or name + schema: + type: string + - in: path + name: fset_id + required: true + description: Filterset id or name + schema: + type: string + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + info: + type: string + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + delete: + operationId: DeleteComplianceRulesetFilterset + description: | + Remove the filterset of a ruleset, whichever it is, as the historical handler. + Requires the CompManager privilege and the responsibility of the ruleset. The + change is logged. + parameters: + - in: path + name: rset_id + required: true + description: Ruleset id or name + schema: + type: string + - in: path + name: fset_id + required: true + description: Filterset id or name + schema: + type: string + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + info: + type: string + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + + /compliance/rulesets/{rset_id}/publications: + get: + operationId: GetComplianceRulesetPublications + description: | + List the publication groups of a ruleset; a non-manager sees only the ones they are + a member of. + parameters: + - in: path + name: rset_id + required: true + description: Ruleset id or name + schema: + type: string + - $ref: '#/components/parameters/inQueryProps' + - $ref: '#/components/parameters/inQueryLimit' + - $ref: '#/components/parameters/inQueryOffset' + - $ref: '#/components/parameters/inQueryMeta' + - $ref: '#/components/parameters/inQueryStats' + - $ref: '#/components/parameters/inQueryOrderby' + - $ref: '#/components/parameters/inQueryFilter' + - $ref: '#/components/parameters/inQueryGroupby' + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/GroupListResponse' + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 404: + $ref: '#/components/responses/404' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + + /compliance/rulesets/{rset_id}/publications/{group_id}: + post: + operationId: PostComplianceRulesetPublication + description: | + Make a group a publication group of the ruleset. Requires the CompManager privilege + and the responsibility of the ruleset; a non-manager may attach only one of their + groups. Everybody may not be made responsible, nor be given the publication of a + contextual ruleset. The change is logged. + parameters: + - in: path + name: rset_id + required: true + description: Ruleset id or name + schema: + type: string + - in: path + name: group_id + required: true + description: Group id or role + schema: + type: string + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + info: + type: string + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + delete: + operationId: DeleteComplianceRulesetPublication + description: | + Remove a publication group from the ruleset. Requires the CompManager privilege and + the responsibility of the ruleset. The change is logged. + parameters: + - in: path + name: rset_id + required: true + description: Ruleset id or name + schema: + type: string + - in: path + name: group_id + required: true + description: Group id or role + schema: + type: string + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + info: + type: string + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + + /compliance/rulesets_publications: + post: + operationId: PostComplianceRulesetsPublications + description: | + Attach a publication group to a ruleset, as + POST /compliance/rulesets/{rset_id}/publications/{group_id}, both named in the body. + requestBody: + required: true + content: + application/json: + schema: + type: object + required: [ruleset_id, group_id] + properties: + ruleset_id: + description: Ruleset id or name + group_id: + description: Group id or role + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + info: + type: string + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + delete: + operationId: DeleteComplianceRulesetsPublications + description: | + Detach a publication group from a ruleset, as + DELETE /compliance/rulesets/{rset_id}/publications/{group_id}, both named in the body. + requestBody: + required: true + content: + application/json: + schema: + type: object + required: [ruleset_id, group_id] + properties: + ruleset_id: + description: Ruleset id or name + group_id: + description: Group id or role + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + info: + type: string + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + + /compliance/rulesets/{rset_id}/responsibles: + get: + operationId: GetComplianceRulesetResponsibles + description: | + List the responsible groups of a ruleset; a non-manager sees only the ones they are + a member of. + parameters: + - in: path + name: rset_id + required: true + description: Ruleset id or name + schema: + type: string + - $ref: '#/components/parameters/inQueryProps' + - $ref: '#/components/parameters/inQueryLimit' + - $ref: '#/components/parameters/inQueryOffset' + - $ref: '#/components/parameters/inQueryMeta' + - $ref: '#/components/parameters/inQueryStats' + - $ref: '#/components/parameters/inQueryOrderby' + - $ref: '#/components/parameters/inQueryFilter' + - $ref: '#/components/parameters/inQueryGroupby' + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/GroupListResponse' + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 404: + $ref: '#/components/responses/404' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + + /compliance/rulesets/{rset_id}/responsibles/{group_id}: + post: + operationId: PostComplianceRulesetResponsible + description: | + Make a group a responsible group of the ruleset. Requires the CompManager privilege + and the responsibility of the ruleset; a non-manager may attach only one of their + groups. Everybody may not be made responsible, nor be given the publication of a + contextual ruleset. The change is logged. + parameters: + - in: path + name: rset_id + required: true + description: Ruleset id or name + schema: + type: string + - in: path + name: group_id + required: true + description: Group id or role + schema: + type: string + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + info: + type: string + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + delete: + operationId: DeleteComplianceRulesetResponsible + description: | + Remove a responsible group from the ruleset. Requires the CompManager privilege and + the responsibility of the ruleset. The change is logged. + parameters: + - in: path + name: rset_id + required: true + description: Ruleset id or name + schema: + type: string + - in: path + name: group_id + required: true + description: Group id or role + schema: + type: string + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + info: + type: string + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + + /compliance/rulesets_responsibles: + post: + operationId: PostComplianceRulesetsResponsibles + description: | + Attach a responsible group to a ruleset, as + POST /compliance/rulesets/{rset_id}/responsibles/{group_id}, both named in the body. + requestBody: + required: true + content: + application/json: + schema: + type: object + required: [ruleset_id, group_id] + properties: + ruleset_id: + description: Ruleset id or name + group_id: + description: Group id or role + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + info: + type: string + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + delete: + operationId: DeleteComplianceRulesetsResponsibles + description: | + Detach a responsible group from a ruleset, as + DELETE /compliance/rulesets/{rset_id}/responsibles/{group_id}, both named in the body. + requestBody: + required: true + content: + application/json: + schema: + type: object + required: [ruleset_id, group_id] + properties: + ruleset_id: + description: Ruleset id or name + group_id: + description: Group id or role + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + info: + type: string + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + + /compliance/rulesets/{rset_id}/nodes: + get: + operationId: GetComplianceRulesetNodes + description: | + List the nodes a ruleset published to the user is attached to, among the nodes + the user can see. + parameters: + - in: path + name: rset_id + required: true + description: Ruleset id or name + schema: + type: string + - $ref: '#/components/parameters/inQueryProps' + - $ref: '#/components/parameters/inQueryLimit' + - $ref: '#/components/parameters/inQueryOffset' + - $ref: '#/components/parameters/inQueryMeta' + - $ref: '#/components/parameters/inQueryStats' + - $ref: '#/components/parameters/inQueryOrderby' + - $ref: '#/components/parameters/inQueryFilter' + - $ref: '#/components/parameters/inQueryGroupby' + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/NodeListResponse' + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + + /compliance/rulesets/{rset_id}/candidate_nodes: + get: + operationId: GetComplianceRulesetCandidateNodes + description: | + List the nodes a ruleset published to the user may be attached to: the nodes + the user can see whose responsible team is one of the ruleset's publication + groups, not attached yet. + parameters: + - in: path + name: rset_id + required: true + description: Ruleset id or name + schema: + type: string + - $ref: '#/components/parameters/inQueryProps' + - $ref: '#/components/parameters/inQueryLimit' + - $ref: '#/components/parameters/inQueryOffset' + - $ref: '#/components/parameters/inQueryMeta' + - $ref: '#/components/parameters/inQueryStats' + - $ref: '#/components/parameters/inQueryOrderby' + - $ref: '#/components/parameters/inQueryFilter' + - $ref: '#/components/parameters/inQueryGroupby' + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/NodeListResponse' + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + + /compliance/rulesets/{rset_id}/services: + get: + operationId: GetComplianceRulesetServices + description: | + List the services a ruleset published to the user is attached to, as the + service itself or, with slave, as its encapsulated service, among the services + the user can see. + parameters: + - in: path + name: rset_id + required: true + description: Ruleset id or name + schema: + type: string + - in: query + name: slave + description: With true, the encapsulated services + schema: + type: boolean + - $ref: '#/components/parameters/inQueryProps' + - $ref: '#/components/parameters/inQueryLimit' + - $ref: '#/components/parameters/inQueryOffset' + - $ref: '#/components/parameters/inQueryMeta' + - $ref: '#/components/parameters/inQueryStats' + - $ref: '#/components/parameters/inQueryOrderby' + - $ref: '#/components/parameters/inQueryFilter' + - $ref: '#/components/parameters/inQueryGroupby' + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceListResponse' + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + + /compliance/rulesets/{rset_id}/candidate_services: + get: + operationId: GetComplianceRulesetCandidateServices + description: | + List the services a ruleset published to the user may be attached to, as the + service or with slave as its encapsulated service: the services the user can see + whose app has one of the ruleset's publication groups among its responsibles, + not attached yet. + parameters: + - in: path + name: rset_id + required: true + description: Ruleset id or name + schema: + type: string + - in: query + name: slave + description: With true, the encapsulated services + schema: + type: boolean + - $ref: '#/components/parameters/inQueryProps' + - $ref: '#/components/parameters/inQueryLimit' + - $ref: '#/components/parameters/inQueryOffset' + - $ref: '#/components/parameters/inQueryMeta' + - $ref: '#/components/parameters/inQueryStats' + - $ref: '#/components/parameters/inQueryOrderby' + - $ref: '#/components/parameters/inQueryFilter' + - $ref: '#/components/parameters/inQueryGroupby' + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceListResponse' + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + + /compliance/rulesets_nodes: + post: + operationId: PostComplianceRulesetsNodes + description: | + Attach a ruleset to a node, as POST /nodes/{node_id}/compliance/rulesets/{rset_id}. + requestBody: + required: true + content: + application/json: + schema: + type: object + required: [node_id] + properties: + node_id: + type: string + ruleset_id: + description: Ruleset id or name + ruleset_name: + type: string + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + info: + type: string + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' + 409: + $ref: '#/components/responses/409' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + delete: + operationId: DeleteComplianceRulesetsNodes + description: | + Detach a ruleset from a node, as DELETE /nodes/{node_id}/compliance/rulesets/{rset_id}. + requestBody: + required: true + content: + application/json: + schema: + type: object + required: [node_id] + properties: + node_id: + type: string + ruleset_id: + description: Ruleset id or name + ruleset_name: + type: string + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + info: + type: string + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + + /compliance/rulesets_services: + post: + operationId: PostComplianceRulesetsServices + description: | + Attach a ruleset to a service, as POST /services/{svc_id}/compliance/rulesets/{rset_id}. + requestBody: + required: true + content: + application/json: + schema: + type: object + required: [svc_id] + properties: + svc_id: + type: string + ruleset_id: + description: Ruleset id or name + ruleset_name: + type: string + slave: + description: A boolean; true for the encapsulated service. encap is accepted as well. + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + info: + type: string + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' + 409: + $ref: '#/components/responses/409' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + delete: + operationId: DeleteComplianceRulesetsServices + description: | + Detach a ruleset from a service, as DELETE /services/{svc_id}/compliance/rulesets/{rset_id}. + requestBody: + required: true + content: + application/json: + schema: + type: object + required: [svc_id] + properties: + svc_id: + type: string + ruleset_id: + description: Ruleset id or name + ruleset_name: + type: string + slave: + description: A boolean; true for the encapsulated service. encap is accepted as well. + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + info: + type: string + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + + /compliance/modulesets: + get: + operationId: GetComplianceModulesets + description: | + List the modulesets published to one of the user's groups, every moduleset for + a manager. + parameters: + - $ref: '#/components/parameters/inQueryProps' + - $ref: '#/components/parameters/inQueryLimit' + - $ref: '#/components/parameters/inQueryOffset' + - $ref: '#/components/parameters/inQueryMeta' + - $ref: '#/components/parameters/inQueryStats' + - $ref: '#/components/parameters/inQueryOrderby' + - $ref: '#/components/parameters/inQueryFilter' + - $ref: '#/components/parameters/inQueryGroupby' + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ModulesetListResponse' + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + post: + operationId: PostComplianceModulesets + description: | + Create a moduleset named modset_name, authored by the user, published to and + under the responsibility of the user's default group (the Manager group without + one). A taken name is a 409. Requires the CompManager privilege. The creation is + logged. + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + modset_name: + type: string + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ModulesetListResponse' + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 409: + $ref: '#/components/responses/409' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + delete: + operationId: DeleteComplianceModulesets + description: | + Delete the moduleset named by the id key of the body, as + DELETE /compliance/modulesets/{modset_id}. + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + id: + description: Moduleset id or name + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + info: + type: string + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + + /compliance/modulesets/{modset_id}: + get: + operationId: GetComplianceModuleset + description: | + Display a moduleset published to one of the user's groups. + parameters: + - in: path + name: modset_id + required: true + description: Moduleset id or name + schema: + type: string + - $ref: '#/components/parameters/inQueryProps' + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ModulesetListResponse' + 401: + $ref: '#/components/responses/401' + 404: + $ref: '#/components/responses/404' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + post: + operationId: PostComplianceModuleset + description: | + Rename a moduleset, recording its update date. Requires the CompManager + privilege and the responsibility of the moduleset. The change is logged. + parameters: + - in: path + name: modset_id + required: true + description: Moduleset id or name + schema: + type: string + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + modset_name: + type: string + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ModulesetListResponse' + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' + 409: + $ref: '#/components/responses/409' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + put: + operationId: PutComplianceModuleset + description: | + Special actions on a moduleset. `clone` copies it as "_clone", authored by + the user, with its modules, rulesets and children, published to and under the + responsibility of the user's default group. Requires the CompManager privilege. + parameters: + - in: path + name: modset_id + required: true + description: Moduleset id or name + schema: + type: string + requestBody: + required: true + content: + application/json: + schema: + type: object + required: [action] + properties: + action: + type: string + enum: [clone] + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + info: + type: string + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' + 409: + $ref: '#/components/responses/409' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + delete: + operationId: DeleteComplianceModuleset + description: | + Delete a moduleset, with its parent and child relations, node and service + attachments, publication and responsible groups, modules and ruleset links. + Requires the CompManager privilege and the responsibility of the moduleset. The + deletion is logged. + parameters: + - in: path + name: modset_id + required: true + description: Moduleset id or name + schema: + type: string + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + info: + type: string + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + + /compliance/modulesets/{modset_id}/usage: + get: + operationId: GetComplianceModulesetUsage + description: | + Display what uses a moduleset published to the user: the modulesets holding it + as a child. + parameters: + - in: path + name: modset_id + required: true + description: Moduleset id or name + schema: + type: string + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + data: + type: object + properties: + modulesets: + type: array + items: + type: object + properties: + id: + type: integer + modset_name: + type: string + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + + /compliance/modulesets/{modset_id}/am_i_responsible: + get: + operationId: GetComplianceModulesetAmIResponsible + description: | + Tell whether one of the user's groups is responsible for the moduleset. + parameters: + - in: path + name: modset_id + required: true + description: Moduleset id or name + schema: + type: string + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + data: + type: boolean + 401: + $ref: '#/components/responses/401' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + + /compliance/modulesets/{modset_id}/modules: + get: + operationId: GetComplianceModulesetModules + description: | + List the modules of a moduleset published to the user (to one of the user's + groups, or to Everybody). + parameters: + - in: path + name: modset_id + required: true + description: Moduleset id or name + schema: + type: string + - $ref: '#/components/parameters/inQueryProps' + - $ref: '#/components/parameters/inQueryLimit' + - $ref: '#/components/parameters/inQueryOffset' + - $ref: '#/components/parameters/inQueryMeta' + - $ref: '#/components/parameters/inQueryStats' + - $ref: '#/components/parameters/inQueryOrderby' + - $ref: '#/components/parameters/inQueryFilter' + - $ref: '#/components/parameters/inQueryGroupby' + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ModulesetModuleListResponse' + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + post: + operationId: PostComplianceModulesetModules + description: | + Create a module named modset_mod_name in the moduleset; a taken name is a 409. + Requires the CompManager privilege and the responsibility of the moduleset. The + creation is logged. + parameters: + - in: path + name: modset_id + required: true + description: Moduleset id or name + schema: + type: string + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + modset_mod_name: + type: string + autofix: + description: A boolean, or "T" / "F" as stored. Whether the agent fixes the module on check failure. + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ModulesetModuleListResponse' + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' + 409: + $ref: '#/components/responses/409' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + + /compliance/modulesets/{modset_id}/modules/{mod_id}: + get: + operationId: GetComplianceModulesetModule + description: | + Display a module of a moduleset published to the user. + parameters: + - in: path + name: modset_id + required: true + description: Moduleset id or name + schema: + type: string + - in: path + name: mod_id + required: true + description: Module id or name + schema: + type: string + - $ref: '#/components/parameters/inQueryProps' + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ModulesetModuleListResponse' + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + post: + operationId: PostComplianceModulesetModule + description: | + Update the name or the autofix flag of a module. Requires the CompManager + privilege and the responsibility of the moduleset. The change is logged. + parameters: + - in: path + name: modset_id + required: true + description: Moduleset id or name + schema: + type: string + - in: path + name: mod_id + required: true + description: Module id or name + schema: + type: string + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + modset_mod_name: + type: string + autofix: + description: A boolean, or "T" / "F" as stored. Whether the agent fixes the module on check failure. + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ModulesetModuleListResponse' + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' + 409: + $ref: '#/components/responses/409' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + delete: + operationId: DeleteComplianceModulesetModule + description: | + Delete a module. Requires the CompManager privilege and the responsibility of + the moduleset. The deletion is logged. + parameters: + - in: path + name: modset_id + required: true + description: Moduleset id or name + schema: + type: string + - in: path + name: mod_id + required: true + description: Module id or name + schema: + type: string + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + info: + type: string + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + + /compliance/modulesets/{modset_id}/modulesets/{child_modset_id}: + post: + operationId: PostComplianceModulesetModuleset + description: | + Attach a moduleset published to the user to a moduleset, as a child. Requires + the CompManager privilege and the responsibility of the parent. An attachment + closing a loop is a 409; an existing one answers an info message. The change is + logged. + parameters: + - in: path + name: modset_id + required: true + description: Moduleset id or name + schema: + type: string + - in: path + name: child_modset_id + required: true + description: Child moduleset id or name + schema: + type: string + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + info: + type: string + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' + 409: + $ref: '#/components/responses/409' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + delete: + operationId: DeleteComplianceModulesetModuleset + description: | + Detach a child moduleset from a moduleset. Requires the CompManager privilege + and the responsibility of the parent. The change is logged. + parameters: + - in: path + name: modset_id + required: true + description: Moduleset id or name + schema: + type: string + - in: path + name: child_modset_id + required: true + description: Child moduleset id or name + schema: + type: string + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + info: + type: string + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + + /compliance/modulesets/{modset_id}/rulesets/{rset_id}: + post: + operationId: PostComplianceModulesetRuleset + description: | + Attach a ruleset published to the user to a moduleset: its variables join the + execution environment of the moduleset's modules. Requires the CompManager + privilege and the responsibility of the moduleset. An existing attachment + answers an info message. The change is logged. + parameters: + - in: path + name: modset_id + required: true + description: Moduleset id or name + schema: + type: string + - in: path + name: rset_id + required: true + description: Ruleset id or name + schema: + type: string + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + info: + type: string + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + delete: + operationId: DeleteComplianceModulesetRuleset + description: | + Detach a ruleset published to the user from a moduleset. Requires the + CompManager privilege and the responsibility of the moduleset. The change is + logged. + parameters: + - in: path + name: modset_id + required: true + description: Moduleset id or name + schema: + type: string + - in: path + name: rset_id + required: true + description: Ruleset id or name + schema: + type: string + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + info: + type: string + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + + /compliance/modulesets/{modset_id}/publications: + get: + operationId: GetComplianceModulesetPublications + description: | + List the publication groups of a moduleset; a non-manager sees only the ones they are + a member of. + parameters: + - in: path + name: modset_id + required: true + description: Moduleset id or name + schema: + type: string + - $ref: '#/components/parameters/inQueryProps' + - $ref: '#/components/parameters/inQueryLimit' + - $ref: '#/components/parameters/inQueryOffset' + - $ref: '#/components/parameters/inQueryMeta' + - $ref: '#/components/parameters/inQueryStats' + - $ref: '#/components/parameters/inQueryOrderby' + - $ref: '#/components/parameters/inQueryFilter' + - $ref: '#/components/parameters/inQueryGroupby' + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/GroupListResponse' + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 404: + $ref: '#/components/responses/404' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + + /compliance/modulesets/{modset_id}/publications/{group_id}: + post: + operationId: PostComplianceModulesetPublication + description: | + Make a group a publication group of the moduleset. Requires the CompManager privilege + and the responsibility of the moduleset; a non-manager may attach only one of their + groups. Everybody may not be made responsible. The change is logged. + parameters: + - in: path + name: modset_id + required: true + description: Moduleset id or name + schema: + type: string + - in: path + name: group_id + required: true + description: Group id or role + schema: + type: string + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + info: + type: string + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + delete: + operationId: DeleteComplianceModulesetPublication + description: | + Remove a publication group from the moduleset. Requires the CompManager privilege and + the responsibility of the moduleset. The change is logged. + parameters: + - in: path + name: modset_id + required: true + description: Moduleset id or name + schema: + type: string + - in: path + name: group_id + required: true + description: Group id or role + schema: + type: string + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + info: + type: string + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + + /compliance/modulesets_publications: + post: + operationId: PostComplianceModulesetsPublications + description: | + Attach a publication group to a moduleset, as + POST /compliance/modulesets/{modset_id}/publications/{group_id}, both named in the body. + requestBody: + required: true + content: + application/json: + schema: + type: object + required: [modset_id, group_id] + properties: + modset_id: + description: Moduleset id or name + group_id: + description: Group id or role + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + info: + type: string + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + delete: + operationId: DeleteComplianceModulesetsPublications + description: | + Detach a publication group from a moduleset, as + DELETE /compliance/modulesets/{modset_id}/publications/{group_id}, both named in the body. + requestBody: + required: true + content: + application/json: + schema: + type: object + required: [modset_id, group_id] + properties: + modset_id: + description: Moduleset id or name + group_id: + description: Group id or role + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + info: + type: string + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + + /compliance/modulesets/{modset_id}/responsibles: + get: + operationId: GetComplianceModulesetResponsibles + description: | + List the responsible groups of a moduleset; a non-manager sees only the ones they are + a member of. + parameters: + - in: path + name: modset_id + required: true + description: Moduleset id or name + schema: + type: string + - $ref: '#/components/parameters/inQueryProps' + - $ref: '#/components/parameters/inQueryLimit' + - $ref: '#/components/parameters/inQueryOffset' + - $ref: '#/components/parameters/inQueryMeta' + - $ref: '#/components/parameters/inQueryStats' + - $ref: '#/components/parameters/inQueryOrderby' + - $ref: '#/components/parameters/inQueryFilter' + - $ref: '#/components/parameters/inQueryGroupby' + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/GroupListResponse' + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 404: + $ref: '#/components/responses/404' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + + /compliance/modulesets/{modset_id}/responsibles/{group_id}: + post: + operationId: PostComplianceModulesetResponsible + description: | + Make a group a responsible group of the moduleset. Requires the CompManager privilege + and the responsibility of the moduleset; a non-manager may attach only one of their + groups. Everybody may not be made responsible. The change is logged. + parameters: + - in: path + name: modset_id + required: true + description: Moduleset id or name + schema: + type: string + - in: path + name: group_id + required: true + description: Group id or role + schema: + type: string + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + info: + type: string + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + delete: + operationId: DeleteComplianceModulesetResponsible + description: | + Remove a responsible group from the moduleset. Requires the CompManager privilege and + the responsibility of the moduleset. The change is logged. + parameters: + - in: path + name: modset_id + required: true + description: Moduleset id or name + schema: + type: string + - in: path + name: group_id + required: true + description: Group id or role + schema: + type: string + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + info: + type: string + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + + /compliance/modulesets_responsibles: + post: + operationId: PostComplianceModulesetsResponsibles + description: | + Attach a responsible group to a moduleset, as + POST /compliance/modulesets/{modset_id}/responsibles/{group_id}, both named in the body. + requestBody: + required: true + content: + application/json: + schema: + type: object + required: [modset_id, group_id] + properties: + modset_id: + description: Moduleset id or name + group_id: + description: Group id or role + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + info: + type: string + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + delete: + operationId: DeleteComplianceModulesetsResponsibles + description: | + Detach a responsible group from a moduleset, as + DELETE /compliance/modulesets/{modset_id}/responsibles/{group_id}, both named in the body. + requestBody: + required: true + content: + application/json: + schema: + type: object + required: [modset_id, group_id] + properties: + modset_id: + description: Moduleset id or name + group_id: + description: Group id or role + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + info: + type: string + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + + /compliance/modulesets/{modset_id}/nodes: + get: + operationId: GetComplianceModulesetNodes + description: | + List the nodes a moduleset published to the user is attached to, among the nodes + the user can see. + parameters: + - in: path + name: modset_id + required: true + description: Moduleset id or name + schema: + type: string + - $ref: '#/components/parameters/inQueryProps' + - $ref: '#/components/parameters/inQueryLimit' + - $ref: '#/components/parameters/inQueryOffset' + - $ref: '#/components/parameters/inQueryMeta' + - $ref: '#/components/parameters/inQueryStats' + - $ref: '#/components/parameters/inQueryOrderby' + - $ref: '#/components/parameters/inQueryFilter' + - $ref: '#/components/parameters/inQueryGroupby' + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/NodeListResponse' + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + + /compliance/modulesets/{modset_id}/candidate_nodes: + get: + operationId: GetComplianceModulesetCandidateNodes + description: | + List the nodes a moduleset published to the user may be attached to: the nodes + the user can see whose responsible team is one of the moduleset's publication + groups, not attached yet. + parameters: + - in: path + name: modset_id + required: true + description: Moduleset id or name + schema: + type: string + - $ref: '#/components/parameters/inQueryProps' + - $ref: '#/components/parameters/inQueryLimit' + - $ref: '#/components/parameters/inQueryOffset' + - $ref: '#/components/parameters/inQueryMeta' + - $ref: '#/components/parameters/inQueryStats' + - $ref: '#/components/parameters/inQueryOrderby' + - $ref: '#/components/parameters/inQueryFilter' + - $ref: '#/components/parameters/inQueryGroupby' + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/NodeListResponse' + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + + /compliance/modulesets/{modset_id}/services: + get: + operationId: GetComplianceModulesetServices + description: | + List the services a moduleset published to the user is attached to, as the + service itself or, with slave, as its encapsulated service, among the services + the user can see. + parameters: + - in: path + name: modset_id + required: true + description: Moduleset id or name + schema: + type: string + - in: query + name: slave + description: With true, the encapsulated services + schema: + type: boolean + - $ref: '#/components/parameters/inQueryProps' + - $ref: '#/components/parameters/inQueryLimit' + - $ref: '#/components/parameters/inQueryOffset' + - $ref: '#/components/parameters/inQueryMeta' + - $ref: '#/components/parameters/inQueryStats' + - $ref: '#/components/parameters/inQueryOrderby' + - $ref: '#/components/parameters/inQueryFilter' + - $ref: '#/components/parameters/inQueryGroupby' + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceListResponse' + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + + /compliance/modulesets/{modset_id}/candidate_services: + get: + operationId: GetComplianceModulesetCandidateServices + description: | + List the services a moduleset published to the user may be attached to, as the + service or with slave as its encapsulated service: the services the user can see + whose app has one of the moduleset's publication groups among its responsibles, + not attached yet. + parameters: + - in: path + name: modset_id + required: true + description: Moduleset id or name + schema: + type: string + - in: query + name: slave + description: With true, the encapsulated services + schema: + type: boolean + - $ref: '#/components/parameters/inQueryProps' + - $ref: '#/components/parameters/inQueryLimit' + - $ref: '#/components/parameters/inQueryOffset' + - $ref: '#/components/parameters/inQueryMeta' + - $ref: '#/components/parameters/inQueryStats' + - $ref: '#/components/parameters/inQueryOrderby' + - $ref: '#/components/parameters/inQueryFilter' + - $ref: '#/components/parameters/inQueryGroupby' + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ServiceListResponse' + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + + /compliance/modulesets_modules: + get: + operationId: GetComplianceModulesetsModules + description: | + List the modules of the modulesets published to one of the user's groups, every + moduleset for a manager, as the historical v_comp_modulesets view: one row per + module, with its moduleset and the moduleset's responsible and publication + teams. A moduleset without module is listed on a row with a zero id and empty + module props. + parameters: + - $ref: '#/components/parameters/inQueryProps' + - $ref: '#/components/parameters/inQueryLimit' + - $ref: '#/components/parameters/inQueryOffset' + - $ref: '#/components/parameters/inQueryMeta' + - $ref: '#/components/parameters/inQueryStats' + - $ref: '#/components/parameters/inQueryOrderby' + - $ref: '#/components/parameters/inQueryFilter' + - $ref: '#/components/parameters/inQueryGroupby' + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/ModulesetsModuleListResponse' + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + + /compliance/modulesets_nodes: + post: + operationId: PostComplianceModulesetsNodes + description: | + Attach a moduleset to a node, as POST /nodes/{node_id}/compliance/modulesets/{mset_id}. + requestBody: + required: true + content: + application/json: + schema: + type: object + required: [node_id] + properties: + node_id: + type: string + modset_id: + description: Moduleset id or name + modset_name: + type: string + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + info: + type: string + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' + 409: + $ref: '#/components/responses/409' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + delete: + operationId: DeleteComplianceModulesetsNodes + description: | + Detach a moduleset from a node, as DELETE /nodes/{node_id}/compliance/modulesets/{mset_id}. + requestBody: + required: true + content: + application/json: + schema: + type: object + required: [node_id] + properties: + node_id: + type: string + modset_id: + description: Moduleset id or name + modset_name: + type: string + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + info: + type: string + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + + /compliance/modulesets_services: + post: + operationId: PostComplianceModulesetsServices + description: | + Attach a moduleset to a service, as POST /services/{svc_id}/compliance/modulesets/{mset_id}. + requestBody: + required: true + content: + application/json: + schema: + type: object + required: [svc_id] + properties: + svc_id: + type: string + modset_id: + description: Moduleset id or name + modset_name: + type: string + slave: + description: A boolean; true for the encapsulated service. encap is accepted as well. + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + info: + type: string + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' + 409: + $ref: '#/components/responses/409' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + delete: + operationId: DeleteComplianceModulesetsServices + description: | + Detach a moduleset from a service, as DELETE /services/{svc_id}/compliance/modulesets/{mset_id}. + requestBody: + required: true + content: + application/json: + schema: + type: object + required: [svc_id] + properties: + svc_id: + type: string + modset_id: + description: Moduleset id or name + modset_name: + type: string + slave: + description: A boolean; true for the encapsulated service. encap is accepted as well. + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + info: + type: string + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + + /compliance/rulesets/export: + get: + operationId: GetComplianceRulesetsExport + description: | + Export the rulesets published to the user, with their descendants and the + filtersets they use. + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/CompRulesetExport' + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + + /compliance/rulesets/{rset_id}/export: + get: + operationId: GetComplianceRulesetExport + description: | + Export a ruleset published to the user, with its descendants and its + filterset. + parameters: + - in: path + name: rset_id + required: true + description: Ruleset id or name + schema: + type: string + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/CompRulesetExport' + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + + /compliance/modulesets/export: + get: + operationId: GetComplianceModulesetsExport + description: | + Export the modulesets published to the user, with their descendants and the + rulesets and filtersets they use. + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/CompModulesetExport' + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + + /compliance/modulesets/{modset_id}/export: + get: + operationId: GetComplianceModulesetExport + description: | + Export a moduleset published to the user, with its descendants and the rulesets + and filtersets they use. + parameters: + - in: path + name: modset_id + required: true + description: Moduleset id or name + schema: + type: string + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: '#/components/schemas/CompModulesetExport' + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 404: + $ref: '#/components/responses/404' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + + /compliance/import: + post: + operationId: PostComplianceImport + description: | + Import the filters, filtersets, rulesets and modulesets of an export. An object + existing by name is reused, and the relations missing are added; the new objects + are given the user's default group as publication and responsible group, the + groups of the export are not imported. Requires the CompManager privilege, and + the responsibility of any existing ruleset or moduleset the import adds to. A + relation closing a loop is refused. The import applies all or nothing; the info + list tells what was added and what already existed. + requestBody: + required: true + content: + application/json: + schema: + type: object + properties: + filtersets: + type: array + items: + $ref: '#/components/schemas/FiltersetExportItem' + rulesets: + type: array + items: + $ref: '#/components/schemas/CompExportRuleset' + modulesets: + type: array + items: + $ref: '#/components/schemas/CompExportModuleset' + tags: + - collector + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + info: + type: array + items: + type: string + 400: + $ref: '#/components/responses/400' + 401: + $ref: '#/components/responses/401' + 403: + $ref: '#/components/responses/403' + 500: + $ref: '#/components/responses/500' + security: + - basicAuth: [ ] + - bearerAuth: [ ] + +components: + + responses: + '200': + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/Problem" + '204': + description: No Content + '400': + description: Bad Request + content: + application/json: + schema: + $ref: "#/components/schemas/Problem" + '401': + description: Unauthorized + content: + application/json: + schema: + $ref: "#/components/schemas/Problem" + '403': + description: Forbidden + content: + application/json: + schema: + $ref: "#/components/schemas/Problem" + '404': + description: Not Found + content: + application/json: + schema: + $ref: "#/components/schemas/Problem" + '408': + description: Request Timeout + content: + application/json: + schema: + $ref: "#/components/schemas/Problem" + '409': + description: Conflict + content: + application/json: + schema: + $ref: "#/components/schemas/Problem" + '500': + description: Internal Server Error + content: + application/json: + schema: + $ref: "#/components/schemas/Problem" + '503': + description: Service Unavailable + content: + application/json: + schema: + $ref: "#/components/schemas/Problem" + + schemas: + ListMeta: + type: object + required: + properties: + count: + type: integer + available_props: + type: array + items: + type: string + included_props: + type: array + items: + type: string + limit: + type: integer + offset: + type: integer + distinct: + type: object + additionalProperties: + type: integer + total: + type: integer + description: | + Number of rows of the list without pagination, the filters applied; for + a grouped list, the number of groups. With stats, the number of rows the + statistics are computed from. + + NodeRow: + type: object + description: | + A node row of the nodes list. Every property is optional: the `props` + query parameter selects which columns the server returns, so a row + carries only the requested subset. + properties: + node_id: + type: string + nodename: + type: string + app: + type: string + node_env: + type: string + cluster_id: + type: string + clusters.cluster_name: + type: string + nullable: true + description: Name of the node's cluster, from the joined clusters table. + loc_country: + type: string + loc_city: + type: string + loc_addr: + type: string + loc_building: + type: string + loc_floor: + type: string + loc_room: + type: string + loc_rack: + type: string + loc_zip: + type: string + cpu_freq: + type: string + cpu_cores: + type: integer + cpu_dies: + type: integer + cpu_vendor: + type: string + cpu_model: + type: string + cpu_threads: + type: integer + mem_banks: + type: integer + mem_slots: + type: integer + mem_bytes: + type: integer + os_name: + type: string + os_release: + type: string + os_update: + type: string + os_segment: + type: string + os_arch: + type: string + os_vendor: + type: string + os_kernel: + type: string + os_concat: + type: string + team_responsible: + type: string + team_integ: + type: string + team_support: + type: string + serial: + type: string + model: + type: string + manufacturer: + type: string + type: + type: string + assetname: + type: string + asset_env: + type: string + warranty_end: + type: string + maintenance_end: + type: string + status: + type: string + role: + type: string + sec_zone: + type: string + power_cabinet1: + type: string + power_cabinet2: + type: string + power_supply_nb: + type: integer + power_protect: + type: string + power_protect_breaker: + type: string + power_breaker1: + type: string + power_breaker2: + type: string + blade_cabinet: + type: string + enclosure: + type: string + enclosureslot: + type: string + hv: + type: string + hvpool: + type: string + hvvdc: + type: string + fqdn: + type: string + connect_to: + type: string + listener_port: + type: integer + version: + type: string + collector: + type: string + sp_version: + type: string + bios_version: + type: string + tz: + type: string + last_boot: + type: string + last_comm: + type: string + node_frozen: + type: string + node_frozen_at: + type: string + snooze_till: + type: string + notifications: + type: string + action_type: + type: string + hw_obs_warn_date: + type: string + hw_obs_alert_date: + type: string + os_obs_warn_date: + type: string + os_obs_alert_date: + type: string + updated: + type: string + + NodeListResponse: + type: object + required: + - data + properties: + data: + oneOf: + - type: array + items: + $ref: '#/components/schemas/NodeRow' + - type: object + additionalProperties: + type: object + additionalProperties: + type: integer + meta: + $ref: '#/components/schemas/ListMeta' + + ServiceRow: + type: object + description: | + A service row of the services list. Every property is optional: the `props` + query parameter selects which columns the server returns, so a row + carries only the requested subset. + properties: + id: + type: integer + svc_id: + type: string + svcname: + type: string + cluster_id: + type: string + svc_status: + type: string + svc_availstatus: + type: string + svc_app: + type: string + svc_env: + type: string + svc_ha: + type: integer + svc_topology: + type: string + svc_frozen: + type: string + svc_placement: + type: string + svc_provisioned: + type: string + svc_flex_min_nodes: + type: integer + svc_flex_max_nodes: + type: integer + svc_flex_target: + type: integer + svc_flex_cpu_low_threshold: + type: integer + svc_flex_cpu_high_threshold: + type: integer + svc_autostart: + type: string + svc_nodes: + type: string + svc_drpnode: + type: string + svc_drpnodes: + type: string + svc_drptype: + type: string + svc_comment: + type: string + svc_created: + type: string + svc_status_updated: + type: string + svc_hostid: + type: string + svc_wave: + type: integer + svc_config: + type: string + svc_config_updated: + type: string + svc_metrocluster: + type: string + svc_drnoaction: + type: string + svc_notifications: + type: string + svc_snooze_till: + type: string + updated: + type: string + + ServiceListResponse: + type: object + required: + - data + properties: + data: + oneOf: + - type: array + items: + $ref: '#/components/schemas/ServiceRow' + - type: object + additionalProperties: + type: object + additionalProperties: + type: integer + meta: + $ref: '#/components/schemas/ListMeta' + + AlertRow: + type: object + description: | + A dashboard alert row. Every property is optional: the `props` query + parameter selects which columns the server returns. `alert` is computed + from `dash_fmt` and `dash_dict`. The `nodes.` and `services.` properties + come from a LEFT JOIN and are null when the alert targets the other kind + of object. + properties: + id: + type: integer + dash_type: + type: string + svc_id: + type: string + node_id: + type: string + dash_severity: + type: integer + dash_fmt: + type: string + dash_dict: + type: string + dash_created: + type: string + dash_updated: + type: string + dash_md5: + type: string + dash_dict_md5: + type: string + dash_env: + type: string + dash_instance: + type: string + alert: + type: string + description: Human readable message, rendered from dash_fmt and dash_dict. + nodes.nodename: + type: string + nullable: true + services.svcname: + type: string + nullable: true + + ActionEnqueue: + type: object + description: One action to enqueue with PUT /actions. + required: + - action + properties: + action: + type: string + description: Agent action to run + node_id: + type: string + description: Target node (node_id or nodename) + svc_id: + type: string + description: Target service (svc_id or svcname) + rid: + type: string + description: Resource ids to limit an instance action to, comma separated + vmname: + type: string + description: Target node by name, in place of node_id, for an encapsulated node + InstanceRow: + type: object + description: | + A service instance: the state of one service on one node, as reported by + the agent. Every property is optional: the `props` query parameter selects + which columns the server returns. The `nodes.` and `services.` properties + come from joined tables; `nodes.` ones are null when the node row is missing. + properties: + svc_id: + type: string + node_id: + type: string + mon_svctype: + type: string + mon_availstatus: + type: string + mon_overallstatus: + type: string + mon_smon_status: + type: string + mon_smon_global_expect: + type: string + mon_ipstatus: + type: string + mon_fsstatus: + type: string + mon_diskstatus: + type: string + mon_containerstatus: + type: string + mon_sharestatus: + type: string + mon_syncstatus: + type: string + mon_appstatus: + type: string + mon_hbstatus: + type: string + mon_frozen: + type: string + mon_frozen_at: + type: string + mon_encap_frozen_at: + type: string + mon_vmname: + type: string + mon_vmtype: + type: string + mon_guestos: + type: string + mon_vcpus: + type: integer + mon_vmem: + type: integer + mon_updated: + type: string + mon_changed: + type: string + nodes.nodename: + type: string + nullable: true + nodes.os_name: + type: string + nullable: true + services.svcname: + type: string + nullable: true + + PackageRow: + type: object + description: | + A package installed on a node, as the agent reports it. Every property is + optional: the `props` query parameter selects which columns the server + returns. `sig_provider` names the provider of the signing key and is empty + when the signature is unknown. The `nodes.` properties come from the joined + nodes table. + properties: + id: + type: integer + node_id: + type: string + pkg_name: + type: string + pkg_version: + type: string + pkg_arch: + type: string + pkg_type: + type: string + nullable: true + pkg_sig: + type: string + nullable: true + sig_provider: + type: string + nullable: true + pkg_install_date: + type: string + nullable: true + pkg_updated: + type: string + nodes.nodename: + type: string + nullable: true + nodes.app: + type: string + nullable: true + nodes.os_name: + type: string + nullable: true + + PackageListResponse: + type: object + required: + - data + properties: + data: + oneOf: + - type: array + items: + $ref: '#/components/schemas/PackageRow' + - type: object + additionalProperties: + type: object + additionalProperties: + type: integer + meta: + $ref: '#/components/schemas/ListMeta' + + PackageDiffRow: + type: object + description: A package version installed on a compared node, and missing from at least one other. + required: [node_id, pkg_name, pkg_version, pkg_arch, pkg_type] + properties: + node_id: + type: string + pkg_name: + type: string + pkg_version: + type: string + pkg_arch: + type: string + pkg_type: + type: string + + PackageDiffNode: + type: object + required: [node_id, nodename] + properties: + node_id: + type: string + nodename: + type: string + + PackagesDiffResponse: + type: object + required: [data, meta] + properties: + data: + type: array + items: + $ref: '#/components/schemas/PackageDiffRow' + meta: + type: object + required: [node_ids, nodes] + properties: + node_ids: + description: The ids of the compared nodes, as the historical API returns them. + type: array + items: + type: string + nodes: + description: The compared nodes with their names, ordered by name. + type: array + items: + $ref: '#/components/schemas/PackageDiffNode' + + ComplianceStatusRow: + type: object + description: | + The last run of a compliance module on a node, or on a service's instance + on it. Every property is optional: the `props` query parameter selects which + columns the server returns. `run_status` is the module's exit code: 0 ok, + 1 not ok, 2 not applicable. + properties: + id: + type: integer + run_module: + type: string + node_id: + type: string + svc_id: + type: string + run_status: + type: integer + run_log: + type: string + run_date: + type: string + run_action: + type: string + rset_md5: + type: string + + ComplianceStatusListResponse: + type: object + required: + - data + properties: + data: + oneOf: + - type: array + items: + $ref: '#/components/schemas/ComplianceStatusRow' + - type: object + additionalProperties: + type: object + additionalProperties: + type: integer + meta: + $ref: '#/components/schemas/ListMeta' + + ModulesetRow: + type: object + description: A compliance moduleset. Every property is optional, as selected by `props`. + properties: + id: + type: integer + modset_name: + type: string + modset_author: + type: string + modset_updated: + type: string + + ModulesetListResponse: + type: object + required: + - data + properties: + data: + oneOf: + - type: array + items: + $ref: '#/components/schemas/ModulesetRow' + - type: object + additionalProperties: + type: object + additionalProperties: + type: integer + meta: + $ref: '#/components/schemas/ListMeta' + + RulesetRow: + type: object + description: A compliance ruleset. Every property is optional, as selected by `props`. + properties: + id: + type: integer + ruleset_name: + type: string + ruleset_type: + type: string + ruleset_public: + type: string + + RulesetListResponse: + type: object + required: + - data + properties: + data: + oneOf: + - type: array + items: + $ref: '#/components/schemas/RulesetRow' + - type: object + additionalProperties: + type: object + additionalProperties: + type: integer + meta: + $ref: '#/components/schemas/ListMeta' + + WorkflowRow: + type: object + description: | + A request: the workflow started by the submission of a form with a workflow + output. `form_head_id` is the stored submission that started it, + `last_form_id` and `last_form_name` its latest step; `status` is `pending` + while a next step awaits `last_assignee`, `closed` otherwise. Every property + is optional: the `props` query parameter selects which columns the server + returns. `form_name`, `form_folder` and `form_yaml` come from the joined form + revision and are null when it is missing. + properties: + id: + type: integer + form_head_id: + type: integer + form_name: + type: string + nullable: true + last_form_id: + type: integer + nullable: true + last_form_name: + type: string + nullable: true + form_folder: + type: string + nullable: true + status: + type: string + steps: + type: integer + creator: + type: string + last_assignee: + type: string + create_date: + type: string + last_update: + type: string + form_md5: + type: string + nullable: true + form_yaml: + type: string + nullable: true + + WorkflowListResponse: + type: object + required: + - data + properties: + data: + oneOf: + - type: array + items: + $ref: '#/components/schemas/WorkflowRow' + - type: object + additionalProperties: + type: object + additionalProperties: + type: integer + meta: + $ref: '#/components/schemas/ListMeta' + + ComplianceLogRow: + type: object + description: | + A run of a compliance module on a node, or on a service instance on that + node: its action (check, fixable, fix), its exit code (`run_status`: 0 ok, + 1 not ok, 2 not applicable) and its log. Every property is optional: the + `props` query parameter selects which columns the server returns. + properties: + id: + type: integer + run_module: + type: string + run_status: + type: integer + run_log: + type: string + run_date: + type: string + run_action: + type: string + rset_md5: + type: string + node_id: + type: string + svc_id: + type: string + nodes.nodename: + type: string + nullable: true + description: The name of the node, joined. + services.svcname: + type: string + nullable: true + description: The name of the service, joined; null for a run on the node itself. + + ComplianceLogListResponse: + type: object + required: + - data + properties: + data: + oneOf: + - type: array + items: + $ref: '#/components/schemas/ComplianceLogRow' + - type: object + additionalProperties: + type: object + additionalProperties: + type: integer + meta: + $ref: '#/components/schemas/ListMeta' + + RulesetUsage: + type: object + description: What uses a ruleset. + properties: + modulesets: + type: array + items: + type: object + properties: + id: + type: integer + modset_name: + type: string + rulesets: + description: The rulesets holding this one as a child. + type: array + items: + type: object + properties: + id: + type: integer + ruleset_name: + type: string + nodes: + type: array + items: + type: object + properties: + node_id: + type: string + nodename: + type: string + services: + type: array + items: + type: object + properties: + svc_id: + type: string + svcname: + type: string + + RulesetVariableRow: + type: object + description: | + A variable of a compliance ruleset. Every property is optional: the `props` + query parameter selects which columns the server returns. + properties: + id: + type: integer + ruleset_id: + type: integer + var_name: + type: string + var_class: + type: string + var_value: + type: string + nullable: true + var_author: + type: string + var_updated: + type: string + + RulesetVariableListResponse: + type: object + required: + - data + properties: + data: + oneOf: + - type: array + items: + $ref: '#/components/schemas/RulesetVariableRow' + - type: object + additionalProperties: + type: object + additionalProperties: + type: integer + meta: + $ref: '#/components/schemas/ListMeta' + + ModulesetModuleRow: + type: object + description: | + A module of a compliance moduleset. Every property is optional: the `props` + query parameter selects which columns the server returns. + properties: + id: + type: integer + modset_id: + type: integer + modset_mod_name: + type: string + autofix: + type: string + nullable: true + modset_mod_author: + type: string + nullable: true + modset_mod_updated: + type: string + + RulesetsVariableRow: + type: object + description: | + A variable of a compliance ruleset, own or encapsulated, with its ruleset and + the ruleset's filterset and teams. Every property is optional: the `props` + query parameter selects which columns the server returns. + properties: + id: + type: integer + description: The variable id, 0 on the row of a ruleset without variable. + ruleset_id: + type: integer + ruleset_name: + type: string + ruleset_type: + type: string + description: explicit or contextual. + ruleset_public: + type: string + description: T when the ruleset is public, F otherwise. + teams_responsible: + type: string + description: The roles of the groups responsible for the ruleset, comma separated. + teams_publication: + type: string + description: The roles of the groups the ruleset is published to, comma separated. + fset_name: + type: string + description: The filterset of a contextual ruleset. + fset_id: + type: integer + chain: + type: string + description: The path from the ruleset to the encapsulated one, as "a > b > c", empty for its own variables. + chain_len: + type: integer + description: The number of rulesets in the chain, 1 for its own variables. + encap_rset: + type: string + description: The encapsulated ruleset holding the variable, empty for its own variables. + encap_rset_id: + type: integer + description: The id of encap_rset, 0 for its own variables. + var_class: + type: string + var_name: + type: string + var_value: + type: string + var_updated: + type: string + var_author: + type: string + + RulesetsVariableListResponse: + type: object + required: + - data + properties: + data: + oneOf: + - type: array + items: + $ref: '#/components/schemas/RulesetsVariableRow' + - type: object + additionalProperties: + type: object + additionalProperties: + type: integer + meta: + $ref: '#/components/schemas/ListMeta' + + ModulesetsModuleRow: + type: object + description: | + A module of a compliance moduleset, with its moduleset and the moduleset's + teams. Every property is optional: the `props` query parameter selects which + columns the server returns. + properties: + id: + type: integer + description: The module id, 0 on the row of a moduleset without module. + modset_id: + type: integer + modset_name: + type: string + modset_author: + type: string + modset_updated: + type: string + modset_mod_name: + type: string + autofix: + type: string + description: T when the module is fixed without being asked, F otherwise. + modset_mod_author: + type: string + modset_mod_updated: + type: string + teams_responsible: + type: string + description: The roles of the groups responsible for the moduleset, comma separated. + teams_publication: + type: string + description: The roles of the groups the moduleset is published to, comma separated. + + ModulesetsModuleListResponse: + type: object + required: + - data + properties: + data: + oneOf: + - type: array + items: + $ref: '#/components/schemas/ModulesetsModuleRow' + - type: object + additionalProperties: + type: object + additionalProperties: + type: integer + meta: + $ref: '#/components/schemas/ListMeta' + + ModulesetModuleListResponse: + type: object + required: + - data + properties: + data: + oneOf: + - type: array + items: + $ref: '#/components/schemas/ModulesetModuleRow' + - type: object + additionalProperties: + type: object + additionalProperties: + type: integer + meta: + $ref: '#/components/schemas/ListMeta' + + CompExportVariable: + type: object + properties: + id: + type: integer + var_name: + type: string + var_value: + type: string + var_class: + type: string + var_author: + type: string + var_updated: + type: string + + CompExportRuleset: + type: object + properties: + id: + type: integer + ruleset_name: + type: string + ruleset_public: + type: string + ruleset_type: + type: string + fset_name: + type: string + nullable: true + variables: + type: array + items: + $ref: '#/components/schemas/CompExportVariable' + rulesets: + description: The names of the child rulesets + type: array + items: + type: string + publications: + description: The roles of the publication groups + type: array + items: + type: string + responsibles: + description: The roles of the responsible groups + type: array + items: + type: string + + CompExportModule: + type: object + properties: + modset_mod_name: + type: string + autofix: + type: string + + CompExportModuleset: + type: object + properties: + id: + type: integer + modset_name: + type: string + modules: + type: array + items: + $ref: '#/components/schemas/CompExportModule' + modulesets: + description: The names of the child modulesets + type: array + items: + type: string + rulesets: + description: The names of the attached rulesets + type: array + items: + type: string + publications: + type: array + items: + type: string + responsibles: + type: array + items: + type: string + + CompRulesetExport: + type: object + description: | + Rulesets with their descendants and the filtersets they use, in the format + POST /compliance/import reads. + properties: + filtersets: + type: array + items: + $ref: '#/components/schemas/FiltersetExportItem' + rulesets: + type: array + items: + $ref: '#/components/schemas/CompExportRuleset' + + CompModulesetExport: + type: object + description: | + Modulesets with their descendants, and the rulesets and filtersets they use, + in the format POST /compliance/import reads. + properties: + filtersets: + type: array + items: + $ref: '#/components/schemas/FiltersetExportItem' + rulesets: + type: array + items: + $ref: '#/components/schemas/CompExportRuleset' + modulesets: + type: array + items: + $ref: '#/components/schemas/CompExportModuleset' + + InstanceListResponse: + type: object + required: + - data + properties: + data: + oneOf: + - type: array + items: + $ref: '#/components/schemas/InstanceRow' + - type: object + additionalProperties: + type: object + additionalProperties: + type: integer + meta: + $ref: '#/components/schemas/ListMeta' + + ObsolescenceSettingRow: + type: object + description: | + An obsolescence setting: the warning and alert dates applied to the nodes + running a hardware model (`obs_type` "hw") or an OS release (`obs_type` "os"). + Every property is optional: the `props` query parameter selects which columns + the server returns. Unset dates are returned as empty strings. `obs_count` is + the number of nodes the setting applies to; hardware models whose name contains + "virt" or "cluster" are not counted. + properties: + id: + type: integer + obs_type: + type: string + enum: [hw, os] + obs_name: + type: string + obs_warn_date: + type: string + obs_alert_date: + type: string + obs_warn_date_updated_by: + type: string + obs_alert_date_updated_by: + type: string + obs_warn_date_updated: + type: string + obs_alert_date_updated: + type: string + obs_count: + type: integer + + ObsolescenceSettingListResponse: + type: object + required: + - data + properties: + data: + oneOf: + - type: array + items: + $ref: '#/components/schemas/ObsolescenceSettingRow' + - type: object + additionalProperties: + type: object + additionalProperties: + type: integer + meta: + $ref: '#/components/schemas/ListMeta' + + LogRow: + type: object + description: | + A collector log event. Every property is optional: the `props` query + parameter selects which columns the server returns. The message is `log_fmt` + with each `%(key)s` or `%(key)d` placeholder replaced by the matching value of + `log_dict`, a JSON object serialized as a string. `node_id` and `svc_id` are + empty strings when the event names no node or service; the `nodes.` and + `services.` properties come from LEFT JOINs and are then null. + properties: + id: + type: integer + log_action: + type: string + log_user: + type: string + log_fmt: + type: string + log_dict: + type: string + nullable: true + log_date: + type: string + svc_id: + type: string + node_id: + type: string + log_level: + type: string + log_entry_id: + type: integer + nullable: true + log_gtalk_sent: + type: integer + nullable: true + log_email_sent: + type: integer + nullable: true + nodes.nodename: + type: string + nullable: true + nodes.os_name: + type: string + nullable: true + services.svcname: + type: string + nullable: true + + LogListResponse: + type: object + required: + - data + properties: + data: + oneOf: + - type: array + items: + $ref: '#/components/schemas/LogRow' + - type: object + additionalProperties: + type: object + additionalProperties: + type: integer + meta: + $ref: '#/components/schemas/ListMeta' + + FilterRow: + type: object + description: | + A filter: one condition on a column of a collector table, which filtersets + combine. Every property is optional: the `props` query parameter selects which + columns the server returns. `f_label` and `f_cksum` are computed by the + database from the definition. + properties: + id: + type: integer + f_table: + type: string + f_field: + type: string + f_op: + type: string + f_value: + type: string + nullable: true + f_label: + type: string + f_cksum: + type: string + f_author: + type: string + f_updated: + type: string + + FormRow: + type: object + description: | + A form: its definition, form_yaml, drives the inputs a submission expects + and the outputs it runs. form_definition is form_yaml parsed. Every + property is optional: the `props` query parameter selects which columns + the server returns. + properties: + id: + type: integer + form_name: + type: string + form_yaml: + type: string + form_definition: + nullable: true + description: form_yaml parsed, absent when it does not parse + form_author: + type: string + form_created: + type: string + form_type: + type: string + description: obj, custo, folder or generic + form_folder: + type: string + + FormListResponse: + type: object + required: + - data + properties: + data: + oneOf: + - type: array + items: + $ref: '#/components/schemas/FormRow' + - type: object + additionalProperties: + type: object + additionalProperties: + type: integer + meta: + $ref: '#/components/schemas/ListMeta' + info: + type: string + description: The change made, on a modification + + FilterListResponse: + type: object + required: + - data + properties: + data: + oneOf: + - type: array + items: + $ref: '#/components/schemas/FilterRow' + - type: object + additionalProperties: + type: object + additionalProperties: + type: integer + meta: + $ref: '#/components/schemas/ListMeta' + + FiltersetRow: + type: object + description: | + A filterset: an ordered combination of filters and other filtersets that + selects nodes and services. Every property is optional: the `props` query + parameter selects which columns the server returns. + properties: + id: + type: integer + fset_name: + type: string + fset_stats: + type: string + description: T for a stats filterset, F otherwise. + fset_author: + type: string + fset_updated: + type: string + + FiltersetListResponse: + type: object + required: + - data + properties: + data: + oneOf: + - type: array + items: + $ref: '#/components/schemas/FiltersetRow' + - type: object + additionalProperties: + type: object + additionalProperties: + type: integer + meta: + $ref: '#/components/schemas/ListMeta' + + FiltersetFilterRow: + type: object + description: | + A filter attached to a filterset: the filter properties, plus its position + (`f_order`) and the logical operator joining it to the previous entry. + properties: + id: + type: integer + f_table: + type: string + f_field: + type: string + f_op: + type: string + f_value: + type: string + nullable: true + f_label: + type: string + f_cksum: + type: string + f_author: + type: string + f_updated: + type: string + f_log_op: + type: string + f_order: + type: integer + fset_id: + type: integer + encap_fset_id: + type: integer + nullable: true + join_id: + type: integer + + FiltersetFilterListResponse: + type: object + required: + - data + properties: + data: + oneOf: + - type: array + items: + $ref: '#/components/schemas/FiltersetFilterRow' + - type: object + additionalProperties: + type: object + additionalProperties: + type: integer + meta: + $ref: '#/components/schemas/ListMeta' + + FiltersetUsageResponse: + type: object + required: + - data + properties: + data: + type: object + required: [filtersets, rulesets, thresholds] + properties: + filtersets: + type: array + description: Filtersets encapsulating this one. + items: + $ref: '#/components/schemas/FiltersetRef' + rulesets: + type: array + description: Compliance rulesets restricted by this filterset. The ruleset name is in `fset_name`. + items: + $ref: '#/components/schemas/FiltersetRef' + thresholds: + type: array + description: Check thresholds, as "chk_type.chk_instance:low-high". + items: + type: string + + FiltersetRef: + type: object + required: [id] + properties: + id: + type: integer + fset_name: + type: string + + FiltersetExport: + type: object + description: | + A filterset and every filterset it encapsulates, recursively, each with its + ordered entries. An entry holds either a filter or the name of an + encapsulated filterset. + required: [filtersets] + properties: + filtersets: + type: array + items: + $ref: '#/components/schemas/FiltersetExportItem' + + FiltersetExportItem: + type: object + required: [id, fset_name, filters] + properties: + id: + type: integer + fset_name: + type: string + fset_stats: + type: string + nullable: true + filters: + type: array + items: + $ref: '#/components/schemas/FiltersetExportEntry' + + FiltersetExportEntry: + type: object + required: [f_log_op, f_order] + properties: + f_log_op: + type: string + f_order: + type: integer + filter: + nullable: true + allOf: + - $ref: '#/components/schemas/FiltersetExportFilter' + filterset: + type: string + nullable: true + description: Name of the encapsulated filterset, when the entry is not a filter. + + FiltersetExportFilter: + type: object + required: [id, f_table, f_field, f_op, f_value] + properties: + id: + type: integer + f_table: + type: string + f_field: + type: string + f_op: + type: string + f_value: + type: string + + NodeHardwareRow: + type: object + description: | + A hardware component of a node, as reported by the agent's asset push: + `hw_type` is the component family (for example `pci` or `mem`), `hw_path` its + address. Every property is optional: the `props` query parameter selects which + columns the server returns. The `nodes.` properties come from the joined nodes + table, null for a component of an unknown node. + properties: + id: + type: integer + node_id: + type: string + hw_type: + type: string + hw_path: + type: string + hw_class: + type: string + hw_description: + type: string + hw_driver: + type: string + updated: + type: string + nodes.nodename: + type: string + nullable: true + nodes.app: + type: string + nullable: true + nodes.os_name: + type: string + nullable: true + + NodeHardwareListResponse: + type: object + required: + - data + properties: + data: + oneOf: + - type: array + items: + $ref: '#/components/schemas/NodeHardwareRow' + - type: object + additionalProperties: + type: object + additionalProperties: + type: integer + meta: + $ref: '#/components/schemas/ListMeta' + + HbaRow: + type: object + description: | + A host bus adapter of a node, as reported by the agent: `hba_id` is its + initiator identifier (an iSCSI IQN or a Fibre Channel WWPN), `hba_type` its + transport. Every property is optional: the `props` query parameter selects + which columns the server returns. + properties: + id: + type: integer + node_id: + type: string + hba_id: + type: string + hba_type: + type: string + nullable: true + updated: + type: string + + HbaListResponse: + type: object + required: + - data + properties: + data: + oneOf: + - type: array + items: + $ref: '#/components/schemas/HbaRow' + - type: object + additionalProperties: + type: object + additionalProperties: + type: integer + meta: + $ref: '#/components/schemas/ListMeta' + + NetworkRow: + type: object + description: | + A declared network. `begin`, `end` and `broadcast` are computed from + `network` and `netmask`. + properties: + id: + type: integer + name: + type: string + network: + type: string + netmask: + type: integer + broadcast: + type: string + gateway: + type: string + begin: + type: string + end: + type: string + pvid: + type: integer + prio: + type: integer + team_responsible: + type: string + comment: + type: string + updated: + type: string - schemas: - ListMeta: + NetworkListResponse: type: object required: + - data properties: - count: - type: integer - available_props: + data: type: array items: - type: string - included_props: + $ref: '#/components/schemas/NetworkRow' + meta: + $ref: '#/components/schemas/ListMeta' + info: + type: string + + SearchGroup: + type: object + description: The objects of one kind matching a search. + required: + - kind + - items + - more + properties: + kind: + type: string + enum: [node, service, instance, app, network, disk, tag, user, group, request, moduleset, ruleset, filterset, form] + items: type: array + description: | + One entry per object, with the props of its kind: node_id, nodename, app, + node_env, cluster_id, fqdn, os_name for a node; svc_id, svcname, svc_app, + svc_env, cluster_id, svc_availstatus, svc_topology for a service; svc_id, + node_id, mon_vmname, mon_availstatus, services.svcname, nodes.nodename for + an instance; id, app, app_domain, description for an application; id, addr, + mask, intf, node_id, nodename, net_name for a node address; disk_id, + disk_name, disk_size, disk_arrayid, nodename, svcname for a disk; tag_id, + tag_name, tag_exclude for a tag; id, email, first_name, last_name, username + for a user; id, role, privilege, description for a team; id, form_name, + last_form_name, status, creator, last_update for a request; id, + modset_name, modset_author for a moduleset; id, ruleset_name, ruleset_type, + ruleset_public for a ruleset; id, fset_name, fset_author for a filterset; + id, form_name, form_type, form_folder for a form. items: - type: string - limit: + type: object + additionalProperties: true + more: + type: boolean + description: Other objects of the kind match beyond those returned. + error: + type: string + description: Set when the kind could not be searched. + + SearchResponse: + type: object + required: + - data + properties: + data: + type: array + items: + $ref: '#/components/schemas/SearchGroup' + + NetworkSegmentRow: + type: object + description: An address range of a network, delegated to its responsible groups. + properties: + id: type: integer - offset: + net_id: type: integer - distinct: - type: object - additionalProperties: - type: integer - total: + seg_type: + type: string + enum: [static, dynamic] + seg_begin: + type: string + seg_end: + type: string + + NetworkSegmentListResponse: + type: object + required: + - data + properties: + data: + type: array + items: + $ref: '#/components/schemas/NetworkSegmentRow' + info: + type: string + + AlertListResponse: + type: object + required: + - data + properties: + data: + oneOf: + - type: array + items: + $ref: '#/components/schemas/AlertRow' + - type: object + additionalProperties: + type: object + additionalProperties: + type: integer + meta: + $ref: '#/components/schemas/ListMeta' + + AppRow: + type: object + description: | + An application code. Every property is optional: the `props` query + parameter selects which columns the server returns. + properties: + id: + type: integer + app: + type: string + updated: + type: string + app_domain: + type: string + app_team_ops: + type: string + description: + type: string + + AppListResponse: + type: object + required: + - data + properties: + data: + oneOf: + - type: array + items: + $ref: '#/components/schemas/AppRow' + - type: object + additionalProperties: + type: object + additionalProperties: + type: integer + meta: + $ref: '#/components/schemas/ListMeta' + + InfoResponse: + type: object + description: Outcome message of a write that returns no record. + properties: + info: + type: string + + IpRow: + type: object + description: | + An IP address detected on a node, joined to the network it belongs to. + Every property is optional: the `props` query parameter selects which + columns the server returns. + properties: + id: + type: integer + node_id: + type: string + nodename: + type: string + intf: + type: string + mac: + type: string + type: + type: string + addr: + type: string + mask: + type: string + updated: + type: string + flag_deprecated: + type: integer + net_id: + type: integer + net_name: + type: string + net_network: + type: string + net_netmask: + type: string + net_broadcast: + type: string + net_gateway: + type: string + net_begin: + type: string + net_end: + type: string + net_pvid: + type: string + net_prio: + type: integer + net_comment: + type: string + net_team_responsible: + type: string + + IpListResponse: + type: object + required: + - data + properties: + data: + oneOf: + - type: array + items: + $ref: '#/components/schemas/IpRow' + - type: object + additionalProperties: + type: object + additionalProperties: + type: integer + meta: + $ref: '#/components/schemas/ListMeta' + + DiskRow: + type: object + description: | + A disk seen on a node, with the service and array it belongs to when + known. Every property is optional: the `props` query parameter selects + which columns the server returns. + properties: + disk_id: + type: string + disk_name: + type: string + disk_devid: + type: string + disk_vendor: + type: string + disk_model: + type: string + disk_size: + type: integer + disk_used: + type: integer + disk_alloc: + type: integer + disk_raid: + type: string + disk_group: + type: string + disk_level: + type: integer + disk_arrayid: + type: string + disk_dg: + type: string + disk_region: + type: string + node_id: + type: string + nodename: + type: string + svc_id: + type: string + svcname: + type: string + app: + type: string + updated: + type: string + + DiskListResponse: + type: object + required: + - data + properties: + data: + oneOf: + - type: array + items: + $ref: '#/components/schemas/DiskRow' + - type: object + additionalProperties: + type: object + additionalProperties: + type: integer + meta: + $ref: '#/components/schemas/ListMeta' + + GroupRow: + type: object + description: | + A user group. `privilege` is "T" for a privilege-granting group and + "F" for an ordinary one. Every property is optional: the `props` query + parameter selects which columns the server returns. + properties: + id: + type: integer + role: + type: string + privilege: + type: string + description: + type: string + + GroupListResponse: + type: object + required: + - data + properties: + data: + oneOf: + - type: array + items: + $ref: '#/components/schemas/GroupRow' + - type: object + additionalProperties: + type: object + additionalProperties: + type: integer + meta: + $ref: '#/components/schemas/ListMeta' + + UserRow: + type: object + description: | + A user of the users list. `password` and `registration_key` are never + returned. The boolean-like columns (`email_notifications`, + `im_notifications`, `lock_filter`) carry the collector's "T"/"F" + convention, and the delay and quota columns are returned as strings. + Every property is optional: the `props` query parameter selects which + columns the server returns. + properties: + id: type: integer + username: + type: string + email: + type: string + first_name: + type: string + last_name: + type: string + phone_work: + type: string + im_type: + type: string + im_username: + type: string + email_notifications: + type: string + im_notifications: + type: string + email_log_level: + type: string + im_log_level: + type: string + email_notifications_delay: + type: string + im_notifications_delay: + type: string + lock_filter: + type: string + registration_id: + type: string + reset_password_key: + type: string + quota_app: + type: string + quota_org_group: + type: string + quota_docker_registries: + type: string + + UserPrefsResponse: + type: object + required: + - data + description: | + The stored preferences, as saved by POST /users/{user_id}/prefs. The + collector never interprets the content; an empty object means "no + preferences stored", "user unknown" or "user not visible" alike. + properties: + data: + type: object + additionalProperties: true + + UserListResponse: + type: object + required: + - data + properties: + data: + oneOf: + - type: array + items: + $ref: '#/components/schemas/UserRow' + - type: object + additionalProperties: + type: object + additionalProperties: + type: integer + meta: + $ref: '#/components/schemas/ListMeta' ListResponse: type: object @@ -7343,7 +14994,11 @@ components: in: query name: meta required: false - description: Include metadata in the response. Enabled by default. Use false or 0 to omit the meta field. + description: | + Include metadata in the response. Enabled by default. Use false or 0 to omit + the meta field. The metadata of a list carries its total number of rows + without pagination (total), as well as the rows returned (count), the offset + and the limit. schema: type: string @@ -7365,6 +15020,28 @@ components: schema: type: string + inQueryFilter: + in: query + name: filter + required: false + description: | + Column filter, repeatable; several filters combine with AND. Each value is + `prop:expr`, `prop` being a property of the list (joined ones included, as + for orderby) and `expr` one of: + - text: case-insensitive match anywhere in the value; + - `~regex`: regular expression (RE2 syntax), case-insensitive; + - `in:a,b,c`: one of the listed values; + - `eq:v`, `ne:v`: equal, not equal; + - `gt:v`, `gte:v`, `lt:v`, `lte:v`: comparisons, for numbers and dates; + - `empty`, `!empty`: no value, any value. + An unknown property, a property without a column, or an invalid regular + expression is answered with 400. + explode: true + schema: + type: array + items: + type: string + inQueryProps: in: query name: props diff --git a/server/codegen_server_gen.go b/server/codegen_server_gen.go index ff82e61a..3c260793 100644 --- a/server/codegen_server_gen.go +++ b/server/codegen_server_gen.go @@ -1,11 +1,11 @@ // Package server provides primitives to interact with the openapi HTTP API. // -// Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.5.1 DO NOT EDIT. +// Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.7.1 DO NOT EDIT. package server import ( "bytes" - "compress/gzip" + "compress/flate" "encoding/base64" "fmt" "net/http" @@ -27,6 +27,9 @@ type ServerInterface interface { // (POST /actions) PostActions(ctx echo.Context) error + // (PUT /actions) + PutActions(ctx echo.Context) error + // (DELETE /actions/{id}) DeleteAction(ctx echo.Context, id string) error @@ -120,6 +123,267 @@ type ServerInterface interface { // (POST /auth/node) PostAuthNode(ctx echo.Context) error + // (POST /compliance/import) + PostComplianceImport(ctx echo.Context) error + + // (GET /compliance/logs) + GetComplianceLogs(ctx echo.Context, params GetComplianceLogsParams) error + + // (GET /compliance/logs/{log_id}) + GetComplianceLog(ctx echo.Context, logId string, params GetComplianceLogParams) error + + // (DELETE /compliance/modulesets) + DeleteComplianceModulesets(ctx echo.Context) error + + // (GET /compliance/modulesets) + GetComplianceModulesets(ctx echo.Context, params GetComplianceModulesetsParams) error + + // (POST /compliance/modulesets) + PostComplianceModulesets(ctx echo.Context) error + + // (GET /compliance/modulesets/export) + GetComplianceModulesetsExport(ctx echo.Context) error + + // (DELETE /compliance/modulesets/{modset_id}) + DeleteComplianceModuleset(ctx echo.Context, modsetId string) error + + // (GET /compliance/modulesets/{modset_id}) + GetComplianceModuleset(ctx echo.Context, modsetId string, params GetComplianceModulesetParams) error + + // (POST /compliance/modulesets/{modset_id}) + PostComplianceModuleset(ctx echo.Context, modsetId string) error + + // (PUT /compliance/modulesets/{modset_id}) + PutComplianceModuleset(ctx echo.Context, modsetId string) error + + // (GET /compliance/modulesets/{modset_id}/am_i_responsible) + GetComplianceModulesetAmIResponsible(ctx echo.Context, modsetId string) error + + // (GET /compliance/modulesets/{modset_id}/candidate_nodes) + GetComplianceModulesetCandidateNodes(ctx echo.Context, modsetId string, params GetComplianceModulesetCandidateNodesParams) error + + // (GET /compliance/modulesets/{modset_id}/candidate_services) + GetComplianceModulesetCandidateServices(ctx echo.Context, modsetId string, params GetComplianceModulesetCandidateServicesParams) error + + // (GET /compliance/modulesets/{modset_id}/export) + GetComplianceModulesetExport(ctx echo.Context, modsetId string) error + + // (GET /compliance/modulesets/{modset_id}/modules) + GetComplianceModulesetModules(ctx echo.Context, modsetId string, params GetComplianceModulesetModulesParams) error + + // (POST /compliance/modulesets/{modset_id}/modules) + PostComplianceModulesetModules(ctx echo.Context, modsetId string) error + + // (DELETE /compliance/modulesets/{modset_id}/modules/{mod_id}) + DeleteComplianceModulesetModule(ctx echo.Context, modsetId string, modId string) error + + // (GET /compliance/modulesets/{modset_id}/modules/{mod_id}) + GetComplianceModulesetModule(ctx echo.Context, modsetId string, modId string, params GetComplianceModulesetModuleParams) error + + // (POST /compliance/modulesets/{modset_id}/modules/{mod_id}) + PostComplianceModulesetModule(ctx echo.Context, modsetId string, modId string) error + + // (DELETE /compliance/modulesets/{modset_id}/modulesets/{child_modset_id}) + DeleteComplianceModulesetModuleset(ctx echo.Context, modsetId string, childModsetId string) error + + // (POST /compliance/modulesets/{modset_id}/modulesets/{child_modset_id}) + PostComplianceModulesetModuleset(ctx echo.Context, modsetId string, childModsetId string) error + + // (GET /compliance/modulesets/{modset_id}/nodes) + GetComplianceModulesetNodes(ctx echo.Context, modsetId string, params GetComplianceModulesetNodesParams) error + + // (GET /compliance/modulesets/{modset_id}/publications) + GetComplianceModulesetPublications(ctx echo.Context, modsetId string, params GetComplianceModulesetPublicationsParams) error + + // (DELETE /compliance/modulesets/{modset_id}/publications/{group_id}) + DeleteComplianceModulesetPublication(ctx echo.Context, modsetId string, groupId string) error + + // (POST /compliance/modulesets/{modset_id}/publications/{group_id}) + PostComplianceModulesetPublication(ctx echo.Context, modsetId string, groupId string) error + + // (GET /compliance/modulesets/{modset_id}/responsibles) + GetComplianceModulesetResponsibles(ctx echo.Context, modsetId string, params GetComplianceModulesetResponsiblesParams) error + + // (DELETE /compliance/modulesets/{modset_id}/responsibles/{group_id}) + DeleteComplianceModulesetResponsible(ctx echo.Context, modsetId string, groupId string) error + + // (POST /compliance/modulesets/{modset_id}/responsibles/{group_id}) + PostComplianceModulesetResponsible(ctx echo.Context, modsetId string, groupId string) error + + // (DELETE /compliance/modulesets/{modset_id}/rulesets/{rset_id}) + DeleteComplianceModulesetRuleset(ctx echo.Context, modsetId string, rsetId string) error + + // (POST /compliance/modulesets/{modset_id}/rulesets/{rset_id}) + PostComplianceModulesetRuleset(ctx echo.Context, modsetId string, rsetId string) error + + // (GET /compliance/modulesets/{modset_id}/services) + GetComplianceModulesetServices(ctx echo.Context, modsetId string, params GetComplianceModulesetServicesParams) error + + // (GET /compliance/modulesets/{modset_id}/usage) + GetComplianceModulesetUsage(ctx echo.Context, modsetId string) error + + // (GET /compliance/modulesets_modules) + GetComplianceModulesetsModules(ctx echo.Context, params GetComplianceModulesetsModulesParams) error + + // (DELETE /compliance/modulesets_nodes) + DeleteComplianceModulesetsNodes(ctx echo.Context) error + + // (POST /compliance/modulesets_nodes) + PostComplianceModulesetsNodes(ctx echo.Context) error + + // (DELETE /compliance/modulesets_publications) + DeleteComplianceModulesetsPublications(ctx echo.Context) error + + // (POST /compliance/modulesets_publications) + PostComplianceModulesetsPublications(ctx echo.Context) error + + // (DELETE /compliance/modulesets_responsibles) + DeleteComplianceModulesetsResponsibles(ctx echo.Context) error + + // (POST /compliance/modulesets_responsibles) + PostComplianceModulesetsResponsibles(ctx echo.Context) error + + // (DELETE /compliance/modulesets_services) + DeleteComplianceModulesetsServices(ctx echo.Context) error + + // (POST /compliance/modulesets_services) + PostComplianceModulesetsServices(ctx echo.Context) error + + // (DELETE /compliance/rulesets) + DeleteComplianceRulesets(ctx echo.Context) error + + // (GET /compliance/rulesets) + GetComplianceRulesets(ctx echo.Context, params GetComplianceRulesetsParams) error + + // (POST /compliance/rulesets) + PostComplianceRulesets(ctx echo.Context) error + + // (GET /compliance/rulesets/export) + GetComplianceRulesetsExport(ctx echo.Context) error + + // (DELETE /compliance/rulesets/{rset_id}) + DeleteComplianceRuleset(ctx echo.Context, rsetId string) error + + // (GET /compliance/rulesets/{rset_id}) + GetComplianceRuleset(ctx echo.Context, rsetId string, params GetComplianceRulesetParams) error + + // (POST /compliance/rulesets/{rset_id}) + PostComplianceRuleset(ctx echo.Context, rsetId string) error + + // (PUT /compliance/rulesets/{rset_id}) + PutComplianceRuleset(ctx echo.Context, rsetId string) error + + // (GET /compliance/rulesets/{rset_id}/am_i_responsible) + GetComplianceRulesetAmIResponsible(ctx echo.Context, rsetId string) error + + // (GET /compliance/rulesets/{rset_id}/candidate_nodes) + GetComplianceRulesetCandidateNodes(ctx echo.Context, rsetId string, params GetComplianceRulesetCandidateNodesParams) error + + // (GET /compliance/rulesets/{rset_id}/candidate_services) + GetComplianceRulesetCandidateServices(ctx echo.Context, rsetId string, params GetComplianceRulesetCandidateServicesParams) error + + // (GET /compliance/rulesets/{rset_id}/export) + GetComplianceRulesetExport(ctx echo.Context, rsetId string) error + + // (DELETE /compliance/rulesets/{rset_id}/filtersets/{fset_id}) + DeleteComplianceRulesetFilterset(ctx echo.Context, rsetId string, fsetId string) error + + // (POST /compliance/rulesets/{rset_id}/filtersets/{fset_id}) + PostComplianceRulesetFilterset(ctx echo.Context, rsetId string, fsetId string) error + + // (GET /compliance/rulesets/{rset_id}/nodes) + GetComplianceRulesetNodes(ctx echo.Context, rsetId string, params GetComplianceRulesetNodesParams) error + + // (GET /compliance/rulesets/{rset_id}/publications) + GetComplianceRulesetPublications(ctx echo.Context, rsetId string, params GetComplianceRulesetPublicationsParams) error + + // (DELETE /compliance/rulesets/{rset_id}/publications/{group_id}) + DeleteComplianceRulesetPublication(ctx echo.Context, rsetId string, groupId string) error + + // (POST /compliance/rulesets/{rset_id}/publications/{group_id}) + PostComplianceRulesetPublication(ctx echo.Context, rsetId string, groupId string) error + + // (GET /compliance/rulesets/{rset_id}/responsibles) + GetComplianceRulesetResponsibles(ctx echo.Context, rsetId string, params GetComplianceRulesetResponsiblesParams) error + + // (DELETE /compliance/rulesets/{rset_id}/responsibles/{group_id}) + DeleteComplianceRulesetResponsible(ctx echo.Context, rsetId string, groupId string) error + + // (POST /compliance/rulesets/{rset_id}/responsibles/{group_id}) + PostComplianceRulesetResponsible(ctx echo.Context, rsetId string, groupId string) error + + // (DELETE /compliance/rulesets/{rset_id}/rulesets/{child_rset_id}) + DeleteComplianceRulesetRuleset(ctx echo.Context, rsetId string, childRsetId string) error + + // (POST /compliance/rulesets/{rset_id}/rulesets/{child_rset_id}) + PostComplianceRulesetRuleset(ctx echo.Context, rsetId string, childRsetId string) error + + // (GET /compliance/rulesets/{rset_id}/services) + GetComplianceRulesetServices(ctx echo.Context, rsetId string, params GetComplianceRulesetServicesParams) error + + // (GET /compliance/rulesets/{rset_id}/usage) + GetComplianceRulesetUsage(ctx echo.Context, rsetId string) error + + // (GET /compliance/rulesets/{rset_id}/variables) + GetComplianceRulesetVariables(ctx echo.Context, rsetId string, params GetComplianceRulesetVariablesParams) error + + // (POST /compliance/rulesets/{rset_id}/variables) + PostComplianceRulesetVariables(ctx echo.Context, rsetId string) error + + // (DELETE /compliance/rulesets/{rset_id}/variables/{var_id}) + DeleteComplianceRulesetVariable(ctx echo.Context, rsetId string, varId string) error + + // (GET /compliance/rulesets/{rset_id}/variables/{var_id}) + GetComplianceRulesetVariable(ctx echo.Context, rsetId string, varId string, params GetComplianceRulesetVariableParams) error + + // (POST /compliance/rulesets/{rset_id}/variables/{var_id}) + PostComplianceRulesetVariable(ctx echo.Context, rsetId string, varId string) error + + // (PUT /compliance/rulesets/{rset_id}/variables/{var_id}) + PutComplianceRulesetVariable(ctx echo.Context, rsetId string, varId string) error + + // (DELETE /compliance/rulesets_nodes) + DeleteComplianceRulesetsNodes(ctx echo.Context) error + + // (POST /compliance/rulesets_nodes) + PostComplianceRulesetsNodes(ctx echo.Context) error + + // (DELETE /compliance/rulesets_publications) + DeleteComplianceRulesetsPublications(ctx echo.Context) error + + // (POST /compliance/rulesets_publications) + PostComplianceRulesetsPublications(ctx echo.Context) error + + // (DELETE /compliance/rulesets_responsibles) + DeleteComplianceRulesetsResponsibles(ctx echo.Context) error + + // (POST /compliance/rulesets_responsibles) + PostComplianceRulesetsResponsibles(ctx echo.Context) error + + // (DELETE /compliance/rulesets_services) + DeleteComplianceRulesetsServices(ctx echo.Context) error + + // (POST /compliance/rulesets_services) + PostComplianceRulesetsServices(ctx echo.Context) error + + // (GET /compliance/rulesets_variables) + GetComplianceRulesetsVariables(ctx echo.Context, params GetComplianceRulesetsVariablesParams) error + + // (POST /compliance/rulesets_variables) + PostComplianceRulesetsVariables(ctx echo.Context) error + + // (DELETE /compliance/status) + DeleteComplianceStatus(ctx echo.Context) error + + // (GET /compliance/status) + GetComplianceStatus(ctx echo.Context, params GetComplianceStatusParams) error + + // (DELETE /compliance/status/{status_id}) + DeleteComplianceStatusRun(ctx echo.Context, statusId string) error + + // (GET /compliance/status/{status_id}) + GetComplianceStatusRun(ctx echo.Context, statusId string, params GetComplianceStatusRunParams) error + // (DELETE /disks) DeleteDisks(ctx echo.Context) error @@ -213,6 +477,93 @@ type ServerInterface interface { // (POST /filtersets_filtersets) PostFiltersetsFiltersets(ctx echo.Context) error + // (GET /form_output_results/{results_id}) + GetFormOutputResults(ctx echo.Context, resultsId int) error + + // (PUT /form_output_results/{results_id}) + PutFormOutputResults(ctx echo.Context, resultsId int) error + + // (DELETE /forms) + DeleteForms(ctx echo.Context) error + + // (GET /forms) + GetForms(ctx echo.Context, params GetFormsParams) error + + // (POST /forms) + PostForms(ctx echo.Context) error + + // (DELETE /forms/{form_id}) + DeleteForm(ctx echo.Context, formId int) error + + // (GET /forms/{form_id}) + GetForm(ctx echo.Context, formId int, params GetFormParams) error + + // (POST /forms/{form_id}) + PostForm(ctx echo.Context, formId int) error + + // (PUT /forms/{form_id}) + PutForm(ctx echo.Context, formId int) error + + // (GET /forms/{form_id}/am_i_responsible) + GetFormAmIResponsible(ctx echo.Context, formId int) error + + // (GET /forms/{form_id}/diff/{cid}) + GetFormDiff(ctx echo.Context, formId int, cid string, params GetFormDiffParams) error + + // (GET /forms/{form_id}/publications) + GetFormPublications(ctx echo.Context, formId int, params GetFormPublicationsParams) error + + // (DELETE /forms/{form_id}/publications/{group_id}) + DeleteFormPublication(ctx echo.Context, formId int, groupId string) error + + // (POST /forms/{form_id}/publications/{group_id}) + PostFormPublication(ctx echo.Context, formId int, groupId string) error + + // (GET /forms/{form_id}/responsibles) + GetFormResponsibles(ctx echo.Context, formId int, params GetFormResponsiblesParams) error + + // (DELETE /forms/{form_id}/responsibles/{group_id}) + DeleteFormResponsible(ctx echo.Context, formId int, groupId string) error + + // (POST /forms/{form_id}/responsibles/{group_id}) + PostFormResponsible(ctx echo.Context, formId int, groupId string) error + + // (GET /forms/{form_id}/revisions) + GetFormRevisions(ctx echo.Context, formId int) error + + // (GET /forms/{form_id}/revisions/{cid}) + GetFormRevision(ctx echo.Context, formId int, cid string) error + + // (POST /forms/{form_id}/rollback/{cid}) + PostFormRollback(ctx echo.Context, formId int, cid string) error + + // (DELETE /forms_publications) + DeleteFormsPublications(ctx echo.Context) error + + // (POST /forms_publications) + PostFormsPublications(ctx echo.Context) error + + // (DELETE /forms_responsibles) + DeleteFormsResponsibles(ctx echo.Context) error + + // (POST /forms_responsibles) + PostFormsResponsibles(ctx echo.Context) error + + // (GET /forms_revisions) + GetFormsRevisions(ctx echo.Context, params GetFormsRevisionsParams) error + + // (GET /forms_revisions/{revision_id}) + GetFormsRevision(ctx echo.Context, revisionId string, params GetFormsRevisionParams) error + + // (GET /forms_store) + GetFormsStore(ctx echo.Context, params GetFormsStoreParams) error + + // (GET /forms_store/{store_id}) + GetFormStore(ctx echo.Context, storeId int, params GetFormStoreParams) error + + // (GET /forms_store/{store_id}/dump) + GetFormStoreDump(ctx echo.Context, storeId int) error + // (GET /frontend/hidden_menu_entries) GetFrontendHiddenMenuEntries(ctx echo.Context, params GetFrontendHiddenMenuEntriesParams) error @@ -282,6 +633,15 @@ type ServerInterface interface { // (GET /logs/{log_id}) GetLog(ctx echo.Context, logId string, params GetLogParams) error + // (GET /networks) + GetNetworks(ctx echo.Context, params GetNetworksParams) error + + // (POST /networks) + PostNetworks(ctx echo.Context) error + + // (POST /networks/{net_id}/segments) + PostNetworkSegments(ctx echo.Context, netId string) error + // (DELETE /nodes) DeleteNodes(ctx echo.Context) error @@ -402,6 +762,15 @@ type ServerInterface interface { // (GET /openapi.json) GetSwagger(ctx echo.Context) error + // (GET /packages) + GetPackages(ctx echo.Context, params GetPackagesParams) error + + // (GET /packages/diff) + GetPackagesDiff(ctx echo.Context, params GetPackagesDiffParams) error + + // (GET /search) + GetSearch(ctx echo.Context, params GetSearchParams) error + // (DELETE /services) DeleteServices(ctx echo.Context) error @@ -564,8 +933,32 @@ type ServerInterface interface { // (POST /tags/{tag_id}/services/{svc_id}) PostTagService(ctx echo.Context, tagId int, svcId string) error + // (GET /users) + GetUsers(ctx echo.Context, params GetUsersParams) error + + // (POST /users) + PostUsers(ctx echo.Context) error + + // (POST /users/self/password) + PostUserSelfPassword(ctx echo.Context) error + + // (GET /users/{user_id}) + GetUser(ctx echo.Context, userId string, params GetUserParams) error + + // (POST /users/{user_id}) + PostUser(ctx echo.Context, userId string) error + + // (GET /users/{user_id}/prefs) + GetUserPrefs(ctx echo.Context, userId string) error + + // (POST /users/{user_id}/prefs) + PostUserPrefs(ctx echo.Context, userId string) error + // (GET /version) GetVersion(ctx echo.Context) error + + // (GET /workflows) + GetWorkflows(ctx echo.Context, params GetWorkflowsParams) error } // ServerInterfaceWrapper converts echo contexts to parameters. @@ -577,57 +970,64 @@ type ServerInterfaceWrapper struct { func (w *ServerInterfaceWrapper) GetActions(ctx echo.Context) error { var err error - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context var params GetActionsParams // ------------- Optional query parameter "props" ------------- - err = runtime.BindQueryParameter("form", true, false, "props", ctx.QueryParams(), ¶ms.Props) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) } // ------------- Optional query parameter "limit" ------------- - err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit) + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) } // ------------- Optional query parameter "offset" ------------- - err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset) + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) } // ------------- Optional query parameter "meta" ------------- - err = runtime.BindQueryParameter("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta) + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) } // ------------- Optional query parameter "stats" ------------- - err = runtime.BindQueryParameter("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats) + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) } // ------------- Optional query parameter "orderby" ------------- - err = runtime.BindQueryParameter("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) } + // ------------- Optional query parameter "filter" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "filter", ctx.QueryParams(), ¶ms.Filter, runtime.BindQueryParameterOptions{Type: "array", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter filter: %s", err)) + } + // ------------- Optional query parameter "groupby" ------------- - err = runtime.BindQueryParameter("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) } @@ -641,29 +1041,42 @@ func (w *ServerInterfaceWrapper) GetActions(ctx echo.Context) error { func (w *ServerInterfaceWrapper) PostActions(ctx echo.Context) error { var err error - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Invoke the callback with all the unmarshaled arguments err = w.Handler.PostActions(ctx) return err } +// PutActions converts echo context to params. +func (w *ServerInterfaceWrapper) PutActions(ctx echo.Context) error { + var err error + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.PutActions(ctx) + return err +} + // DeleteAction converts echo context to params. func (w *ServerInterfaceWrapper) DeleteAction(ctx echo.Context) error { var err error // ------------- Path parameter "id" ------------- var id string - err = runtime.BindStyledParameterWithOptions("simple", "id", ctx.Param("id"), &id, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "id", ctx.Param("id"), &id, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Invoke the callback with all the unmarshaled arguments err = w.Handler.DeleteAction(ctx, id) @@ -676,62 +1089,62 @@ func (w *ServerInterfaceWrapper) GetAction(ctx echo.Context) error { // ------------- Path parameter "id" ------------- var id string - err = runtime.BindStyledParameterWithOptions("simple", "id", ctx.Param("id"), &id, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "id", ctx.Param("id"), &id, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context var params GetActionParams // ------------- Optional query parameter "props" ------------- - err = runtime.BindQueryParameter("form", true, false, "props", ctx.QueryParams(), ¶ms.Props) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) } // ------------- Optional query parameter "limit" ------------- - err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit) + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) } // ------------- Optional query parameter "offset" ------------- - err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset) + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) } // ------------- Optional query parameter "meta" ------------- - err = runtime.BindQueryParameter("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta) + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) } // ------------- Optional query parameter "stats" ------------- - err = runtime.BindQueryParameter("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats) + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) } // ------------- Optional query parameter "orderby" ------------- - err = runtime.BindQueryParameter("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) } // ------------- Optional query parameter "groupby" ------------- - err = runtime.BindQueryParameter("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) } @@ -745,57 +1158,57 @@ func (w *ServerInterfaceWrapper) GetAction(ctx echo.Context) error { func (w *ServerInterfaceWrapper) GetAlertEvent(ctx echo.Context) error { var err error - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context var params GetAlertEventParams // ------------- Optional query parameter "props" ------------- - err = runtime.BindQueryParameter("form", true, false, "props", ctx.QueryParams(), ¶ms.Props) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) } // ------------- Optional query parameter "limit" ------------- - err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit) + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) } // ------------- Optional query parameter "offset" ------------- - err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset) + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) } // ------------- Optional query parameter "meta" ------------- - err = runtime.BindQueryParameter("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta) + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) } // ------------- Optional query parameter "stats" ------------- - err = runtime.BindQueryParameter("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats) + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) } // ------------- Optional query parameter "orderby" ------------- - err = runtime.BindQueryParameter("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) } // ------------- Optional query parameter "groupby" ------------- - err = runtime.BindQueryParameter("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) } @@ -809,9 +1222,9 @@ func (w *ServerInterfaceWrapper) GetAlertEvent(ctx echo.Context) error { func (w *ServerInterfaceWrapper) DeleteAlerts(ctx echo.Context) error { var err error - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Invoke the callback with all the unmarshaled arguments err = w.Handler.DeleteAlerts(ctx) @@ -822,57 +1235,57 @@ func (w *ServerInterfaceWrapper) DeleteAlerts(ctx echo.Context) error { func (w *ServerInterfaceWrapper) GetAlerts(ctx echo.Context) error { var err error - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context var params GetAlertsParams // ------------- Optional query parameter "props" ------------- - err = runtime.BindQueryParameter("form", true, false, "props", ctx.QueryParams(), ¶ms.Props) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) } // ------------- Optional query parameter "limit" ------------- - err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit) + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) } // ------------- Optional query parameter "offset" ------------- - err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset) + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) } // ------------- Optional query parameter "meta" ------------- - err = runtime.BindQueryParameter("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta) + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) } // ------------- Optional query parameter "stats" ------------- - err = runtime.BindQueryParameter("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats) + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) } // ------------- Optional query parameter "orderby" ------------- - err = runtime.BindQueryParameter("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) } // ------------- Optional query parameter "groupby" ------------- - err = runtime.BindQueryParameter("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) } @@ -886,9 +1299,9 @@ func (w *ServerInterfaceWrapper) GetAlerts(ctx echo.Context) error { func (w *ServerInterfaceWrapper) PostAlerts(ctx echo.Context) error { var err error - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Invoke the callback with all the unmarshaled arguments err = w.Handler.PostAlerts(ctx) @@ -901,14 +1314,14 @@ func (w *ServerInterfaceWrapper) DeleteAlert(ctx echo.Context) error { // ------------- Path parameter "id" ------------- var id string - err = runtime.BindStyledParameterWithOptions("simple", "id", ctx.Param("id"), &id, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "id", ctx.Param("id"), &id, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Invoke the callback with all the unmarshaled arguments err = w.Handler.DeleteAlert(ctx, id) @@ -921,62 +1334,62 @@ func (w *ServerInterfaceWrapper) GetAlert(ctx echo.Context) error { // ------------- Path parameter "id" ------------- var id string - err = runtime.BindStyledParameterWithOptions("simple", "id", ctx.Param("id"), &id, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "id", ctx.Param("id"), &id, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context var params GetAlertParams // ------------- Optional query parameter "props" ------------- - err = runtime.BindQueryParameter("form", true, false, "props", ctx.QueryParams(), ¶ms.Props) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) } // ------------- Optional query parameter "limit" ------------- - err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit) + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) } // ------------- Optional query parameter "offset" ------------- - err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset) + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) } // ------------- Optional query parameter "meta" ------------- - err = runtime.BindQueryParameter("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta) + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) } // ------------- Optional query parameter "stats" ------------- - err = runtime.BindQueryParameter("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats) + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) } // ------------- Optional query parameter "orderby" ------------- - err = runtime.BindQueryParameter("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) } // ------------- Optional query parameter "groupby" ------------- - err = runtime.BindQueryParameter("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) } @@ -992,14 +1405,14 @@ func (w *ServerInterfaceWrapper) PostAlert(ctx echo.Context) error { // ------------- Path parameter "id" ------------- var id string - err = runtime.BindStyledParameterWithOptions("simple", "id", ctx.Param("id"), &id, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "id", ctx.Param("id"), &id, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Invoke the callback with all the unmarshaled arguments err = w.Handler.PostAlert(ctx, id) @@ -1010,9 +1423,9 @@ func (w *ServerInterfaceWrapper) PostAlert(ctx echo.Context) error { func (w *ServerInterfaceWrapper) DeleteApps(ctx echo.Context) error { var err error - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Invoke the callback with all the unmarshaled arguments err = w.Handler.DeleteApps(ctx) @@ -1023,61 +1436,68 @@ func (w *ServerInterfaceWrapper) DeleteApps(ctx echo.Context) error { func (w *ServerInterfaceWrapper) GetApps(ctx echo.Context) error { var err error - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context var params GetAppsParams // ------------- Optional query parameter "props" ------------- - err = runtime.BindQueryParameter("form", true, false, "props", ctx.QueryParams(), ¶ms.Props) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) } // ------------- Optional query parameter "limit" ------------- - err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit) + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) } // ------------- Optional query parameter "offset" ------------- - err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset) + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) } // ------------- Optional query parameter "meta" ------------- - err = runtime.BindQueryParameter("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta) + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) } // ------------- Optional query parameter "stats" ------------- - err = runtime.BindQueryParameter("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats) + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) } // ------------- Optional query parameter "orderby" ------------- - err = runtime.BindQueryParameter("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) } // ------------- Optional query parameter "groupby" ------------- - err = runtime.BindQueryParameter("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) } + // ------------- Optional query parameter "filter" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "filter", ctx.QueryParams(), ¶ms.Filter, runtime.BindQueryParameterOptions{Type: "array", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter filter: %s", err)) + } + // Invoke the callback with all the unmarshaled arguments err = w.Handler.GetApps(ctx, params) return err @@ -1087,9 +1507,9 @@ func (w *ServerInterfaceWrapper) GetApps(ctx echo.Context) error { func (w *ServerInterfaceWrapper) PostApps(ctx echo.Context) error { var err error - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Invoke the callback with all the unmarshaled arguments err = w.Handler.PostApps(ctx) @@ -1102,14 +1522,14 @@ func (w *ServerInterfaceWrapper) DeleteApp(ctx echo.Context) error { // ------------- Path parameter "app_id" ------------- var appId string - err = runtime.BindStyledParameterWithOptions("simple", "app_id", ctx.Param("app_id"), &appId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "app_id", ctx.Param("app_id"), &appId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter app_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Invoke the callback with all the unmarshaled arguments err = w.Handler.DeleteApp(ctx, appId) @@ -1122,20 +1542,20 @@ func (w *ServerInterfaceWrapper) GetApp(ctx echo.Context) error { // ------------- Path parameter "app_id" ------------- var appId string - err = runtime.BindStyledParameterWithOptions("simple", "app_id", ctx.Param("app_id"), &appId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "app_id", ctx.Param("app_id"), &appId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter app_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context var params GetAppParams // ------------- Optional query parameter "props" ------------- - err = runtime.BindQueryParameter("form", true, false, "props", ctx.QueryParams(), ¶ms.Props) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) } @@ -1151,14 +1571,14 @@ func (w *ServerInterfaceWrapper) PostApp(ctx echo.Context) error { // ------------- Path parameter "app_id" ------------- var appId string - err = runtime.BindStyledParameterWithOptions("simple", "app_id", ctx.Param("app_id"), &appId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "app_id", ctx.Param("app_id"), &appId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter app_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Invoke the callback with all the unmarshaled arguments err = w.Handler.PostApp(ctx, appId) @@ -1171,14 +1591,14 @@ func (w *ServerInterfaceWrapper) GetAppAmIResponsible(ctx echo.Context) error { // ------------- Path parameter "app_id" ------------- var appId string - err = runtime.BindStyledParameterWithOptions("simple", "app_id", ctx.Param("app_id"), &appId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "app_id", ctx.Param("app_id"), &appId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter app_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Invoke the callback with all the unmarshaled arguments err = w.Handler.GetAppAmIResponsible(ctx, appId) @@ -1191,62 +1611,62 @@ func (w *ServerInterfaceWrapper) GetAppNodes(ctx echo.Context) error { // ------------- Path parameter "app_id" ------------- var appId string - err = runtime.BindStyledParameterWithOptions("simple", "app_id", ctx.Param("app_id"), &appId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "app_id", ctx.Param("app_id"), &appId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter app_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context var params GetAppNodesParams // ------------- Optional query parameter "props" ------------- - err = runtime.BindQueryParameter("form", true, false, "props", ctx.QueryParams(), ¶ms.Props) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) } // ------------- Optional query parameter "limit" ------------- - err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit) + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) } // ------------- Optional query parameter "offset" ------------- - err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset) + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) } // ------------- Optional query parameter "meta" ------------- - err = runtime.BindQueryParameter("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta) + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) } // ------------- Optional query parameter "stats" ------------- - err = runtime.BindQueryParameter("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats) + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) } // ------------- Optional query parameter "orderby" ------------- - err = runtime.BindQueryParameter("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) } // ------------- Optional query parameter "groupby" ------------- - err = runtime.BindQueryParameter("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) } @@ -1262,62 +1682,62 @@ func (w *ServerInterfaceWrapper) GetAppPublications(ctx echo.Context) error { // ------------- Path parameter "app_id" ------------- var appId string - err = runtime.BindStyledParameterWithOptions("simple", "app_id", ctx.Param("app_id"), &appId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "app_id", ctx.Param("app_id"), &appId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter app_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context var params GetAppPublicationsParams // ------------- Optional query parameter "props" ------------- - err = runtime.BindQueryParameter("form", true, false, "props", ctx.QueryParams(), ¶ms.Props) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) } // ------------- Optional query parameter "limit" ------------- - err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit) + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) } // ------------- Optional query parameter "offset" ------------- - err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset) + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) } // ------------- Optional query parameter "meta" ------------- - err = runtime.BindQueryParameter("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta) + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) } // ------------- Optional query parameter "stats" ------------- - err = runtime.BindQueryParameter("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats) + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) } // ------------- Optional query parameter "orderby" ------------- - err = runtime.BindQueryParameter("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) } // ------------- Optional query parameter "groupby" ------------- - err = runtime.BindQueryParameter("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) } @@ -1333,7 +1753,7 @@ func (w *ServerInterfaceWrapper) DeleteAppPublication(ctx echo.Context) error { // ------------- Path parameter "app_id" ------------- var appId string - err = runtime.BindStyledParameterWithOptions("simple", "app_id", ctx.Param("app_id"), &appId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "app_id", ctx.Param("app_id"), &appId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter app_id: %s", err)) } @@ -1341,14 +1761,14 @@ func (w *ServerInterfaceWrapper) DeleteAppPublication(ctx echo.Context) error { // ------------- Path parameter "group_id" ------------- var groupId string - err = runtime.BindStyledParameterWithOptions("simple", "group_id", ctx.Param("group_id"), &groupId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "group_id", ctx.Param("group_id"), &groupId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter group_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Invoke the callback with all the unmarshaled arguments err = w.Handler.DeleteAppPublication(ctx, appId, groupId) @@ -1361,7 +1781,7 @@ func (w *ServerInterfaceWrapper) PostAppPublication(ctx echo.Context) error { // ------------- Path parameter "app_id" ------------- var appId string - err = runtime.BindStyledParameterWithOptions("simple", "app_id", ctx.Param("app_id"), &appId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "app_id", ctx.Param("app_id"), &appId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter app_id: %s", err)) } @@ -1369,14 +1789,14 @@ func (w *ServerInterfaceWrapper) PostAppPublication(ctx echo.Context) error { // ------------- Path parameter "group_id" ------------- var groupId string - err = runtime.BindStyledParameterWithOptions("simple", "group_id", ctx.Param("group_id"), &groupId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "group_id", ctx.Param("group_id"), &groupId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter group_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Invoke the callback with all the unmarshaled arguments err = w.Handler.PostAppPublication(ctx, appId, groupId) @@ -1389,62 +1809,62 @@ func (w *ServerInterfaceWrapper) GetAppQuotas(ctx echo.Context) error { // ------------- Path parameter "app_id" ------------- var appId string - err = runtime.BindStyledParameterWithOptions("simple", "app_id", ctx.Param("app_id"), &appId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "app_id", ctx.Param("app_id"), &appId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter app_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context var params GetAppQuotasParams // ------------- Optional query parameter "props" ------------- - err = runtime.BindQueryParameter("form", true, false, "props", ctx.QueryParams(), ¶ms.Props) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) } // ------------- Optional query parameter "limit" ------------- - err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit) + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) } // ------------- Optional query parameter "offset" ------------- - err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset) + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) } // ------------- Optional query parameter "meta" ------------- - err = runtime.BindQueryParameter("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta) + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) } // ------------- Optional query parameter "stats" ------------- - err = runtime.BindQueryParameter("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats) + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) } // ------------- Optional query parameter "orderby" ------------- - err = runtime.BindQueryParameter("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) } // ------------- Optional query parameter "groupby" ------------- - err = runtime.BindQueryParameter("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) } @@ -1460,62 +1880,62 @@ func (w *ServerInterfaceWrapper) GetAppResponsibles(ctx echo.Context) error { // ------------- Path parameter "app_id" ------------- var appId string - err = runtime.BindStyledParameterWithOptions("simple", "app_id", ctx.Param("app_id"), &appId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "app_id", ctx.Param("app_id"), &appId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter app_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context var params GetAppResponsiblesParams // ------------- Optional query parameter "props" ------------- - err = runtime.BindQueryParameter("form", true, false, "props", ctx.QueryParams(), ¶ms.Props) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) } // ------------- Optional query parameter "limit" ------------- - err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit) + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) } // ------------- Optional query parameter "offset" ------------- - err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset) + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) } // ------------- Optional query parameter "meta" ------------- - err = runtime.BindQueryParameter("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta) + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) } // ------------- Optional query parameter "stats" ------------- - err = runtime.BindQueryParameter("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats) + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) } // ------------- Optional query parameter "orderby" ------------- - err = runtime.BindQueryParameter("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) } // ------------- Optional query parameter "groupby" ------------- - err = runtime.BindQueryParameter("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) } @@ -1531,7 +1951,7 @@ func (w *ServerInterfaceWrapper) DeleteAppResponsible(ctx echo.Context) error { // ------------- Path parameter "app_id" ------------- var appId string - err = runtime.BindStyledParameterWithOptions("simple", "app_id", ctx.Param("app_id"), &appId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "app_id", ctx.Param("app_id"), &appId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter app_id: %s", err)) } @@ -1539,14 +1959,14 @@ func (w *ServerInterfaceWrapper) DeleteAppResponsible(ctx echo.Context) error { // ------------- Path parameter "group_id" ------------- var groupId string - err = runtime.BindStyledParameterWithOptions("simple", "group_id", ctx.Param("group_id"), &groupId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "group_id", ctx.Param("group_id"), &groupId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter group_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Invoke the callback with all the unmarshaled arguments err = w.Handler.DeleteAppResponsible(ctx, appId, groupId) @@ -1559,7 +1979,7 @@ func (w *ServerInterfaceWrapper) PostAppResponsible(ctx echo.Context) error { // ------------- Path parameter "app_id" ------------- var appId string - err = runtime.BindStyledParameterWithOptions("simple", "app_id", ctx.Param("app_id"), &appId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "app_id", ctx.Param("app_id"), &appId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter app_id: %s", err)) } @@ -1567,14 +1987,14 @@ func (w *ServerInterfaceWrapper) PostAppResponsible(ctx echo.Context) error { // ------------- Path parameter "group_id" ------------- var groupId string - err = runtime.BindStyledParameterWithOptions("simple", "group_id", ctx.Param("group_id"), &groupId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "group_id", ctx.Param("group_id"), &groupId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter group_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Invoke the callback with all the unmarshaled arguments err = w.Handler.PostAppResponsible(ctx, appId, groupId) @@ -1587,62 +2007,62 @@ func (w *ServerInterfaceWrapper) GetAppServices(ctx echo.Context) error { // ------------- Path parameter "app_id" ------------- var appId string - err = runtime.BindStyledParameterWithOptions("simple", "app_id", ctx.Param("app_id"), &appId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "app_id", ctx.Param("app_id"), &appId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter app_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context var params GetAppServicesParams // ------------- Optional query parameter "props" ------------- - err = runtime.BindQueryParameter("form", true, false, "props", ctx.QueryParams(), ¶ms.Props) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) } // ------------- Optional query parameter "limit" ------------- - err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit) + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) } // ------------- Optional query parameter "offset" ------------- - err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset) + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) } // ------------- Optional query parameter "meta" ------------- - err = runtime.BindQueryParameter("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta) + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) } // ------------- Optional query parameter "stats" ------------- - err = runtime.BindQueryParameter("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats) + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) } // ------------- Optional query parameter "orderby" ------------- - err = runtime.BindQueryParameter("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) } // ------------- Optional query parameter "groupby" ------------- - err = runtime.BindQueryParameter("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) } @@ -1656,9 +2076,9 @@ func (w *ServerInterfaceWrapper) GetAppServices(ctx echo.Context) error { func (w *ServerInterfaceWrapper) DeleteAppsPublications(ctx echo.Context) error { var err error - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Invoke the callback with all the unmarshaled arguments err = w.Handler.DeleteAppsPublications(ctx) @@ -1669,9 +2089,9 @@ func (w *ServerInterfaceWrapper) DeleteAppsPublications(ctx echo.Context) error func (w *ServerInterfaceWrapper) PostAppsPublications(ctx echo.Context) error { var err error - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Invoke the callback with all the unmarshaled arguments err = w.Handler.PostAppsPublications(ctx) @@ -1682,9 +2102,9 @@ func (w *ServerInterfaceWrapper) PostAppsPublications(ctx echo.Context) error { func (w *ServerInterfaceWrapper) DeleteAppsResponsibles(ctx echo.Context) error { var err error - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Invoke the callback with all the unmarshaled arguments err = w.Handler.DeleteAppsResponsibles(ctx) @@ -1695,9 +2115,9 @@ func (w *ServerInterfaceWrapper) DeleteAppsResponsibles(ctx echo.Context) error func (w *ServerInterfaceWrapper) PostAppsResponsibles(ctx echo.Context) error { var err error - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Invoke the callback with all the unmarshaled arguments err = w.Handler.PostAppsResponsibles(ctx) @@ -1708,57 +2128,57 @@ func (w *ServerInterfaceWrapper) PostAppsResponsibles(ctx echo.Context) error { func (w *ServerInterfaceWrapper) GetArrays(ctx echo.Context) error { var err error - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context var params GetArraysParams // ------------- Optional query parameter "props" ------------- - err = runtime.BindQueryParameter("form", true, false, "props", ctx.QueryParams(), ¶ms.Props) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) } // ------------- Optional query parameter "limit" ------------- - err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit) + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) } // ------------- Optional query parameter "offset" ------------- - err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset) + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) } // ------------- Optional query parameter "meta" ------------- - err = runtime.BindQueryParameter("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta) + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) } // ------------- Optional query parameter "stats" ------------- - err = runtime.BindQueryParameter("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats) + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) } // ------------- Optional query parameter "orderby" ------------- - err = runtime.BindQueryParameter("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) } // ------------- Optional query parameter "groupby" ------------- - err = runtime.BindQueryParameter("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) } @@ -1772,1083 +2192,5113 @@ func (w *ServerInterfaceWrapper) GetArrays(ctx echo.Context) error { func (w *ServerInterfaceWrapper) PostAuthNode(ctx echo.Context) error { var err error - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Invoke the callback with all the unmarshaled arguments err = w.Handler.PostAuthNode(ctx) return err } -// DeleteDisks converts echo context to params. -func (w *ServerInterfaceWrapper) DeleteDisks(ctx echo.Context) error { +// PostComplianceImport converts echo context to params. +func (w *ServerInterfaceWrapper) PostComplianceImport(ctx echo.Context) error { var err error - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Invoke the callback with all the unmarshaled arguments - err = w.Handler.DeleteDisks(ctx) + err = w.Handler.PostComplianceImport(ctx) return err } -// GetDisks converts echo context to params. -func (w *ServerInterfaceWrapper) GetDisks(ctx echo.Context) error { +// GetComplianceLogs converts echo context to params. +func (w *ServerInterfaceWrapper) GetComplianceLogs(ctx echo.Context) error { var err error - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context - var params GetDisksParams + var params GetComplianceLogsParams + // ------------- Optional query parameter "fset_id" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "fset_id", ctx.QueryParams(), ¶ms.FsetId, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter fset_id: %s", err)) + } + // ------------- Optional query parameter "props" ------------- - err = runtime.BindQueryParameter("form", true, false, "props", ctx.QueryParams(), ¶ms.Props) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) } // ------------- Optional query parameter "limit" ------------- - err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit) + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) } // ------------- Optional query parameter "offset" ------------- - err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset) + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) } // ------------- Optional query parameter "meta" ------------- - err = runtime.BindQueryParameter("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta) + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) } // ------------- Optional query parameter "stats" ------------- - err = runtime.BindQueryParameter("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats) + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) } // ------------- Optional query parameter "orderby" ------------- - err = runtime.BindQueryParameter("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) } + // ------------- Optional query parameter "filter" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "filter", ctx.QueryParams(), ¶ms.Filter, runtime.BindQueryParameterOptions{Type: "array", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter filter: %s", err)) + } + // ------------- Optional query parameter "groupby" ------------- - err = runtime.BindQueryParameter("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) } // Invoke the callback with all the unmarshaled arguments - err = w.Handler.GetDisks(ctx, params) + err = w.Handler.GetComplianceLogs(ctx, params) return err } -// PostDisks converts echo context to params. -func (w *ServerInterfaceWrapper) PostDisks(ctx echo.Context) error { +// GetComplianceLog converts echo context to params. +func (w *ServerInterfaceWrapper) GetComplianceLog(ctx echo.Context) error { var err error + // ------------- Path parameter "log_id" ------------- + var logId string - ctx.Set(BasicAuthScopes, []string{}) + err = runtime.BindStyledParameterWithOptions("simple", "log_id", ctx.Param("log_id"), &logId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter log_id: %s", err)) + } + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Parameter object where we will unmarshal all parameters from the context + var params GetComplianceLogParams + // ------------- Optional query parameter "props" ------------- - ctx.Set(BearerAuthScopes, []string{}) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) + } // Invoke the callback with all the unmarshaled arguments - err = w.Handler.PostDisks(ctx) + err = w.Handler.GetComplianceLog(ctx, logId, params) return err } -// DeleteDisk converts echo context to params. -func (w *ServerInterfaceWrapper) DeleteDisk(ctx echo.Context) error { +// DeleteComplianceModulesets converts echo context to params. +func (w *ServerInterfaceWrapper) DeleteComplianceModulesets(ctx echo.Context) error { var err error - // ------------- Path parameter "disk_id" ------------- - var diskId string - err = runtime.BindStyledParameterWithOptions("simple", "disk_id", ctx.Param("disk_id"), &diskId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) - if err != nil { - return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter disk_id: %s", err)) - } - - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Invoke the callback with all the unmarshaled arguments - err = w.Handler.DeleteDisk(ctx, diskId) + err = w.Handler.DeleteComplianceModulesets(ctx) return err } -// GetDisk converts echo context to params. -func (w *ServerInterfaceWrapper) GetDisk(ctx echo.Context) error { +// GetComplianceModulesets converts echo context to params. +func (w *ServerInterfaceWrapper) GetComplianceModulesets(ctx echo.Context) error { var err error - // ------------- Path parameter "disk_id" ------------- - var diskId string - - err = runtime.BindStyledParameterWithOptions("simple", "disk_id", ctx.Param("disk_id"), &diskId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) - if err != nil { - return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter disk_id: %s", err)) - } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context - var params GetDiskParams + var params GetComplianceModulesetsParams // ------------- Optional query parameter "props" ------------- - err = runtime.BindQueryParameter("form", true, false, "props", ctx.QueryParams(), ¶ms.Props) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) } // ------------- Optional query parameter "limit" ------------- - err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit) + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) } // ------------- Optional query parameter "offset" ------------- - err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset) + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) } // ------------- Optional query parameter "meta" ------------- - err = runtime.BindQueryParameter("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta) + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) } // ------------- Optional query parameter "stats" ------------- - err = runtime.BindQueryParameter("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats) + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) } // ------------- Optional query parameter "orderby" ------------- - err = runtime.BindQueryParameter("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) } + // ------------- Optional query parameter "filter" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "filter", ctx.QueryParams(), ¶ms.Filter, runtime.BindQueryParameterOptions{Type: "array", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter filter: %s", err)) + } + // ------------- Optional query parameter "groupby" ------------- - err = runtime.BindQueryParameter("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) } // Invoke the callback with all the unmarshaled arguments - err = w.Handler.GetDisk(ctx, diskId, params) + err = w.Handler.GetComplianceModulesets(ctx, params) return err } -// DeleteFilters converts echo context to params. -func (w *ServerInterfaceWrapper) DeleteFilters(ctx echo.Context) error { +// PostComplianceModulesets converts echo context to params. +func (w *ServerInterfaceWrapper) PostComplianceModulesets(ctx echo.Context) error { var err error - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Invoke the callback with all the unmarshaled arguments - err = w.Handler.DeleteFilters(ctx) + err = w.Handler.PostComplianceModulesets(ctx) return err } -// GetFilters converts echo context to params. -func (w *ServerInterfaceWrapper) GetFilters(ctx echo.Context) error { +// GetComplianceModulesetsExport converts echo context to params. +func (w *ServerInterfaceWrapper) GetComplianceModulesetsExport(ctx echo.Context) error { var err error - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) - // Parameter object where we will unmarshal all parameters from the context - var params GetFiltersParams - // ------------- Optional query parameter "props" ------------- + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.GetComplianceModulesetsExport(ctx) + return err +} + +// DeleteComplianceModuleset converts echo context to params. +func (w *ServerInterfaceWrapper) DeleteComplianceModuleset(ctx echo.Context) error { + var err error + // ------------- Path parameter "modset_id" ------------- + var modsetId string - err = runtime.BindQueryParameter("form", true, false, "props", ctx.QueryParams(), ¶ms.Props) + err = runtime.BindStyledParameterWithOptions("simple", "modset_id", ctx.Param("modset_id"), &modsetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { - return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter modset_id: %s", err)) } - // ------------- Optional query parameter "limit" ------------- + ctx.Set(string(BasicAuthScopes), []string{}) - err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit) - if err != nil { - return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) - } + ctx.Set(string(BearerAuthScopes), []string{}) - // ------------- Optional query parameter "offset" ------------- + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.DeleteComplianceModuleset(ctx, modsetId) + return err +} + +// GetComplianceModuleset converts echo context to params. +func (w *ServerInterfaceWrapper) GetComplianceModuleset(ctx echo.Context) error { + var err error + // ------------- Path parameter "modset_id" ------------- + var modsetId string - err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset) + err = runtime.BindStyledParameterWithOptions("simple", "modset_id", ctx.Param("modset_id"), &modsetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { - return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter modset_id: %s", err)) } - // ------------- Optional query parameter "meta" ------------- + ctx.Set(string(BasicAuthScopes), []string{}) - err = runtime.BindQueryParameter("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta) - if err != nil { - return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) - } + ctx.Set(string(BearerAuthScopes), []string{}) - // ------------- Optional query parameter "stats" ------------- + // Parameter object where we will unmarshal all parameters from the context + var params GetComplianceModulesetParams + // ------------- Optional query parameter "props" ------------- - err = runtime.BindQueryParameter("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { - return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) } - // ------------- Optional query parameter "orderby" ------------- + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.GetComplianceModuleset(ctx, modsetId, params) + return err +} + +// PostComplianceModuleset converts echo context to params. +func (w *ServerInterfaceWrapper) PostComplianceModuleset(ctx echo.Context) error { + var err error + // ------------- Path parameter "modset_id" ------------- + var modsetId string - err = runtime.BindQueryParameter("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby) + err = runtime.BindStyledParameterWithOptions("simple", "modset_id", ctx.Param("modset_id"), &modsetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { - return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter modset_id: %s", err)) } - // ------------- Optional query parameter "groupby" ------------- + ctx.Set(string(BasicAuthScopes), []string{}) - err = runtime.BindQueryParameter("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby) - if err != nil { - return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) - } + ctx.Set(string(BearerAuthScopes), []string{}) // Invoke the callback with all the unmarshaled arguments - err = w.Handler.GetFilters(ctx, params) + err = w.Handler.PostComplianceModuleset(ctx, modsetId) return err } -// PostFilters converts echo context to params. -func (w *ServerInterfaceWrapper) PostFilters(ctx echo.Context) error { +// PutComplianceModuleset converts echo context to params. +func (w *ServerInterfaceWrapper) PutComplianceModuleset(ctx echo.Context) error { var err error + // ------------- Path parameter "modset_id" ------------- + var modsetId string + + err = runtime.BindStyledParameterWithOptions("simple", "modset_id", ctx.Param("modset_id"), &modsetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter modset_id: %s", err)) + } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Invoke the callback with all the unmarshaled arguments - err = w.Handler.PostFilters(ctx) + err = w.Handler.PutComplianceModuleset(ctx, modsetId) return err } -// DeleteFilter converts echo context to params. -func (w *ServerInterfaceWrapper) DeleteFilter(ctx echo.Context) error { +// GetComplianceModulesetAmIResponsible converts echo context to params. +func (w *ServerInterfaceWrapper) GetComplianceModulesetAmIResponsible(ctx echo.Context) error { var err error - // ------------- Path parameter "filter_id" ------------- - var filterId string + // ------------- Path parameter "modset_id" ------------- + var modsetId string - err = runtime.BindStyledParameterWithOptions("simple", "filter_id", ctx.Param("filter_id"), &filterId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "modset_id", ctx.Param("modset_id"), &modsetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { - return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter filter_id: %s", err)) + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter modset_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Invoke the callback with all the unmarshaled arguments - err = w.Handler.DeleteFilter(ctx, filterId) + err = w.Handler.GetComplianceModulesetAmIResponsible(ctx, modsetId) return err } -// GetFilter converts echo context to params. -func (w *ServerInterfaceWrapper) GetFilter(ctx echo.Context) error { +// GetComplianceModulesetCandidateNodes converts echo context to params. +func (w *ServerInterfaceWrapper) GetComplianceModulesetCandidateNodes(ctx echo.Context) error { var err error - // ------------- Path parameter "filter_id" ------------- - var filterId string + // ------------- Path parameter "modset_id" ------------- + var modsetId string - err = runtime.BindStyledParameterWithOptions("simple", "filter_id", ctx.Param("filter_id"), &filterId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "modset_id", ctx.Param("modset_id"), &modsetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { - return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter filter_id: %s", err)) + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter modset_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context - var params GetFilterParams + var params GetComplianceModulesetCandidateNodesParams // ------------- Optional query parameter "props" ------------- - err = runtime.BindQueryParameter("form", true, false, "props", ctx.QueryParams(), ¶ms.Props) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) } // ------------- Optional query parameter "limit" ------------- - err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit) + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) } // ------------- Optional query parameter "offset" ------------- - err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset) + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) } // ------------- Optional query parameter "meta" ------------- - err = runtime.BindQueryParameter("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta) + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) } // ------------- Optional query parameter "stats" ------------- - err = runtime.BindQueryParameter("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats) + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) } // ------------- Optional query parameter "orderby" ------------- - err = runtime.BindQueryParameter("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) } - // ------------- Optional query parameter "groupby" ------------- + // ------------- Optional query parameter "filter" ------------- - err = runtime.BindQueryParameter("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "filter", ctx.QueryParams(), ¶ms.Filter, runtime.BindQueryParameterOptions{Type: "array", Format: ""}) if err != nil { - return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter filter: %s", err)) } - // Invoke the callback with all the unmarshaled arguments - err = w.Handler.GetFilter(ctx, filterId, params) - return err -} - -// PostFilter converts echo context to params. -func (w *ServerInterfaceWrapper) PostFilter(ctx echo.Context) error { - var err error - // ------------- Path parameter "filter_id" ------------- - var filterId string + // ------------- Optional query parameter "groupby" ------------- - err = runtime.BindStyledParameterWithOptions("simple", "filter_id", ctx.Param("filter_id"), &filterId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { - return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter filter_id: %s", err)) + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) - - ctx.Set(BearerAuthScopes, []string{}) - // Invoke the callback with all the unmarshaled arguments - err = w.Handler.PostFilter(ctx, filterId) + err = w.Handler.GetComplianceModulesetCandidateNodes(ctx, modsetId, params) return err } -// DeleteFiltersets converts echo context to params. -func (w *ServerInterfaceWrapper) DeleteFiltersets(ctx echo.Context) error { +// GetComplianceModulesetCandidateServices converts echo context to params. +func (w *ServerInterfaceWrapper) GetComplianceModulesetCandidateServices(ctx echo.Context) error { var err error + // ------------- Path parameter "modset_id" ------------- + var modsetId string - ctx.Set(BasicAuthScopes, []string{}) - - ctx.Set(BearerAuthScopes, []string{}) + err = runtime.BindStyledParameterWithOptions("simple", "modset_id", ctx.Param("modset_id"), &modsetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter modset_id: %s", err)) + } - // Invoke the callback with all the unmarshaled arguments - err = w.Handler.DeleteFiltersets(ctx) - return err -} + ctx.Set(string(BasicAuthScopes), []string{}) -// GetFiltersets converts echo context to params. -func (w *ServerInterfaceWrapper) GetFiltersets(ctx echo.Context) error { - var err error + ctx.Set(string(BearerAuthScopes), []string{}) - ctx.Set(BasicAuthScopes, []string{}) + // Parameter object where we will unmarshal all parameters from the context + var params GetComplianceModulesetCandidateServicesParams + // ------------- Optional query parameter "slave" ------------- - ctx.Set(BearerAuthScopes, []string{}) + err = runtime.BindQueryParameterWithOptions("form", true, false, "slave", ctx.QueryParams(), ¶ms.Slave, runtime.BindQueryParameterOptions{Type: "boolean", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter slave: %s", err)) + } - // Parameter object where we will unmarshal all parameters from the context - var params GetFiltersetsParams // ------------- Optional query parameter "props" ------------- - err = runtime.BindQueryParameter("form", true, false, "props", ctx.QueryParams(), ¶ms.Props) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) } // ------------- Optional query parameter "limit" ------------- - err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit) + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) } // ------------- Optional query parameter "offset" ------------- - err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset) + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) } // ------------- Optional query parameter "meta" ------------- - err = runtime.BindQueryParameter("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta) + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) } // ------------- Optional query parameter "stats" ------------- - err = runtime.BindQueryParameter("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats) + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) } // ------------- Optional query parameter "orderby" ------------- - err = runtime.BindQueryParameter("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) } - // ------------- Optional query parameter "groupby" ------------- + // ------------- Optional query parameter "filter" ------------- - err = runtime.BindQueryParameter("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "filter", ctx.QueryParams(), ¶ms.Filter, runtime.BindQueryParameterOptions{Type: "array", Format: ""}) if err != nil { - return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter filter: %s", err)) } - // Invoke the callback with all the unmarshaled arguments - err = w.Handler.GetFiltersets(ctx, params) - return err -} - -// PostFiltersets converts echo context to params. -func (w *ServerInterfaceWrapper) PostFiltersets(ctx echo.Context) error { - var err error - - ctx.Set(BasicAuthScopes, []string{}) + // ------------- Optional query parameter "groupby" ------------- - ctx.Set(BearerAuthScopes, []string{}) + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) + } // Invoke the callback with all the unmarshaled arguments - err = w.Handler.PostFiltersets(ctx) + err = w.Handler.GetComplianceModulesetCandidateServices(ctx, modsetId, params) return err } -// DeleteFilterset converts echo context to params. -func (w *ServerInterfaceWrapper) DeleteFilterset(ctx echo.Context) error { +// GetComplianceModulesetExport converts echo context to params. +func (w *ServerInterfaceWrapper) GetComplianceModulesetExport(ctx echo.Context) error { var err error - // ------------- Path parameter "filterset_id" ------------- - var filtersetId string + // ------------- Path parameter "modset_id" ------------- + var modsetId string - err = runtime.BindStyledParameterWithOptions("simple", "filterset_id", ctx.Param("filterset_id"), &filtersetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "modset_id", ctx.Param("modset_id"), &modsetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { - return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter filterset_id: %s", err)) + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter modset_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Invoke the callback with all the unmarshaled arguments - err = w.Handler.DeleteFilterset(ctx, filtersetId) + err = w.Handler.GetComplianceModulesetExport(ctx, modsetId) return err } -// GetFilterset converts echo context to params. -func (w *ServerInterfaceWrapper) GetFilterset(ctx echo.Context) error { +// GetComplianceModulesetModules converts echo context to params. +func (w *ServerInterfaceWrapper) GetComplianceModulesetModules(ctx echo.Context) error { var err error - // ------------- Path parameter "filterset_id" ------------- - var filtersetId string + // ------------- Path parameter "modset_id" ------------- + var modsetId string - err = runtime.BindStyledParameterWithOptions("simple", "filterset_id", ctx.Param("filterset_id"), &filtersetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "modset_id", ctx.Param("modset_id"), &modsetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { - return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter filterset_id: %s", err)) + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter modset_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context - var params GetFiltersetParams + var params GetComplianceModulesetModulesParams // ------------- Optional query parameter "props" ------------- - err = runtime.BindQueryParameter("form", true, false, "props", ctx.QueryParams(), ¶ms.Props) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) } // ------------- Optional query parameter "limit" ------------- - err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit) + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) } // ------------- Optional query parameter "offset" ------------- - err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset) + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) } // ------------- Optional query parameter "meta" ------------- - err = runtime.BindQueryParameter("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta) + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) } // ------------- Optional query parameter "stats" ------------- - err = runtime.BindQueryParameter("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats) + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) } // ------------- Optional query parameter "orderby" ------------- - err = runtime.BindQueryParameter("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) } + // ------------- Optional query parameter "filter" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "filter", ctx.QueryParams(), ¶ms.Filter, runtime.BindQueryParameterOptions{Type: "array", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter filter: %s", err)) + } + // ------------- Optional query parameter "groupby" ------------- - err = runtime.BindQueryParameter("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) } // Invoke the callback with all the unmarshaled arguments - err = w.Handler.GetFilterset(ctx, filtersetId, params) + err = w.Handler.GetComplianceModulesetModules(ctx, modsetId, params) return err } -// PostFilterset converts echo context to params. -func (w *ServerInterfaceWrapper) PostFilterset(ctx echo.Context) error { +// PostComplianceModulesetModules converts echo context to params. +func (w *ServerInterfaceWrapper) PostComplianceModulesetModules(ctx echo.Context) error { var err error - // ------------- Path parameter "filterset_id" ------------- - var filtersetId string + // ------------- Path parameter "modset_id" ------------- + var modsetId string - err = runtime.BindStyledParameterWithOptions("simple", "filterset_id", ctx.Param("filterset_id"), &filtersetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "modset_id", ctx.Param("modset_id"), &modsetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { - return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter filterset_id: %s", err)) + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter modset_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Invoke the callback with all the unmarshaled arguments - err = w.Handler.PostFilterset(ctx, filtersetId) + err = w.Handler.PostComplianceModulesetModules(ctx, modsetId) return err } -// GetFiltersetExport converts echo context to params. -func (w *ServerInterfaceWrapper) GetFiltersetExport(ctx echo.Context) error { +// DeleteComplianceModulesetModule converts echo context to params. +func (w *ServerInterfaceWrapper) DeleteComplianceModulesetModule(ctx echo.Context) error { var err error - // ------------- Path parameter "filterset_id" ------------- - var filtersetId string + // ------------- Path parameter "modset_id" ------------- + var modsetId string - err = runtime.BindStyledParameterWithOptions("simple", "filterset_id", ctx.Param("filterset_id"), &filtersetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "modset_id", ctx.Param("modset_id"), &modsetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { - return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter filterset_id: %s", err)) + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter modset_id: %s", err)) + } + + // ------------- Path parameter "mod_id" ------------- + var modId string + + err = runtime.BindStyledParameterWithOptions("simple", "mod_id", ctx.Param("mod_id"), &modId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter mod_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Invoke the callback with all the unmarshaled arguments - err = w.Handler.GetFiltersetExport(ctx, filtersetId) + err = w.Handler.DeleteComplianceModulesetModule(ctx, modsetId, modId) return err } -// GetFiltersetFilters converts echo context to params. -func (w *ServerInterfaceWrapper) GetFiltersetFilters(ctx echo.Context) error { +// GetComplianceModulesetModule converts echo context to params. +func (w *ServerInterfaceWrapper) GetComplianceModulesetModule(ctx echo.Context) error { var err error - // ------------- Path parameter "filterset_id" ------------- - var filtersetId string + // ------------- Path parameter "modset_id" ------------- + var modsetId string - err = runtime.BindStyledParameterWithOptions("simple", "filterset_id", ctx.Param("filterset_id"), &filtersetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "modset_id", ctx.Param("modset_id"), &modsetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { - return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter filterset_id: %s", err)) + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter modset_id: %s", err)) + } + + // ------------- Path parameter "mod_id" ------------- + var modId string + + err = runtime.BindStyledParameterWithOptions("simple", "mod_id", ctx.Param("mod_id"), &modId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter mod_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context - var params GetFiltersetFiltersParams + var params GetComplianceModulesetModuleParams // ------------- Optional query parameter "props" ------------- - err = runtime.BindQueryParameter("form", true, false, "props", ctx.QueryParams(), ¶ms.Props) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) } - // ------------- Optional query parameter "limit" ------------- + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.GetComplianceModulesetModule(ctx, modsetId, modId, params) + return err +} + +// PostComplianceModulesetModule converts echo context to params. +func (w *ServerInterfaceWrapper) PostComplianceModulesetModule(ctx echo.Context) error { + var err error + // ------------- Path parameter "modset_id" ------------- + var modsetId string - err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit) + err = runtime.BindStyledParameterWithOptions("simple", "modset_id", ctx.Param("modset_id"), &modsetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { - return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter modset_id: %s", err)) } - // ------------- Optional query parameter "offset" ------------- + // ------------- Path parameter "mod_id" ------------- + var modId string - err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset) + err = runtime.BindStyledParameterWithOptions("simple", "mod_id", ctx.Param("mod_id"), &modId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { - return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter mod_id: %s", err)) } - // ------------- Optional query parameter "meta" ------------- + ctx.Set(string(BasicAuthScopes), []string{}) - err = runtime.BindQueryParameter("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta) - if err != nil { - return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) - } + ctx.Set(string(BearerAuthScopes), []string{}) - // ------------- Optional query parameter "stats" ------------- + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.PostComplianceModulesetModule(ctx, modsetId, modId) + return err +} - err = runtime.BindQueryParameter("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats) +// DeleteComplianceModulesetModuleset converts echo context to params. +func (w *ServerInterfaceWrapper) DeleteComplianceModulesetModuleset(ctx echo.Context) error { + var err error + // ------------- Path parameter "modset_id" ------------- + var modsetId string + + err = runtime.BindStyledParameterWithOptions("simple", "modset_id", ctx.Param("modset_id"), &modsetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { - return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter modset_id: %s", err)) } - // ------------- Optional query parameter "orderby" ------------- + // ------------- Path parameter "child_modset_id" ------------- + var childModsetId string - err = runtime.BindQueryParameter("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby) + err = runtime.BindStyledParameterWithOptions("simple", "child_modset_id", ctx.Param("child_modset_id"), &childModsetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { - return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter child_modset_id: %s", err)) } - // ------------- Optional query parameter "groupby" ------------- + ctx.Set(string(BasicAuthScopes), []string{}) - err = runtime.BindQueryParameter("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby) - if err != nil { - return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) - } + ctx.Set(string(BearerAuthScopes), []string{}) // Invoke the callback with all the unmarshaled arguments - err = w.Handler.GetFiltersetFilters(ctx, filtersetId, params) + err = w.Handler.DeleteComplianceModulesetModuleset(ctx, modsetId, childModsetId) return err } -// DeleteFiltersetFilter converts echo context to params. -func (w *ServerInterfaceWrapper) DeleteFiltersetFilter(ctx echo.Context) error { +// PostComplianceModulesetModuleset converts echo context to params. +func (w *ServerInterfaceWrapper) PostComplianceModulesetModuleset(ctx echo.Context) error { var err error - // ------------- Path parameter "filterset_id" ------------- - var filtersetId string + // ------------- Path parameter "modset_id" ------------- + var modsetId string - err = runtime.BindStyledParameterWithOptions("simple", "filterset_id", ctx.Param("filterset_id"), &filtersetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "modset_id", ctx.Param("modset_id"), &modsetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { - return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter filterset_id: %s", err)) + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter modset_id: %s", err)) } - // ------------- Path parameter "f_id" ------------- - var fId string + // ------------- Path parameter "child_modset_id" ------------- + var childModsetId string - err = runtime.BindStyledParameterWithOptions("simple", "f_id", ctx.Param("f_id"), &fId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "child_modset_id", ctx.Param("child_modset_id"), &childModsetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { - return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter f_id: %s", err)) + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter child_modset_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Invoke the callback with all the unmarshaled arguments - err = w.Handler.DeleteFiltersetFilter(ctx, filtersetId, fId) + err = w.Handler.PostComplianceModulesetModuleset(ctx, modsetId, childModsetId) return err } -// PostFiltersetFilter converts echo context to params. -func (w *ServerInterfaceWrapper) PostFiltersetFilter(ctx echo.Context) error { +// GetComplianceModulesetNodes converts echo context to params. +func (w *ServerInterfaceWrapper) GetComplianceModulesetNodes(ctx echo.Context) error { var err error - // ------------- Path parameter "filterset_id" ------------- - var filtersetId string + // ------------- Path parameter "modset_id" ------------- + var modsetId string - err = runtime.BindStyledParameterWithOptions("simple", "filterset_id", ctx.Param("filterset_id"), &filtersetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "modset_id", ctx.Param("modset_id"), &modsetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { - return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter filterset_id: %s", err)) + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter modset_id: %s", err)) } - // ------------- Path parameter "f_id" ------------- - var fId string + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Parameter object where we will unmarshal all parameters from the context + var params GetComplianceModulesetNodesParams + // ------------- Optional query parameter "props" ------------- - err = runtime.BindStyledParameterWithOptions("simple", "f_id", ctx.Param("f_id"), &fId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { - return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter f_id: %s", err)) + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) + } + + // ------------- Optional query parameter "limit" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) + } + + // ------------- Optional query parameter "offset" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) + } + + // ------------- Optional query parameter "meta" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) + } + + // ------------- Optional query parameter "stats" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) + } + + // ------------- Optional query parameter "orderby" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) + } + + // ------------- Optional query parameter "filter" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "filter", ctx.QueryParams(), ¶ms.Filter, runtime.BindQueryParameterOptions{Type: "array", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter filter: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + // ------------- Optional query parameter "groupby" ------------- - ctx.Set(BearerAuthScopes, []string{}) + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) + } // Invoke the callback with all the unmarshaled arguments - err = w.Handler.PostFiltersetFilter(ctx, filtersetId, fId) + err = w.Handler.GetComplianceModulesetNodes(ctx, modsetId, params) return err } -// GetFiltersetFiltersets converts echo context to params. -func (w *ServerInterfaceWrapper) GetFiltersetFiltersets(ctx echo.Context) error { +// GetComplianceModulesetPublications converts echo context to params. +func (w *ServerInterfaceWrapper) GetComplianceModulesetPublications(ctx echo.Context) error { var err error - // ------------- Path parameter "filterset_id" ------------- - var filtersetId string + // ------------- Path parameter "modset_id" ------------- + var modsetId string - err = runtime.BindStyledParameterWithOptions("simple", "filterset_id", ctx.Param("filterset_id"), &filtersetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "modset_id", ctx.Param("modset_id"), &modsetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { - return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter filterset_id: %s", err)) + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter modset_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context - var params GetFiltersetFiltersetsParams + var params GetComplianceModulesetPublicationsParams // ------------- Optional query parameter "props" ------------- - err = runtime.BindQueryParameter("form", true, false, "props", ctx.QueryParams(), ¶ms.Props) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) } // ------------- Optional query parameter "limit" ------------- - err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit) + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) } // ------------- Optional query parameter "offset" ------------- - err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset) + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) } // ------------- Optional query parameter "meta" ------------- - err = runtime.BindQueryParameter("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta) + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) } // ------------- Optional query parameter "stats" ------------- - err = runtime.BindQueryParameter("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats) + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) } // ------------- Optional query parameter "orderby" ------------- - err = runtime.BindQueryParameter("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) } + // ------------- Optional query parameter "filter" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "filter", ctx.QueryParams(), ¶ms.Filter, runtime.BindQueryParameterOptions{Type: "array", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter filter: %s", err)) + } + // ------------- Optional query parameter "groupby" ------------- - err = runtime.BindQueryParameter("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) } // Invoke the callback with all the unmarshaled arguments - err = w.Handler.GetFiltersetFiltersets(ctx, filtersetId, params) + err = w.Handler.GetComplianceModulesetPublications(ctx, modsetId, params) return err } -// DeleteFiltersetFilterset converts echo context to params. -func (w *ServerInterfaceWrapper) DeleteFiltersetFilterset(ctx echo.Context) error { +// DeleteComplianceModulesetPublication converts echo context to params. +func (w *ServerInterfaceWrapper) DeleteComplianceModulesetPublication(ctx echo.Context) error { var err error - // ------------- Path parameter "filterset_id" ------------- - var filtersetId string + // ------------- Path parameter "modset_id" ------------- + var modsetId string - err = runtime.BindStyledParameterWithOptions("simple", "filterset_id", ctx.Param("filterset_id"), &filtersetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "modset_id", ctx.Param("modset_id"), &modsetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { - return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter filterset_id: %s", err)) + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter modset_id: %s", err)) } - // ------------- Path parameter "child_id" ------------- - var childId string + // ------------- Path parameter "group_id" ------------- + var groupId string - err = runtime.BindStyledParameterWithOptions("simple", "child_id", ctx.Param("child_id"), &childId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "group_id", ctx.Param("group_id"), &groupId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { - return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter child_id: %s", err)) + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter group_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Invoke the callback with all the unmarshaled arguments - err = w.Handler.DeleteFiltersetFilterset(ctx, filtersetId, childId) + err = w.Handler.DeleteComplianceModulesetPublication(ctx, modsetId, groupId) return err } -// PostFiltersetFilterset converts echo context to params. -func (w *ServerInterfaceWrapper) PostFiltersetFilterset(ctx echo.Context) error { +// PostComplianceModulesetPublication converts echo context to params. +func (w *ServerInterfaceWrapper) PostComplianceModulesetPublication(ctx echo.Context) error { var err error - // ------------- Path parameter "filterset_id" ------------- - var filtersetId string + // ------------- Path parameter "modset_id" ------------- + var modsetId string - err = runtime.BindStyledParameterWithOptions("simple", "filterset_id", ctx.Param("filterset_id"), &filtersetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "modset_id", ctx.Param("modset_id"), &modsetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { - return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter filterset_id: %s", err)) + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter modset_id: %s", err)) } - // ------------- Path parameter "child_id" ------------- - var childId string + // ------------- Path parameter "group_id" ------------- + var groupId string - err = runtime.BindStyledParameterWithOptions("simple", "child_id", ctx.Param("child_id"), &childId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "group_id", ctx.Param("group_id"), &groupId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { - return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter child_id: %s", err)) + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter group_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Invoke the callback with all the unmarshaled arguments - err = w.Handler.PostFiltersetFilterset(ctx, filtersetId, childId) + err = w.Handler.PostComplianceModulesetPublication(ctx, modsetId, groupId) return err } -// GetFiltersetNodes converts echo context to params. -func (w *ServerInterfaceWrapper) GetFiltersetNodes(ctx echo.Context) error { +// GetComplianceModulesetResponsibles converts echo context to params. +func (w *ServerInterfaceWrapper) GetComplianceModulesetResponsibles(ctx echo.Context) error { var err error - // ------------- Path parameter "filterset_id" ------------- - var filtersetId string + // ------------- Path parameter "modset_id" ------------- + var modsetId string - err = runtime.BindStyledParameterWithOptions("simple", "filterset_id", ctx.Param("filterset_id"), &filtersetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "modset_id", ctx.Param("modset_id"), &modsetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { - return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter filterset_id: %s", err)) + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter modset_id: %s", err)) + } + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Parameter object where we will unmarshal all parameters from the context + var params GetComplianceModulesetResponsiblesParams + // ------------- Optional query parameter "props" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) + } + + // ------------- Optional query parameter "limit" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) + } + + // ------------- Optional query parameter "offset" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + // ------------- Optional query parameter "meta" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) + } + + // ------------- Optional query parameter "stats" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) + } + + // ------------- Optional query parameter "orderby" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) + } + + // ------------- Optional query parameter "filter" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "filter", ctx.QueryParams(), ¶ms.Filter, runtime.BindQueryParameterOptions{Type: "array", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter filter: %s", err)) + } + + // ------------- Optional query parameter "groupby" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) + } + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.GetComplianceModulesetResponsibles(ctx, modsetId, params) + return err +} + +// DeleteComplianceModulesetResponsible converts echo context to params. +func (w *ServerInterfaceWrapper) DeleteComplianceModulesetResponsible(ctx echo.Context) error { + var err error + // ------------- Path parameter "modset_id" ------------- + var modsetId string + + err = runtime.BindStyledParameterWithOptions("simple", "modset_id", ctx.Param("modset_id"), &modsetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter modset_id: %s", err)) + } + + // ------------- Path parameter "group_id" ------------- + var groupId string + + err = runtime.BindStyledParameterWithOptions("simple", "group_id", ctx.Param("group_id"), &groupId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter group_id: %s", err)) + } + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.DeleteComplianceModulesetResponsible(ctx, modsetId, groupId) + return err +} + +// PostComplianceModulesetResponsible converts echo context to params. +func (w *ServerInterfaceWrapper) PostComplianceModulesetResponsible(ctx echo.Context) error { + var err error + // ------------- Path parameter "modset_id" ------------- + var modsetId string + + err = runtime.BindStyledParameterWithOptions("simple", "modset_id", ctx.Param("modset_id"), &modsetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter modset_id: %s", err)) + } + + // ------------- Path parameter "group_id" ------------- + var groupId string + + err = runtime.BindStyledParameterWithOptions("simple", "group_id", ctx.Param("group_id"), &groupId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter group_id: %s", err)) + } + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.PostComplianceModulesetResponsible(ctx, modsetId, groupId) + return err +} + +// DeleteComplianceModulesetRuleset converts echo context to params. +func (w *ServerInterfaceWrapper) DeleteComplianceModulesetRuleset(ctx echo.Context) error { + var err error + // ------------- Path parameter "modset_id" ------------- + var modsetId string + + err = runtime.BindStyledParameterWithOptions("simple", "modset_id", ctx.Param("modset_id"), &modsetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter modset_id: %s", err)) + } + + // ------------- Path parameter "rset_id" ------------- + var rsetId string + + err = runtime.BindStyledParameterWithOptions("simple", "rset_id", ctx.Param("rset_id"), &rsetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter rset_id: %s", err)) + } + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.DeleteComplianceModulesetRuleset(ctx, modsetId, rsetId) + return err +} + +// PostComplianceModulesetRuleset converts echo context to params. +func (w *ServerInterfaceWrapper) PostComplianceModulesetRuleset(ctx echo.Context) error { + var err error + // ------------- Path parameter "modset_id" ------------- + var modsetId string + + err = runtime.BindStyledParameterWithOptions("simple", "modset_id", ctx.Param("modset_id"), &modsetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter modset_id: %s", err)) + } + + // ------------- Path parameter "rset_id" ------------- + var rsetId string + + err = runtime.BindStyledParameterWithOptions("simple", "rset_id", ctx.Param("rset_id"), &rsetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter rset_id: %s", err)) + } + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.PostComplianceModulesetRuleset(ctx, modsetId, rsetId) + return err +} + +// GetComplianceModulesetServices converts echo context to params. +func (w *ServerInterfaceWrapper) GetComplianceModulesetServices(ctx echo.Context) error { + var err error + // ------------- Path parameter "modset_id" ------------- + var modsetId string + + err = runtime.BindStyledParameterWithOptions("simple", "modset_id", ctx.Param("modset_id"), &modsetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter modset_id: %s", err)) + } + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Parameter object where we will unmarshal all parameters from the context + var params GetComplianceModulesetServicesParams + // ------------- Optional query parameter "slave" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "slave", ctx.QueryParams(), ¶ms.Slave, runtime.BindQueryParameterOptions{Type: "boolean", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter slave: %s", err)) + } + + // ------------- Optional query parameter "props" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) + } + + // ------------- Optional query parameter "limit" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) + } + + // ------------- Optional query parameter "offset" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) + } + + // ------------- Optional query parameter "meta" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) + } + + // ------------- Optional query parameter "stats" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) + } + + // ------------- Optional query parameter "orderby" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) + } + + // ------------- Optional query parameter "filter" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "filter", ctx.QueryParams(), ¶ms.Filter, runtime.BindQueryParameterOptions{Type: "array", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter filter: %s", err)) + } + + // ------------- Optional query parameter "groupby" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) + } + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.GetComplianceModulesetServices(ctx, modsetId, params) + return err +} + +// GetComplianceModulesetUsage converts echo context to params. +func (w *ServerInterfaceWrapper) GetComplianceModulesetUsage(ctx echo.Context) error { + var err error + // ------------- Path parameter "modset_id" ------------- + var modsetId string + + err = runtime.BindStyledParameterWithOptions("simple", "modset_id", ctx.Param("modset_id"), &modsetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter modset_id: %s", err)) + } + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.GetComplianceModulesetUsage(ctx, modsetId) + return err +} + +// GetComplianceModulesetsModules converts echo context to params. +func (w *ServerInterfaceWrapper) GetComplianceModulesetsModules(ctx echo.Context) error { + var err error + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Parameter object where we will unmarshal all parameters from the context + var params GetComplianceModulesetsModulesParams + // ------------- Optional query parameter "props" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) + } + + // ------------- Optional query parameter "limit" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) + } + + // ------------- Optional query parameter "offset" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) + } + + // ------------- Optional query parameter "meta" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) + } + + // ------------- Optional query parameter "stats" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) + } + + // ------------- Optional query parameter "orderby" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) + } + + // ------------- Optional query parameter "filter" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "filter", ctx.QueryParams(), ¶ms.Filter, runtime.BindQueryParameterOptions{Type: "array", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter filter: %s", err)) + } + + // ------------- Optional query parameter "groupby" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) + } + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.GetComplianceModulesetsModules(ctx, params) + return err +} + +// DeleteComplianceModulesetsNodes converts echo context to params. +func (w *ServerInterfaceWrapper) DeleteComplianceModulesetsNodes(ctx echo.Context) error { + var err error + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.DeleteComplianceModulesetsNodes(ctx) + return err +} + +// PostComplianceModulesetsNodes converts echo context to params. +func (w *ServerInterfaceWrapper) PostComplianceModulesetsNodes(ctx echo.Context) error { + var err error + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.PostComplianceModulesetsNodes(ctx) + return err +} + +// DeleteComplianceModulesetsPublications converts echo context to params. +func (w *ServerInterfaceWrapper) DeleteComplianceModulesetsPublications(ctx echo.Context) error { + var err error + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.DeleteComplianceModulesetsPublications(ctx) + return err +} + +// PostComplianceModulesetsPublications converts echo context to params. +func (w *ServerInterfaceWrapper) PostComplianceModulesetsPublications(ctx echo.Context) error { + var err error + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.PostComplianceModulesetsPublications(ctx) + return err +} + +// DeleteComplianceModulesetsResponsibles converts echo context to params. +func (w *ServerInterfaceWrapper) DeleteComplianceModulesetsResponsibles(ctx echo.Context) error { + var err error + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.DeleteComplianceModulesetsResponsibles(ctx) + return err +} + +// PostComplianceModulesetsResponsibles converts echo context to params. +func (w *ServerInterfaceWrapper) PostComplianceModulesetsResponsibles(ctx echo.Context) error { + var err error + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.PostComplianceModulesetsResponsibles(ctx) + return err +} + +// DeleteComplianceModulesetsServices converts echo context to params. +func (w *ServerInterfaceWrapper) DeleteComplianceModulesetsServices(ctx echo.Context) error { + var err error + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.DeleteComplianceModulesetsServices(ctx) + return err +} + +// PostComplianceModulesetsServices converts echo context to params. +func (w *ServerInterfaceWrapper) PostComplianceModulesetsServices(ctx echo.Context) error { + var err error + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.PostComplianceModulesetsServices(ctx) + return err +} + +// DeleteComplianceRulesets converts echo context to params. +func (w *ServerInterfaceWrapper) DeleteComplianceRulesets(ctx echo.Context) error { + var err error + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.DeleteComplianceRulesets(ctx) + return err +} + +// GetComplianceRulesets converts echo context to params. +func (w *ServerInterfaceWrapper) GetComplianceRulesets(ctx echo.Context) error { + var err error + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Parameter object where we will unmarshal all parameters from the context + var params GetComplianceRulesetsParams + // ------------- Optional query parameter "props" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) + } + + // ------------- Optional query parameter "limit" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) + } + + // ------------- Optional query parameter "offset" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) + } + + // ------------- Optional query parameter "meta" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) + } + + // ------------- Optional query parameter "stats" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) + } + + // ------------- Optional query parameter "orderby" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) + } + + // ------------- Optional query parameter "filter" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "filter", ctx.QueryParams(), ¶ms.Filter, runtime.BindQueryParameterOptions{Type: "array", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter filter: %s", err)) + } + + // ------------- Optional query parameter "groupby" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) + } + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.GetComplianceRulesets(ctx, params) + return err +} + +// PostComplianceRulesets converts echo context to params. +func (w *ServerInterfaceWrapper) PostComplianceRulesets(ctx echo.Context) error { + var err error + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.PostComplianceRulesets(ctx) + return err +} + +// GetComplianceRulesetsExport converts echo context to params. +func (w *ServerInterfaceWrapper) GetComplianceRulesetsExport(ctx echo.Context) error { + var err error + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.GetComplianceRulesetsExport(ctx) + return err +} + +// DeleteComplianceRuleset converts echo context to params. +func (w *ServerInterfaceWrapper) DeleteComplianceRuleset(ctx echo.Context) error { + var err error + // ------------- Path parameter "rset_id" ------------- + var rsetId string + + err = runtime.BindStyledParameterWithOptions("simple", "rset_id", ctx.Param("rset_id"), &rsetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter rset_id: %s", err)) + } + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.DeleteComplianceRuleset(ctx, rsetId) + return err +} + +// GetComplianceRuleset converts echo context to params. +func (w *ServerInterfaceWrapper) GetComplianceRuleset(ctx echo.Context) error { + var err error + // ------------- Path parameter "rset_id" ------------- + var rsetId string + + err = runtime.BindStyledParameterWithOptions("simple", "rset_id", ctx.Param("rset_id"), &rsetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter rset_id: %s", err)) + } + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Parameter object where we will unmarshal all parameters from the context + var params GetComplianceRulesetParams + // ------------- Optional query parameter "props" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) + } + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.GetComplianceRuleset(ctx, rsetId, params) + return err +} + +// PostComplianceRuleset converts echo context to params. +func (w *ServerInterfaceWrapper) PostComplianceRuleset(ctx echo.Context) error { + var err error + // ------------- Path parameter "rset_id" ------------- + var rsetId string + + err = runtime.BindStyledParameterWithOptions("simple", "rset_id", ctx.Param("rset_id"), &rsetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter rset_id: %s", err)) + } + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.PostComplianceRuleset(ctx, rsetId) + return err +} + +// PutComplianceRuleset converts echo context to params. +func (w *ServerInterfaceWrapper) PutComplianceRuleset(ctx echo.Context) error { + var err error + // ------------- Path parameter "rset_id" ------------- + var rsetId string + + err = runtime.BindStyledParameterWithOptions("simple", "rset_id", ctx.Param("rset_id"), &rsetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter rset_id: %s", err)) + } + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.PutComplianceRuleset(ctx, rsetId) + return err +} + +// GetComplianceRulesetAmIResponsible converts echo context to params. +func (w *ServerInterfaceWrapper) GetComplianceRulesetAmIResponsible(ctx echo.Context) error { + var err error + // ------------- Path parameter "rset_id" ------------- + var rsetId string + + err = runtime.BindStyledParameterWithOptions("simple", "rset_id", ctx.Param("rset_id"), &rsetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter rset_id: %s", err)) + } + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.GetComplianceRulesetAmIResponsible(ctx, rsetId) + return err +} + +// GetComplianceRulesetCandidateNodes converts echo context to params. +func (w *ServerInterfaceWrapper) GetComplianceRulesetCandidateNodes(ctx echo.Context) error { + var err error + // ------------- Path parameter "rset_id" ------------- + var rsetId string + + err = runtime.BindStyledParameterWithOptions("simple", "rset_id", ctx.Param("rset_id"), &rsetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter rset_id: %s", err)) + } + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Parameter object where we will unmarshal all parameters from the context + var params GetComplianceRulesetCandidateNodesParams + // ------------- Optional query parameter "props" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) + } + + // ------------- Optional query parameter "limit" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) + } + + // ------------- Optional query parameter "offset" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) + } + + // ------------- Optional query parameter "meta" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) + } + + // ------------- Optional query parameter "stats" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) + } + + // ------------- Optional query parameter "orderby" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) + } + + // ------------- Optional query parameter "filter" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "filter", ctx.QueryParams(), ¶ms.Filter, runtime.BindQueryParameterOptions{Type: "array", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter filter: %s", err)) + } + + // ------------- Optional query parameter "groupby" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) + } + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.GetComplianceRulesetCandidateNodes(ctx, rsetId, params) + return err +} + +// GetComplianceRulesetCandidateServices converts echo context to params. +func (w *ServerInterfaceWrapper) GetComplianceRulesetCandidateServices(ctx echo.Context) error { + var err error + // ------------- Path parameter "rset_id" ------------- + var rsetId string + + err = runtime.BindStyledParameterWithOptions("simple", "rset_id", ctx.Param("rset_id"), &rsetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter rset_id: %s", err)) + } + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Parameter object where we will unmarshal all parameters from the context + var params GetComplianceRulesetCandidateServicesParams + // ------------- Optional query parameter "slave" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "slave", ctx.QueryParams(), ¶ms.Slave, runtime.BindQueryParameterOptions{Type: "boolean", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter slave: %s", err)) + } + + // ------------- Optional query parameter "props" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) + } + + // ------------- Optional query parameter "limit" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) + } + + // ------------- Optional query parameter "offset" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) + } + + // ------------- Optional query parameter "meta" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) + } + + // ------------- Optional query parameter "stats" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) + } + + // ------------- Optional query parameter "orderby" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) + } + + // ------------- Optional query parameter "filter" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "filter", ctx.QueryParams(), ¶ms.Filter, runtime.BindQueryParameterOptions{Type: "array", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter filter: %s", err)) + } + + // ------------- Optional query parameter "groupby" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) + } + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.GetComplianceRulesetCandidateServices(ctx, rsetId, params) + return err +} + +// GetComplianceRulesetExport converts echo context to params. +func (w *ServerInterfaceWrapper) GetComplianceRulesetExport(ctx echo.Context) error { + var err error + // ------------- Path parameter "rset_id" ------------- + var rsetId string + + err = runtime.BindStyledParameterWithOptions("simple", "rset_id", ctx.Param("rset_id"), &rsetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter rset_id: %s", err)) + } + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.GetComplianceRulesetExport(ctx, rsetId) + return err +} + +// DeleteComplianceRulesetFilterset converts echo context to params. +func (w *ServerInterfaceWrapper) DeleteComplianceRulesetFilterset(ctx echo.Context) error { + var err error + // ------------- Path parameter "rset_id" ------------- + var rsetId string + + err = runtime.BindStyledParameterWithOptions("simple", "rset_id", ctx.Param("rset_id"), &rsetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter rset_id: %s", err)) + } + + // ------------- Path parameter "fset_id" ------------- + var fsetId string + + err = runtime.BindStyledParameterWithOptions("simple", "fset_id", ctx.Param("fset_id"), &fsetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter fset_id: %s", err)) + } + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.DeleteComplianceRulesetFilterset(ctx, rsetId, fsetId) + return err +} + +// PostComplianceRulesetFilterset converts echo context to params. +func (w *ServerInterfaceWrapper) PostComplianceRulesetFilterset(ctx echo.Context) error { + var err error + // ------------- Path parameter "rset_id" ------------- + var rsetId string + + err = runtime.BindStyledParameterWithOptions("simple", "rset_id", ctx.Param("rset_id"), &rsetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter rset_id: %s", err)) + } + + // ------------- Path parameter "fset_id" ------------- + var fsetId string + + err = runtime.BindStyledParameterWithOptions("simple", "fset_id", ctx.Param("fset_id"), &fsetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter fset_id: %s", err)) + } + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.PostComplianceRulesetFilterset(ctx, rsetId, fsetId) + return err +} + +// GetComplianceRulesetNodes converts echo context to params. +func (w *ServerInterfaceWrapper) GetComplianceRulesetNodes(ctx echo.Context) error { + var err error + // ------------- Path parameter "rset_id" ------------- + var rsetId string + + err = runtime.BindStyledParameterWithOptions("simple", "rset_id", ctx.Param("rset_id"), &rsetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter rset_id: %s", err)) + } + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Parameter object where we will unmarshal all parameters from the context + var params GetComplianceRulesetNodesParams + // ------------- Optional query parameter "props" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) + } + + // ------------- Optional query parameter "limit" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) + } + + // ------------- Optional query parameter "offset" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) + } + + // ------------- Optional query parameter "meta" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) + } + + // ------------- Optional query parameter "stats" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) + } + + // ------------- Optional query parameter "orderby" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) + } + + // ------------- Optional query parameter "filter" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "filter", ctx.QueryParams(), ¶ms.Filter, runtime.BindQueryParameterOptions{Type: "array", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter filter: %s", err)) + } + + // ------------- Optional query parameter "groupby" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) + } + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.GetComplianceRulesetNodes(ctx, rsetId, params) + return err +} + +// GetComplianceRulesetPublications converts echo context to params. +func (w *ServerInterfaceWrapper) GetComplianceRulesetPublications(ctx echo.Context) error { + var err error + // ------------- Path parameter "rset_id" ------------- + var rsetId string + + err = runtime.BindStyledParameterWithOptions("simple", "rset_id", ctx.Param("rset_id"), &rsetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter rset_id: %s", err)) + } + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Parameter object where we will unmarshal all parameters from the context + var params GetComplianceRulesetPublicationsParams + // ------------- Optional query parameter "props" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) + } + + // ------------- Optional query parameter "limit" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) + } + + // ------------- Optional query parameter "offset" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) + } + + // ------------- Optional query parameter "meta" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) + } + + // ------------- Optional query parameter "stats" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) + } + + // ------------- Optional query parameter "orderby" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) + } + + // ------------- Optional query parameter "filter" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "filter", ctx.QueryParams(), ¶ms.Filter, runtime.BindQueryParameterOptions{Type: "array", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter filter: %s", err)) + } + + // ------------- Optional query parameter "groupby" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) + } + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.GetComplianceRulesetPublications(ctx, rsetId, params) + return err +} + +// DeleteComplianceRulesetPublication converts echo context to params. +func (w *ServerInterfaceWrapper) DeleteComplianceRulesetPublication(ctx echo.Context) error { + var err error + // ------------- Path parameter "rset_id" ------------- + var rsetId string + + err = runtime.BindStyledParameterWithOptions("simple", "rset_id", ctx.Param("rset_id"), &rsetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter rset_id: %s", err)) + } + + // ------------- Path parameter "group_id" ------------- + var groupId string + + err = runtime.BindStyledParameterWithOptions("simple", "group_id", ctx.Param("group_id"), &groupId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter group_id: %s", err)) + } + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.DeleteComplianceRulesetPublication(ctx, rsetId, groupId) + return err +} + +// PostComplianceRulesetPublication converts echo context to params. +func (w *ServerInterfaceWrapper) PostComplianceRulesetPublication(ctx echo.Context) error { + var err error + // ------------- Path parameter "rset_id" ------------- + var rsetId string + + err = runtime.BindStyledParameterWithOptions("simple", "rset_id", ctx.Param("rset_id"), &rsetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter rset_id: %s", err)) + } + + // ------------- Path parameter "group_id" ------------- + var groupId string + + err = runtime.BindStyledParameterWithOptions("simple", "group_id", ctx.Param("group_id"), &groupId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter group_id: %s", err)) + } + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.PostComplianceRulesetPublication(ctx, rsetId, groupId) + return err +} + +// GetComplianceRulesetResponsibles converts echo context to params. +func (w *ServerInterfaceWrapper) GetComplianceRulesetResponsibles(ctx echo.Context) error { + var err error + // ------------- Path parameter "rset_id" ------------- + var rsetId string + + err = runtime.BindStyledParameterWithOptions("simple", "rset_id", ctx.Param("rset_id"), &rsetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter rset_id: %s", err)) + } + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Parameter object where we will unmarshal all parameters from the context + var params GetComplianceRulesetResponsiblesParams + // ------------- Optional query parameter "props" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) + } + + // ------------- Optional query parameter "limit" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) + } + + // ------------- Optional query parameter "offset" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) + } + + // ------------- Optional query parameter "meta" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) + } + + // ------------- Optional query parameter "stats" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) + } + + // ------------- Optional query parameter "orderby" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) + } + + // ------------- Optional query parameter "filter" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "filter", ctx.QueryParams(), ¶ms.Filter, runtime.BindQueryParameterOptions{Type: "array", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter filter: %s", err)) + } + + // ------------- Optional query parameter "groupby" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) + } + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.GetComplianceRulesetResponsibles(ctx, rsetId, params) + return err +} + +// DeleteComplianceRulesetResponsible converts echo context to params. +func (w *ServerInterfaceWrapper) DeleteComplianceRulesetResponsible(ctx echo.Context) error { + var err error + // ------------- Path parameter "rset_id" ------------- + var rsetId string + + err = runtime.BindStyledParameterWithOptions("simple", "rset_id", ctx.Param("rset_id"), &rsetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter rset_id: %s", err)) + } + + // ------------- Path parameter "group_id" ------------- + var groupId string + + err = runtime.BindStyledParameterWithOptions("simple", "group_id", ctx.Param("group_id"), &groupId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter group_id: %s", err)) + } + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.DeleteComplianceRulesetResponsible(ctx, rsetId, groupId) + return err +} + +// PostComplianceRulesetResponsible converts echo context to params. +func (w *ServerInterfaceWrapper) PostComplianceRulesetResponsible(ctx echo.Context) error { + var err error + // ------------- Path parameter "rset_id" ------------- + var rsetId string + + err = runtime.BindStyledParameterWithOptions("simple", "rset_id", ctx.Param("rset_id"), &rsetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter rset_id: %s", err)) + } + + // ------------- Path parameter "group_id" ------------- + var groupId string + + err = runtime.BindStyledParameterWithOptions("simple", "group_id", ctx.Param("group_id"), &groupId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter group_id: %s", err)) + } + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.PostComplianceRulesetResponsible(ctx, rsetId, groupId) + return err +} + +// DeleteComplianceRulesetRuleset converts echo context to params. +func (w *ServerInterfaceWrapper) DeleteComplianceRulesetRuleset(ctx echo.Context) error { + var err error + // ------------- Path parameter "rset_id" ------------- + var rsetId string + + err = runtime.BindStyledParameterWithOptions("simple", "rset_id", ctx.Param("rset_id"), &rsetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter rset_id: %s", err)) + } + + // ------------- Path parameter "child_rset_id" ------------- + var childRsetId string + + err = runtime.BindStyledParameterWithOptions("simple", "child_rset_id", ctx.Param("child_rset_id"), &childRsetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter child_rset_id: %s", err)) + } + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.DeleteComplianceRulesetRuleset(ctx, rsetId, childRsetId) + return err +} + +// PostComplianceRulesetRuleset converts echo context to params. +func (w *ServerInterfaceWrapper) PostComplianceRulesetRuleset(ctx echo.Context) error { + var err error + // ------------- Path parameter "rset_id" ------------- + var rsetId string + + err = runtime.BindStyledParameterWithOptions("simple", "rset_id", ctx.Param("rset_id"), &rsetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter rset_id: %s", err)) + } + + // ------------- Path parameter "child_rset_id" ------------- + var childRsetId string + + err = runtime.BindStyledParameterWithOptions("simple", "child_rset_id", ctx.Param("child_rset_id"), &childRsetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter child_rset_id: %s", err)) + } + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.PostComplianceRulesetRuleset(ctx, rsetId, childRsetId) + return err +} + +// GetComplianceRulesetServices converts echo context to params. +func (w *ServerInterfaceWrapper) GetComplianceRulesetServices(ctx echo.Context) error { + var err error + // ------------- Path parameter "rset_id" ------------- + var rsetId string + + err = runtime.BindStyledParameterWithOptions("simple", "rset_id", ctx.Param("rset_id"), &rsetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter rset_id: %s", err)) + } + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Parameter object where we will unmarshal all parameters from the context + var params GetComplianceRulesetServicesParams + // ------------- Optional query parameter "slave" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "slave", ctx.QueryParams(), ¶ms.Slave, runtime.BindQueryParameterOptions{Type: "boolean", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter slave: %s", err)) + } + + // ------------- Optional query parameter "props" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) + } + + // ------------- Optional query parameter "limit" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) + } + + // ------------- Optional query parameter "offset" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) + } + + // ------------- Optional query parameter "meta" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) + } + + // ------------- Optional query parameter "stats" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) + } + + // ------------- Optional query parameter "orderby" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) + } + + // ------------- Optional query parameter "filter" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "filter", ctx.QueryParams(), ¶ms.Filter, runtime.BindQueryParameterOptions{Type: "array", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter filter: %s", err)) + } + + // ------------- Optional query parameter "groupby" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) + } + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.GetComplianceRulesetServices(ctx, rsetId, params) + return err +} + +// GetComplianceRulesetUsage converts echo context to params. +func (w *ServerInterfaceWrapper) GetComplianceRulesetUsage(ctx echo.Context) error { + var err error + // ------------- Path parameter "rset_id" ------------- + var rsetId string + + err = runtime.BindStyledParameterWithOptions("simple", "rset_id", ctx.Param("rset_id"), &rsetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter rset_id: %s", err)) + } + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.GetComplianceRulesetUsage(ctx, rsetId) + return err +} + +// GetComplianceRulesetVariables converts echo context to params. +func (w *ServerInterfaceWrapper) GetComplianceRulesetVariables(ctx echo.Context) error { + var err error + // ------------- Path parameter "rset_id" ------------- + var rsetId string + + err = runtime.BindStyledParameterWithOptions("simple", "rset_id", ctx.Param("rset_id"), &rsetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter rset_id: %s", err)) + } + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Parameter object where we will unmarshal all parameters from the context + var params GetComplianceRulesetVariablesParams + // ------------- Optional query parameter "props" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) + } + + // ------------- Optional query parameter "limit" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) + } + + // ------------- Optional query parameter "offset" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) + } + + // ------------- Optional query parameter "meta" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) + } + + // ------------- Optional query parameter "stats" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) + } + + // ------------- Optional query parameter "orderby" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) + } + + // ------------- Optional query parameter "filter" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "filter", ctx.QueryParams(), ¶ms.Filter, runtime.BindQueryParameterOptions{Type: "array", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter filter: %s", err)) + } + + // ------------- Optional query parameter "groupby" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) + } + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.GetComplianceRulesetVariables(ctx, rsetId, params) + return err +} + +// PostComplianceRulesetVariables converts echo context to params. +func (w *ServerInterfaceWrapper) PostComplianceRulesetVariables(ctx echo.Context) error { + var err error + // ------------- Path parameter "rset_id" ------------- + var rsetId string + + err = runtime.BindStyledParameterWithOptions("simple", "rset_id", ctx.Param("rset_id"), &rsetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter rset_id: %s", err)) + } + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.PostComplianceRulesetVariables(ctx, rsetId) + return err +} + +// DeleteComplianceRulesetVariable converts echo context to params. +func (w *ServerInterfaceWrapper) DeleteComplianceRulesetVariable(ctx echo.Context) error { + var err error + // ------------- Path parameter "rset_id" ------------- + var rsetId string + + err = runtime.BindStyledParameterWithOptions("simple", "rset_id", ctx.Param("rset_id"), &rsetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter rset_id: %s", err)) + } + + // ------------- Path parameter "var_id" ------------- + var varId string + + err = runtime.BindStyledParameterWithOptions("simple", "var_id", ctx.Param("var_id"), &varId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter var_id: %s", err)) + } + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.DeleteComplianceRulesetVariable(ctx, rsetId, varId) + return err +} + +// GetComplianceRulesetVariable converts echo context to params. +func (w *ServerInterfaceWrapper) GetComplianceRulesetVariable(ctx echo.Context) error { + var err error + // ------------- Path parameter "rset_id" ------------- + var rsetId string + + err = runtime.BindStyledParameterWithOptions("simple", "rset_id", ctx.Param("rset_id"), &rsetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter rset_id: %s", err)) + } + + // ------------- Path parameter "var_id" ------------- + var varId string + + err = runtime.BindStyledParameterWithOptions("simple", "var_id", ctx.Param("var_id"), &varId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter var_id: %s", err)) + } + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Parameter object where we will unmarshal all parameters from the context + var params GetComplianceRulesetVariableParams + // ------------- Optional query parameter "props" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) + } + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.GetComplianceRulesetVariable(ctx, rsetId, varId, params) + return err +} + +// PostComplianceRulesetVariable converts echo context to params. +func (w *ServerInterfaceWrapper) PostComplianceRulesetVariable(ctx echo.Context) error { + var err error + // ------------- Path parameter "rset_id" ------------- + var rsetId string + + err = runtime.BindStyledParameterWithOptions("simple", "rset_id", ctx.Param("rset_id"), &rsetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter rset_id: %s", err)) + } + + // ------------- Path parameter "var_id" ------------- + var varId string + + err = runtime.BindStyledParameterWithOptions("simple", "var_id", ctx.Param("var_id"), &varId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter var_id: %s", err)) + } + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.PostComplianceRulesetVariable(ctx, rsetId, varId) + return err +} + +// PutComplianceRulesetVariable converts echo context to params. +func (w *ServerInterfaceWrapper) PutComplianceRulesetVariable(ctx echo.Context) error { + var err error + // ------------- Path parameter "rset_id" ------------- + var rsetId string + + err = runtime.BindStyledParameterWithOptions("simple", "rset_id", ctx.Param("rset_id"), &rsetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter rset_id: %s", err)) + } + + // ------------- Path parameter "var_id" ------------- + var varId string + + err = runtime.BindStyledParameterWithOptions("simple", "var_id", ctx.Param("var_id"), &varId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter var_id: %s", err)) + } + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.PutComplianceRulesetVariable(ctx, rsetId, varId) + return err +} + +// DeleteComplianceRulesetsNodes converts echo context to params. +func (w *ServerInterfaceWrapper) DeleteComplianceRulesetsNodes(ctx echo.Context) error { + var err error + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.DeleteComplianceRulesetsNodes(ctx) + return err +} + +// PostComplianceRulesetsNodes converts echo context to params. +func (w *ServerInterfaceWrapper) PostComplianceRulesetsNodes(ctx echo.Context) error { + var err error + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.PostComplianceRulesetsNodes(ctx) + return err +} + +// DeleteComplianceRulesetsPublications converts echo context to params. +func (w *ServerInterfaceWrapper) DeleteComplianceRulesetsPublications(ctx echo.Context) error { + var err error + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.DeleteComplianceRulesetsPublications(ctx) + return err +} + +// PostComplianceRulesetsPublications converts echo context to params. +func (w *ServerInterfaceWrapper) PostComplianceRulesetsPublications(ctx echo.Context) error { + var err error + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.PostComplianceRulesetsPublications(ctx) + return err +} + +// DeleteComplianceRulesetsResponsibles converts echo context to params. +func (w *ServerInterfaceWrapper) DeleteComplianceRulesetsResponsibles(ctx echo.Context) error { + var err error + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.DeleteComplianceRulesetsResponsibles(ctx) + return err +} + +// PostComplianceRulesetsResponsibles converts echo context to params. +func (w *ServerInterfaceWrapper) PostComplianceRulesetsResponsibles(ctx echo.Context) error { + var err error + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.PostComplianceRulesetsResponsibles(ctx) + return err +} + +// DeleteComplianceRulesetsServices converts echo context to params. +func (w *ServerInterfaceWrapper) DeleteComplianceRulesetsServices(ctx echo.Context) error { + var err error + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.DeleteComplianceRulesetsServices(ctx) + return err +} + +// PostComplianceRulesetsServices converts echo context to params. +func (w *ServerInterfaceWrapper) PostComplianceRulesetsServices(ctx echo.Context) error { + var err error + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.PostComplianceRulesetsServices(ctx) + return err +} + +// GetComplianceRulesetsVariables converts echo context to params. +func (w *ServerInterfaceWrapper) GetComplianceRulesetsVariables(ctx echo.Context) error { + var err error + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Parameter object where we will unmarshal all parameters from the context + var params GetComplianceRulesetsVariablesParams + // ------------- Optional query parameter "props" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) + } + + // ------------- Optional query parameter "limit" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) + } + + // ------------- Optional query parameter "offset" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) + } + + // ------------- Optional query parameter "meta" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) + } + + // ------------- Optional query parameter "stats" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) + } + + // ------------- Optional query parameter "orderby" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) + } + + // ------------- Optional query parameter "filter" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "filter", ctx.QueryParams(), ¶ms.Filter, runtime.BindQueryParameterOptions{Type: "array", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter filter: %s", err)) + } + + // ------------- Optional query parameter "groupby" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) + } + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.GetComplianceRulesetsVariables(ctx, params) + return err +} + +// PostComplianceRulesetsVariables converts echo context to params. +func (w *ServerInterfaceWrapper) PostComplianceRulesetsVariables(ctx echo.Context) error { + var err error + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.PostComplianceRulesetsVariables(ctx) + return err +} + +// DeleteComplianceStatus converts echo context to params. +func (w *ServerInterfaceWrapper) DeleteComplianceStatus(ctx echo.Context) error { + var err error + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.DeleteComplianceStatus(ctx) + return err +} + +// GetComplianceStatus converts echo context to params. +func (w *ServerInterfaceWrapper) GetComplianceStatus(ctx echo.Context) error { + var err error + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Parameter object where we will unmarshal all parameters from the context + var params GetComplianceStatusParams + // ------------- Optional query parameter "props" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) + } + + // ------------- Optional query parameter "limit" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) + } + + // ------------- Optional query parameter "offset" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) + } + + // ------------- Optional query parameter "meta" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) + } + + // ------------- Optional query parameter "stats" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) + } + + // ------------- Optional query parameter "orderby" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) + } + + // ------------- Optional query parameter "filter" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "filter", ctx.QueryParams(), ¶ms.Filter, runtime.BindQueryParameterOptions{Type: "array", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter filter: %s", err)) + } + + // ------------- Optional query parameter "groupby" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) + } + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.GetComplianceStatus(ctx, params) + return err +} + +// DeleteComplianceStatusRun converts echo context to params. +func (w *ServerInterfaceWrapper) DeleteComplianceStatusRun(ctx echo.Context) error { + var err error + // ------------- Path parameter "status_id" ------------- + var statusId string + + err = runtime.BindStyledParameterWithOptions("simple", "status_id", ctx.Param("status_id"), &statusId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter status_id: %s", err)) + } + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.DeleteComplianceStatusRun(ctx, statusId) + return err +} + +// GetComplianceStatusRun converts echo context to params. +func (w *ServerInterfaceWrapper) GetComplianceStatusRun(ctx echo.Context) error { + var err error + // ------------- Path parameter "status_id" ------------- + var statusId string + + err = runtime.BindStyledParameterWithOptions("simple", "status_id", ctx.Param("status_id"), &statusId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter status_id: %s", err)) + } + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Parameter object where we will unmarshal all parameters from the context + var params GetComplianceStatusRunParams + // ------------- Optional query parameter "props" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) + } + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.GetComplianceStatusRun(ctx, statusId, params) + return err +} + +// DeleteDisks converts echo context to params. +func (w *ServerInterfaceWrapper) DeleteDisks(ctx echo.Context) error { + var err error + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.DeleteDisks(ctx) + return err +} + +// GetDisks converts echo context to params. +func (w *ServerInterfaceWrapper) GetDisks(ctx echo.Context) error { + var err error + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Parameter object where we will unmarshal all parameters from the context + var params GetDisksParams + // ------------- Optional query parameter "props" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) + } + + // ------------- Optional query parameter "limit" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) + } + + // ------------- Optional query parameter "offset" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) + } + + // ------------- Optional query parameter "meta" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) + } + + // ------------- Optional query parameter "stats" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) + } + + // ------------- Optional query parameter "orderby" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) + } + + // ------------- Optional query parameter "groupby" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) + } + + // ------------- Optional query parameter "filter" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "filter", ctx.QueryParams(), ¶ms.Filter, runtime.BindQueryParameterOptions{Type: "array", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter filter: %s", err)) + } + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.GetDisks(ctx, params) + return err +} + +// PostDisks converts echo context to params. +func (w *ServerInterfaceWrapper) PostDisks(ctx echo.Context) error { + var err error + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.PostDisks(ctx) + return err +} + +// DeleteDisk converts echo context to params. +func (w *ServerInterfaceWrapper) DeleteDisk(ctx echo.Context) error { + var err error + // ------------- Path parameter "disk_id" ------------- + var diskId string + + err = runtime.BindStyledParameterWithOptions("simple", "disk_id", ctx.Param("disk_id"), &diskId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter disk_id: %s", err)) + } + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.DeleteDisk(ctx, diskId) + return err +} + +// GetDisk converts echo context to params. +func (w *ServerInterfaceWrapper) GetDisk(ctx echo.Context) error { + var err error + // ------------- Path parameter "disk_id" ------------- + var diskId string + + err = runtime.BindStyledParameterWithOptions("simple", "disk_id", ctx.Param("disk_id"), &diskId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter disk_id: %s", err)) + } + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Parameter object where we will unmarshal all parameters from the context + var params GetDiskParams + // ------------- Optional query parameter "props" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) + } + + // ------------- Optional query parameter "limit" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) + } + + // ------------- Optional query parameter "offset" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) + } + + // ------------- Optional query parameter "meta" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) + } + + // ------------- Optional query parameter "stats" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) + } + + // ------------- Optional query parameter "orderby" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) + } + + // ------------- Optional query parameter "groupby" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) + } + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.GetDisk(ctx, diskId, params) + return err +} + +// DeleteFilters converts echo context to params. +func (w *ServerInterfaceWrapper) DeleteFilters(ctx echo.Context) error { + var err error + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.DeleteFilters(ctx) + return err +} + +// GetFilters converts echo context to params. +func (w *ServerInterfaceWrapper) GetFilters(ctx echo.Context) error { + var err error + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Parameter object where we will unmarshal all parameters from the context + var params GetFiltersParams + // ------------- Optional query parameter "props" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) + } + + // ------------- Optional query parameter "limit" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) + } + + // ------------- Optional query parameter "offset" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) + } + + // ------------- Optional query parameter "meta" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) + } + + // ------------- Optional query parameter "stats" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) + } + + // ------------- Optional query parameter "orderby" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) + } + + // ------------- Optional query parameter "groupby" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) + } + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.GetFilters(ctx, params) + return err +} + +// PostFilters converts echo context to params. +func (w *ServerInterfaceWrapper) PostFilters(ctx echo.Context) error { + var err error + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.PostFilters(ctx) + return err +} + +// DeleteFilter converts echo context to params. +func (w *ServerInterfaceWrapper) DeleteFilter(ctx echo.Context) error { + var err error + // ------------- Path parameter "filter_id" ------------- + var filterId string + + err = runtime.BindStyledParameterWithOptions("simple", "filter_id", ctx.Param("filter_id"), &filterId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter filter_id: %s", err)) + } + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.DeleteFilter(ctx, filterId) + return err +} + +// GetFilter converts echo context to params. +func (w *ServerInterfaceWrapper) GetFilter(ctx echo.Context) error { + var err error + // ------------- Path parameter "filter_id" ------------- + var filterId string + + err = runtime.BindStyledParameterWithOptions("simple", "filter_id", ctx.Param("filter_id"), &filterId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter filter_id: %s", err)) + } + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Parameter object where we will unmarshal all parameters from the context + var params GetFilterParams + // ------------- Optional query parameter "props" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) + } + + // ------------- Optional query parameter "limit" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) + } + + // ------------- Optional query parameter "offset" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) + } + + // ------------- Optional query parameter "meta" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) + } + + // ------------- Optional query parameter "stats" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) + } + + // ------------- Optional query parameter "orderby" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) + } + + // ------------- Optional query parameter "groupby" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) + } + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.GetFilter(ctx, filterId, params) + return err +} + +// PostFilter converts echo context to params. +func (w *ServerInterfaceWrapper) PostFilter(ctx echo.Context) error { + var err error + // ------------- Path parameter "filter_id" ------------- + var filterId string + + err = runtime.BindStyledParameterWithOptions("simple", "filter_id", ctx.Param("filter_id"), &filterId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter filter_id: %s", err)) + } + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.PostFilter(ctx, filterId) + return err +} + +// DeleteFiltersets converts echo context to params. +func (w *ServerInterfaceWrapper) DeleteFiltersets(ctx echo.Context) error { + var err error + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.DeleteFiltersets(ctx) + return err +} + +// GetFiltersets converts echo context to params. +func (w *ServerInterfaceWrapper) GetFiltersets(ctx echo.Context) error { + var err error + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Parameter object where we will unmarshal all parameters from the context + var params GetFiltersetsParams + // ------------- Optional query parameter "props" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) + } + + // ------------- Optional query parameter "limit" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) + } + + // ------------- Optional query parameter "offset" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) + } + + // ------------- Optional query parameter "meta" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) + } + + // ------------- Optional query parameter "stats" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) + } + + // ------------- Optional query parameter "orderby" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) + } + + // ------------- Optional query parameter "groupby" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) + } + + // ------------- Optional query parameter "filter" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "filter", ctx.QueryParams(), ¶ms.Filter, runtime.BindQueryParameterOptions{Type: "array", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter filter: %s", err)) + } + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.GetFiltersets(ctx, params) + return err +} + +// PostFiltersets converts echo context to params. +func (w *ServerInterfaceWrapper) PostFiltersets(ctx echo.Context) error { + var err error + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.PostFiltersets(ctx) + return err +} + +// DeleteFilterset converts echo context to params. +func (w *ServerInterfaceWrapper) DeleteFilterset(ctx echo.Context) error { + var err error + // ------------- Path parameter "filterset_id" ------------- + var filtersetId string + + err = runtime.BindStyledParameterWithOptions("simple", "filterset_id", ctx.Param("filterset_id"), &filtersetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter filterset_id: %s", err)) + } + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.DeleteFilterset(ctx, filtersetId) + return err +} + +// GetFilterset converts echo context to params. +func (w *ServerInterfaceWrapper) GetFilterset(ctx echo.Context) error { + var err error + // ------------- Path parameter "filterset_id" ------------- + var filtersetId string + + err = runtime.BindStyledParameterWithOptions("simple", "filterset_id", ctx.Param("filterset_id"), &filtersetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter filterset_id: %s", err)) + } + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Parameter object where we will unmarshal all parameters from the context + var params GetFiltersetParams + // ------------- Optional query parameter "props" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) + } + + // ------------- Optional query parameter "limit" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) + } + + // ------------- Optional query parameter "offset" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) + } + + // ------------- Optional query parameter "meta" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) + } + + // ------------- Optional query parameter "stats" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) + } + + // ------------- Optional query parameter "orderby" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) + } + + // ------------- Optional query parameter "groupby" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) + } + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.GetFilterset(ctx, filtersetId, params) + return err +} + +// PostFilterset converts echo context to params. +func (w *ServerInterfaceWrapper) PostFilterset(ctx echo.Context) error { + var err error + // ------------- Path parameter "filterset_id" ------------- + var filtersetId string + + err = runtime.BindStyledParameterWithOptions("simple", "filterset_id", ctx.Param("filterset_id"), &filtersetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter filterset_id: %s", err)) + } + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.PostFilterset(ctx, filtersetId) + return err +} + +// GetFiltersetExport converts echo context to params. +func (w *ServerInterfaceWrapper) GetFiltersetExport(ctx echo.Context) error { + var err error + // ------------- Path parameter "filterset_id" ------------- + var filtersetId string + + err = runtime.BindStyledParameterWithOptions("simple", "filterset_id", ctx.Param("filterset_id"), &filtersetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter filterset_id: %s", err)) + } + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.GetFiltersetExport(ctx, filtersetId) + return err +} + +// GetFiltersetFilters converts echo context to params. +func (w *ServerInterfaceWrapper) GetFiltersetFilters(ctx echo.Context) error { + var err error + // ------------- Path parameter "filterset_id" ------------- + var filtersetId string + + err = runtime.BindStyledParameterWithOptions("simple", "filterset_id", ctx.Param("filterset_id"), &filtersetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter filterset_id: %s", err)) + } + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Parameter object where we will unmarshal all parameters from the context + var params GetFiltersetFiltersParams + // ------------- Optional query parameter "props" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) + } + + // ------------- Optional query parameter "limit" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) + } + + // ------------- Optional query parameter "offset" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) + } + + // ------------- Optional query parameter "meta" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) + } + + // ------------- Optional query parameter "stats" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) + } + + // ------------- Optional query parameter "orderby" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) + } + + // ------------- Optional query parameter "groupby" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) + } + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.GetFiltersetFilters(ctx, filtersetId, params) + return err +} + +// DeleteFiltersetFilter converts echo context to params. +func (w *ServerInterfaceWrapper) DeleteFiltersetFilter(ctx echo.Context) error { + var err error + // ------------- Path parameter "filterset_id" ------------- + var filtersetId string + + err = runtime.BindStyledParameterWithOptions("simple", "filterset_id", ctx.Param("filterset_id"), &filtersetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter filterset_id: %s", err)) + } + + // ------------- Path parameter "f_id" ------------- + var fId string + + err = runtime.BindStyledParameterWithOptions("simple", "f_id", ctx.Param("f_id"), &fId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter f_id: %s", err)) + } + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.DeleteFiltersetFilter(ctx, filtersetId, fId) + return err +} + +// PostFiltersetFilter converts echo context to params. +func (w *ServerInterfaceWrapper) PostFiltersetFilter(ctx echo.Context) error { + var err error + // ------------- Path parameter "filterset_id" ------------- + var filtersetId string + + err = runtime.BindStyledParameterWithOptions("simple", "filterset_id", ctx.Param("filterset_id"), &filtersetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter filterset_id: %s", err)) + } + + // ------------- Path parameter "f_id" ------------- + var fId string + + err = runtime.BindStyledParameterWithOptions("simple", "f_id", ctx.Param("f_id"), &fId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter f_id: %s", err)) + } + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.PostFiltersetFilter(ctx, filtersetId, fId) + return err +} + +// GetFiltersetFiltersets converts echo context to params. +func (w *ServerInterfaceWrapper) GetFiltersetFiltersets(ctx echo.Context) error { + var err error + // ------------- Path parameter "filterset_id" ------------- + var filtersetId string + + err = runtime.BindStyledParameterWithOptions("simple", "filterset_id", ctx.Param("filterset_id"), &filtersetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter filterset_id: %s", err)) + } + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Parameter object where we will unmarshal all parameters from the context + var params GetFiltersetFiltersetsParams + // ------------- Optional query parameter "props" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) + } + + // ------------- Optional query parameter "limit" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) + } + + // ------------- Optional query parameter "offset" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) + } + + // ------------- Optional query parameter "meta" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) + } + + // ------------- Optional query parameter "stats" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) + } + + // ------------- Optional query parameter "orderby" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) + } + + // ------------- Optional query parameter "groupby" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) + } + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.GetFiltersetFiltersets(ctx, filtersetId, params) + return err +} + +// DeleteFiltersetFilterset converts echo context to params. +func (w *ServerInterfaceWrapper) DeleteFiltersetFilterset(ctx echo.Context) error { + var err error + // ------------- Path parameter "filterset_id" ------------- + var filtersetId string + + err = runtime.BindStyledParameterWithOptions("simple", "filterset_id", ctx.Param("filterset_id"), &filtersetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter filterset_id: %s", err)) + } + + // ------------- Path parameter "child_id" ------------- + var childId string + + err = runtime.BindStyledParameterWithOptions("simple", "child_id", ctx.Param("child_id"), &childId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter child_id: %s", err)) + } + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.DeleteFiltersetFilterset(ctx, filtersetId, childId) + return err +} + +// PostFiltersetFilterset converts echo context to params. +func (w *ServerInterfaceWrapper) PostFiltersetFilterset(ctx echo.Context) error { + var err error + // ------------- Path parameter "filterset_id" ------------- + var filtersetId string + + err = runtime.BindStyledParameterWithOptions("simple", "filterset_id", ctx.Param("filterset_id"), &filtersetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter filterset_id: %s", err)) + } + + // ------------- Path parameter "child_id" ------------- + var childId string + + err = runtime.BindStyledParameterWithOptions("simple", "child_id", ctx.Param("child_id"), &childId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter child_id: %s", err)) + } + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.PostFiltersetFilterset(ctx, filtersetId, childId) + return err +} + +// GetFiltersetNodes converts echo context to params. +func (w *ServerInterfaceWrapper) GetFiltersetNodes(ctx echo.Context) error { + var err error + // ------------- Path parameter "filterset_id" ------------- + var filtersetId string + + err = runtime.BindStyledParameterWithOptions("simple", "filterset_id", ctx.Param("filterset_id"), &filtersetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter filterset_id: %s", err)) + } + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Parameter object where we will unmarshal all parameters from the context + var params GetFiltersetNodesParams + // ------------- Optional query parameter "props" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) + } + + // ------------- Optional query parameter "limit" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) + } + + // ------------- Optional query parameter "offset" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) + } + + // ------------- Optional query parameter "meta" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) + } + + // ------------- Optional query parameter "stats" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) + } + + // ------------- Optional query parameter "orderby" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) + } + + // ------------- Optional query parameter "filter" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "filter", ctx.QueryParams(), ¶ms.Filter, runtime.BindQueryParameterOptions{Type: "array", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter filter: %s", err)) + } + + // ------------- Optional query parameter "groupby" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) + } + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.GetFiltersetNodes(ctx, filtersetId, params) + return err +} + +// GetFiltersetServices converts echo context to params. +func (w *ServerInterfaceWrapper) GetFiltersetServices(ctx echo.Context) error { + var err error + // ------------- Path parameter "filterset_id" ------------- + var filtersetId string + + err = runtime.BindStyledParameterWithOptions("simple", "filterset_id", ctx.Param("filterset_id"), &filtersetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter filterset_id: %s", err)) + } + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Parameter object where we will unmarshal all parameters from the context + var params GetFiltersetServicesParams + // ------------- Optional query parameter "props" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) + } + + // ------------- Optional query parameter "limit" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) + } + + // ------------- Optional query parameter "offset" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) + } + + // ------------- Optional query parameter "meta" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) + } + + // ------------- Optional query parameter "stats" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) + } + + // ------------- Optional query parameter "orderby" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) + } + + // ------------- Optional query parameter "filter" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "filter", ctx.QueryParams(), ¶ms.Filter, runtime.BindQueryParameterOptions{Type: "array", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter filter: %s", err)) + } + + // ------------- Optional query parameter "groupby" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) + } + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.GetFiltersetServices(ctx, filtersetId, params) + return err +} + +// GetFiltersetUsage converts echo context to params. +func (w *ServerInterfaceWrapper) GetFiltersetUsage(ctx echo.Context) error { + var err error + // ------------- Path parameter "filterset_id" ------------- + var filtersetId string + + err = runtime.BindStyledParameterWithOptions("simple", "filterset_id", ctx.Param("filterset_id"), &filtersetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter filterset_id: %s", err)) + } + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.GetFiltersetUsage(ctx, filtersetId) + return err +} + +// DeleteFiltersetsFilters converts echo context to params. +func (w *ServerInterfaceWrapper) DeleteFiltersetsFilters(ctx echo.Context) error { + var err error + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.DeleteFiltersetsFilters(ctx) + return err +} + +// PostFiltersetsFilters converts echo context to params. +func (w *ServerInterfaceWrapper) PostFiltersetsFilters(ctx echo.Context) error { + var err error + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.PostFiltersetsFilters(ctx) + return err +} + +// DeleteFiltersetsFiltersets converts echo context to params. +func (w *ServerInterfaceWrapper) DeleteFiltersetsFiltersets(ctx echo.Context) error { + var err error + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.DeleteFiltersetsFiltersets(ctx) + return err +} + +// PostFiltersetsFiltersets converts echo context to params. +func (w *ServerInterfaceWrapper) PostFiltersetsFiltersets(ctx echo.Context) error { + var err error + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.PostFiltersetsFiltersets(ctx) + return err +} + +// GetFormOutputResults converts echo context to params. +func (w *ServerInterfaceWrapper) GetFormOutputResults(ctx echo.Context) error { + var err error + // ------------- Path parameter "results_id" ------------- + var resultsId int + + err = runtime.BindStyledParameterWithOptions("simple", "results_id", ctx.Param("results_id"), &resultsId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "integer", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter results_id: %s", err)) + } + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.GetFormOutputResults(ctx, resultsId) + return err +} + +// PutFormOutputResults converts echo context to params. +func (w *ServerInterfaceWrapper) PutFormOutputResults(ctx echo.Context) error { + var err error + // ------------- Path parameter "results_id" ------------- + var resultsId int + + err = runtime.BindStyledParameterWithOptions("simple", "results_id", ctx.Param("results_id"), &resultsId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "integer", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter results_id: %s", err)) + } + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.PutFormOutputResults(ctx, resultsId) + return err +} + +// DeleteForms converts echo context to params. +func (w *ServerInterfaceWrapper) DeleteForms(ctx echo.Context) error { + var err error + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.DeleteForms(ctx) + return err +} + +// GetForms converts echo context to params. +func (w *ServerInterfaceWrapper) GetForms(ctx echo.Context) error { + var err error + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Parameter object where we will unmarshal all parameters from the context + var params GetFormsParams + // ------------- Optional query parameter "props" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) + } + + // ------------- Optional query parameter "limit" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) + } + + // ------------- Optional query parameter "offset" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) + } + + // ------------- Optional query parameter "meta" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) + } + + // ------------- Optional query parameter "stats" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) + } + + // ------------- Optional query parameter "orderby" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) + } + + // ------------- Optional query parameter "groupby" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) + } + + // ------------- Optional query parameter "filter" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "filter", ctx.QueryParams(), ¶ms.Filter, runtime.BindQueryParameterOptions{Type: "array", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter filter: %s", err)) + } + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.GetForms(ctx, params) + return err +} + +// PostForms converts echo context to params. +func (w *ServerInterfaceWrapper) PostForms(ctx echo.Context) error { + var err error + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.PostForms(ctx) + return err +} + +// DeleteForm converts echo context to params. +func (w *ServerInterfaceWrapper) DeleteForm(ctx echo.Context) error { + var err error + // ------------- Path parameter "form_id" ------------- + var formId int + + err = runtime.BindStyledParameterWithOptions("simple", "form_id", ctx.Param("form_id"), &formId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "integer", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter form_id: %s", err)) + } + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.DeleteForm(ctx, formId) + return err +} + +// GetForm converts echo context to params. +func (w *ServerInterfaceWrapper) GetForm(ctx echo.Context) error { + var err error + // ------------- Path parameter "form_id" ------------- + var formId int + + err = runtime.BindStyledParameterWithOptions("simple", "form_id", ctx.Param("form_id"), &formId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "integer", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter form_id: %s", err)) + } + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Parameter object where we will unmarshal all parameters from the context + var params GetFormParams + // ------------- Optional query parameter "props" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) + } + + // ------------- Optional query parameter "limit" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) + } + + // ------------- Optional query parameter "offset" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) + } + + // ------------- Optional query parameter "meta" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) + } + + // ------------- Optional query parameter "stats" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) + } + + // ------------- Optional query parameter "orderby" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) + } + + // ------------- Optional query parameter "groupby" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) + } + + // ------------- Optional query parameter "filter" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "filter", ctx.QueryParams(), ¶ms.Filter, runtime.BindQueryParameterOptions{Type: "array", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter filter: %s", err)) + } + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.GetForm(ctx, formId, params) + return err +} + +// PostForm converts echo context to params. +func (w *ServerInterfaceWrapper) PostForm(ctx echo.Context) error { + var err error + // ------------- Path parameter "form_id" ------------- + var formId int + + err = runtime.BindStyledParameterWithOptions("simple", "form_id", ctx.Param("form_id"), &formId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "integer", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter form_id: %s", err)) + } + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.PostForm(ctx, formId) + return err +} + +// PutForm converts echo context to params. +func (w *ServerInterfaceWrapper) PutForm(ctx echo.Context) error { + var err error + // ------------- Path parameter "form_id" ------------- + var formId int + + err = runtime.BindStyledParameterWithOptions("simple", "form_id", ctx.Param("form_id"), &formId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "integer", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter form_id: %s", err)) + } + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.PutForm(ctx, formId) + return err +} + +// GetFormAmIResponsible converts echo context to params. +func (w *ServerInterfaceWrapper) GetFormAmIResponsible(ctx echo.Context) error { + var err error + // ------------- Path parameter "form_id" ------------- + var formId int + + err = runtime.BindStyledParameterWithOptions("simple", "form_id", ctx.Param("form_id"), &formId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "integer", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter form_id: %s", err)) + } + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.GetFormAmIResponsible(ctx, formId) + return err +} + +// GetFormDiff converts echo context to params. +func (w *ServerInterfaceWrapper) GetFormDiff(ctx echo.Context) error { + var err error + // ------------- Path parameter "form_id" ------------- + var formId int + + err = runtime.BindStyledParameterWithOptions("simple", "form_id", ctx.Param("form_id"), &formId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "integer", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter form_id: %s", err)) + } + + // ------------- Path parameter "cid" ------------- + var cid string + + err = runtime.BindStyledParameterWithOptions("simple", "cid", ctx.Param("cid"), &cid, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter cid: %s", err)) + } + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Parameter object where we will unmarshal all parameters from the context + var params GetFormDiffParams + // ------------- Optional query parameter "other" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "other", ctx.QueryParams(), ¶ms.Other, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter other: %s", err)) + } + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.GetFormDiff(ctx, formId, cid, params) + return err +} + +// GetFormPublications converts echo context to params. +func (w *ServerInterfaceWrapper) GetFormPublications(ctx echo.Context) error { + var err error + // ------------- Path parameter "form_id" ------------- + var formId int + + err = runtime.BindStyledParameterWithOptions("simple", "form_id", ctx.Param("form_id"), &formId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "integer", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter form_id: %s", err)) + } + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Parameter object where we will unmarshal all parameters from the context + var params GetFormPublicationsParams + // ------------- Optional query parameter "props" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) + } + + // ------------- Optional query parameter "limit" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) + } + + // ------------- Optional query parameter "offset" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) + } + + // ------------- Optional query parameter "meta" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) + } + + // ------------- Optional query parameter "stats" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) + } + + // ------------- Optional query parameter "orderby" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) + } + + // ------------- Optional query parameter "groupby" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) + } + + // ------------- Optional query parameter "filter" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "filter", ctx.QueryParams(), ¶ms.Filter, runtime.BindQueryParameterOptions{Type: "array", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter filter: %s", err)) + } + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.GetFormPublications(ctx, formId, params) + return err +} + +// DeleteFormPublication converts echo context to params. +func (w *ServerInterfaceWrapper) DeleteFormPublication(ctx echo.Context) error { + var err error + // ------------- Path parameter "form_id" ------------- + var formId int + + err = runtime.BindStyledParameterWithOptions("simple", "form_id", ctx.Param("form_id"), &formId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "integer", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter form_id: %s", err)) + } + + // ------------- Path parameter "group_id" ------------- + var groupId string + + err = runtime.BindStyledParameterWithOptions("simple", "group_id", ctx.Param("group_id"), &groupId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter group_id: %s", err)) + } + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.DeleteFormPublication(ctx, formId, groupId) + return err +} + +// PostFormPublication converts echo context to params. +func (w *ServerInterfaceWrapper) PostFormPublication(ctx echo.Context) error { + var err error + // ------------- Path parameter "form_id" ------------- + var formId int + + err = runtime.BindStyledParameterWithOptions("simple", "form_id", ctx.Param("form_id"), &formId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "integer", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter form_id: %s", err)) + } + + // ------------- Path parameter "group_id" ------------- + var groupId string + + err = runtime.BindStyledParameterWithOptions("simple", "group_id", ctx.Param("group_id"), &groupId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter group_id: %s", err)) + } + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.PostFormPublication(ctx, formId, groupId) + return err +} + +// GetFormResponsibles converts echo context to params. +func (w *ServerInterfaceWrapper) GetFormResponsibles(ctx echo.Context) error { + var err error + // ------------- Path parameter "form_id" ------------- + var formId int + + err = runtime.BindStyledParameterWithOptions("simple", "form_id", ctx.Param("form_id"), &formId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "integer", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter form_id: %s", err)) + } + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Parameter object where we will unmarshal all parameters from the context + var params GetFormResponsiblesParams + // ------------- Optional query parameter "props" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) + } + + // ------------- Optional query parameter "limit" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) + } + + // ------------- Optional query parameter "offset" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) + } + + // ------------- Optional query parameter "meta" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) + } + + // ------------- Optional query parameter "stats" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) + } + + // ------------- Optional query parameter "orderby" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) + } + + // ------------- Optional query parameter "groupby" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) + } + + // ------------- Optional query parameter "filter" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "filter", ctx.QueryParams(), ¶ms.Filter, runtime.BindQueryParameterOptions{Type: "array", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter filter: %s", err)) + } + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.GetFormResponsibles(ctx, formId, params) + return err +} + +// DeleteFormResponsible converts echo context to params. +func (w *ServerInterfaceWrapper) DeleteFormResponsible(ctx echo.Context) error { + var err error + // ------------- Path parameter "form_id" ------------- + var formId int + + err = runtime.BindStyledParameterWithOptions("simple", "form_id", ctx.Param("form_id"), &formId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "integer", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter form_id: %s", err)) + } + + // ------------- Path parameter "group_id" ------------- + var groupId string + + err = runtime.BindStyledParameterWithOptions("simple", "group_id", ctx.Param("group_id"), &groupId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter group_id: %s", err)) + } + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.DeleteFormResponsible(ctx, formId, groupId) + return err +} + +// PostFormResponsible converts echo context to params. +func (w *ServerInterfaceWrapper) PostFormResponsible(ctx echo.Context) error { + var err error + // ------------- Path parameter "form_id" ------------- + var formId int + + err = runtime.BindStyledParameterWithOptions("simple", "form_id", ctx.Param("form_id"), &formId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "integer", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter form_id: %s", err)) + } + + // ------------- Path parameter "group_id" ------------- + var groupId string + + err = runtime.BindStyledParameterWithOptions("simple", "group_id", ctx.Param("group_id"), &groupId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter group_id: %s", err)) + } + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.PostFormResponsible(ctx, formId, groupId) + return err +} + +// GetFormRevisions converts echo context to params. +func (w *ServerInterfaceWrapper) GetFormRevisions(ctx echo.Context) error { + var err error + // ------------- Path parameter "form_id" ------------- + var formId int + + err = runtime.BindStyledParameterWithOptions("simple", "form_id", ctx.Param("form_id"), &formId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "integer", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter form_id: %s", err)) + } + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.GetFormRevisions(ctx, formId) + return err +} + +// GetFormRevision converts echo context to params. +func (w *ServerInterfaceWrapper) GetFormRevision(ctx echo.Context) error { + var err error + // ------------- Path parameter "form_id" ------------- + var formId int + + err = runtime.BindStyledParameterWithOptions("simple", "form_id", ctx.Param("form_id"), &formId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "integer", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter form_id: %s", err)) + } + + // ------------- Path parameter "cid" ------------- + var cid string + + err = runtime.BindStyledParameterWithOptions("simple", "cid", ctx.Param("cid"), &cid, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter cid: %s", err)) + } + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.GetFormRevision(ctx, formId, cid) + return err +} + +// PostFormRollback converts echo context to params. +func (w *ServerInterfaceWrapper) PostFormRollback(ctx echo.Context) error { + var err error + // ------------- Path parameter "form_id" ------------- + var formId int + + err = runtime.BindStyledParameterWithOptions("simple", "form_id", ctx.Param("form_id"), &formId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "integer", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter form_id: %s", err)) + } + + // ------------- Path parameter "cid" ------------- + var cid string + + err = runtime.BindStyledParameterWithOptions("simple", "cid", ctx.Param("cid"), &cid, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter cid: %s", err)) + } + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.PostFormRollback(ctx, formId, cid) + return err +} + +// DeleteFormsPublications converts echo context to params. +func (w *ServerInterfaceWrapper) DeleteFormsPublications(ctx echo.Context) error { + var err error + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.DeleteFormsPublications(ctx) + return err +} + +// PostFormsPublications converts echo context to params. +func (w *ServerInterfaceWrapper) PostFormsPublications(ctx echo.Context) error { + var err error + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.PostFormsPublications(ctx) + return err +} + +// DeleteFormsResponsibles converts echo context to params. +func (w *ServerInterfaceWrapper) DeleteFormsResponsibles(ctx echo.Context) error { + var err error + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.DeleteFormsResponsibles(ctx) + return err +} + +// PostFormsResponsibles converts echo context to params. +func (w *ServerInterfaceWrapper) PostFormsResponsibles(ctx echo.Context) error { + var err error + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.PostFormsResponsibles(ctx) + return err +} + +// GetFormsRevisions converts echo context to params. +func (w *ServerInterfaceWrapper) GetFormsRevisions(ctx echo.Context) error { + var err error + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Parameter object where we will unmarshal all parameters from the context + var params GetFormsRevisionsParams + // ------------- Optional query parameter "props" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) + } + + // ------------- Optional query parameter "limit" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) + } + + // ------------- Optional query parameter "offset" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) + } + + // ------------- Optional query parameter "meta" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) + } + + // ------------- Optional query parameter "stats" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) + } + + // ------------- Optional query parameter "orderby" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) + } + + // ------------- Optional query parameter "groupby" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) + } + + // ------------- Optional query parameter "filter" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "filter", ctx.QueryParams(), ¶ms.Filter, runtime.BindQueryParameterOptions{Type: "array", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter filter: %s", err)) + } + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.GetFormsRevisions(ctx, params) + return err +} + +// GetFormsRevision converts echo context to params. +func (w *ServerInterfaceWrapper) GetFormsRevision(ctx echo.Context) error { + var err error + // ------------- Path parameter "revision_id" ------------- + var revisionId string + + err = runtime.BindStyledParameterWithOptions("simple", "revision_id", ctx.Param("revision_id"), &revisionId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter revision_id: %s", err)) + } + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Parameter object where we will unmarshal all parameters from the context + var params GetFormsRevisionParams + // ------------- Optional query parameter "props" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) + } + + // ------------- Optional query parameter "limit" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) + } + + // ------------- Optional query parameter "offset" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) + } + + // ------------- Optional query parameter "meta" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) + } + + // ------------- Optional query parameter "stats" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) + } + + // ------------- Optional query parameter "orderby" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) + } + + // ------------- Optional query parameter "groupby" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) + } + + // ------------- Optional query parameter "filter" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "filter", ctx.QueryParams(), ¶ms.Filter, runtime.BindQueryParameterOptions{Type: "array", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter filter: %s", err)) + } + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.GetFormsRevision(ctx, revisionId, params) + return err +} + +// GetFormsStore converts echo context to params. +func (w *ServerInterfaceWrapper) GetFormsStore(ctx echo.Context) error { + var err error + + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context - var params GetFiltersetNodesParams + var params GetFormsStoreParams // ------------- Optional query parameter "props" ------------- - err = runtime.BindQueryParameter("form", true, false, "props", ctx.QueryParams(), ¶ms.Props) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) } // ------------- Optional query parameter "limit" ------------- - err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit) + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) } // ------------- Optional query parameter "offset" ------------- - err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset) + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) } // ------------- Optional query parameter "meta" ------------- - err = runtime.BindQueryParameter("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta) + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) } // ------------- Optional query parameter "stats" ------------- - err = runtime.BindQueryParameter("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats) + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) } // ------------- Optional query parameter "orderby" ------------- - err = runtime.BindQueryParameter("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) } // ------------- Optional query parameter "groupby" ------------- - err = runtime.BindQueryParameter("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) } + // ------------- Optional query parameter "filter" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "filter", ctx.QueryParams(), ¶ms.Filter, runtime.BindQueryParameterOptions{Type: "array", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter filter: %s", err)) + } + // Invoke the callback with all the unmarshaled arguments - err = w.Handler.GetFiltersetNodes(ctx, filtersetId, params) + err = w.Handler.GetFormsStore(ctx, params) return err } -// GetFiltersetServices converts echo context to params. -func (w *ServerInterfaceWrapper) GetFiltersetServices(ctx echo.Context) error { +// GetFormStore converts echo context to params. +func (w *ServerInterfaceWrapper) GetFormStore(ctx echo.Context) error { var err error - // ------------- Path parameter "filterset_id" ------------- - var filtersetId string + // ------------- Path parameter "store_id" ------------- + var storeId int - err = runtime.BindStyledParameterWithOptions("simple", "filterset_id", ctx.Param("filterset_id"), &filtersetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "store_id", ctx.Param("store_id"), &storeId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "integer", Format: ""}) if err != nil { - return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter filterset_id: %s", err)) + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter store_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context - var params GetFiltersetServicesParams + var params GetFormStoreParams // ------------- Optional query parameter "props" ------------- - err = runtime.BindQueryParameter("form", true, false, "props", ctx.QueryParams(), ¶ms.Props) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) } // ------------- Optional query parameter "limit" ------------- - err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit) + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) } // ------------- Optional query parameter "offset" ------------- - err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset) + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) } // ------------- Optional query parameter "meta" ------------- - err = runtime.BindQueryParameter("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta) + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) } // ------------- Optional query parameter "stats" ------------- - err = runtime.BindQueryParameter("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats) + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) } // ------------- Optional query parameter "orderby" ------------- - err = runtime.BindQueryParameter("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) } // ------------- Optional query parameter "groupby" ------------- - err = runtime.BindQueryParameter("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) } - // Invoke the callback with all the unmarshaled arguments - err = w.Handler.GetFiltersetServices(ctx, filtersetId, params) - return err -} - -// GetFiltersetUsage converts echo context to params. -func (w *ServerInterfaceWrapper) GetFiltersetUsage(ctx echo.Context) error { - var err error - // ------------- Path parameter "filterset_id" ------------- - var filtersetId string + // ------------- Optional query parameter "filter" ------------- - err = runtime.BindStyledParameterWithOptions("simple", "filterset_id", ctx.Param("filterset_id"), &filtersetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindQueryParameterWithOptions("form", true, false, "filter", ctx.QueryParams(), ¶ms.Filter, runtime.BindQueryParameterOptions{Type: "array", Format: ""}) if err != nil { - return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter filterset_id: %s", err)) + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter filter: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) - - ctx.Set(BearerAuthScopes, []string{}) - - // Invoke the callback with all the unmarshaled arguments - err = w.Handler.GetFiltersetUsage(ctx, filtersetId) - return err -} - -// DeleteFiltersetsFilters converts echo context to params. -func (w *ServerInterfaceWrapper) DeleteFiltersetsFilters(ctx echo.Context) error { - var err error - - ctx.Set(BasicAuthScopes, []string{}) - - ctx.Set(BearerAuthScopes, []string{}) - - // Invoke the callback with all the unmarshaled arguments - err = w.Handler.DeleteFiltersetsFilters(ctx) - return err -} - -// PostFiltersetsFilters converts echo context to params. -func (w *ServerInterfaceWrapper) PostFiltersetsFilters(ctx echo.Context) error { - var err error - - ctx.Set(BasicAuthScopes, []string{}) - - ctx.Set(BearerAuthScopes, []string{}) - // Invoke the callback with all the unmarshaled arguments - err = w.Handler.PostFiltersetsFilters(ctx) + err = w.Handler.GetFormStore(ctx, storeId, params) return err } -// DeleteFiltersetsFiltersets converts echo context to params. -func (w *ServerInterfaceWrapper) DeleteFiltersetsFiltersets(ctx echo.Context) error { +// GetFormStoreDump converts echo context to params. +func (w *ServerInterfaceWrapper) GetFormStoreDump(ctx echo.Context) error { var err error + // ------------- Path parameter "store_id" ------------- + var storeId int - ctx.Set(BasicAuthScopes, []string{}) - - ctx.Set(BearerAuthScopes, []string{}) - - // Invoke the callback with all the unmarshaled arguments - err = w.Handler.DeleteFiltersetsFiltersets(ctx) - return err -} - -// PostFiltersetsFiltersets converts echo context to params. -func (w *ServerInterfaceWrapper) PostFiltersetsFiltersets(ctx echo.Context) error { - var err error + err = runtime.BindStyledParameterWithOptions("simple", "store_id", ctx.Param("store_id"), &storeId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "integer", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter store_id: %s", err)) + } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Invoke the callback with all the unmarshaled arguments - err = w.Handler.PostFiltersetsFiltersets(ctx) + err = w.Handler.GetFormStoreDump(ctx, storeId) return err } @@ -2856,57 +7306,57 @@ func (w *ServerInterfaceWrapper) PostFiltersetsFiltersets(ctx echo.Context) erro func (w *ServerInterfaceWrapper) GetFrontendHiddenMenuEntries(ctx echo.Context) error { var err error - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context var params GetFrontendHiddenMenuEntriesParams // ------------- Optional query parameter "props" ------------- - err = runtime.BindQueryParameter("form", true, false, "props", ctx.QueryParams(), ¶ms.Props) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) } // ------------- Optional query parameter "limit" ------------- - err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit) + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) } // ------------- Optional query parameter "offset" ------------- - err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset) + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) } // ------------- Optional query parameter "meta" ------------- - err = runtime.BindQueryParameter("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta) + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) } // ------------- Optional query parameter "stats" ------------- - err = runtime.BindQueryParameter("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats) + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) } // ------------- Optional query parameter "orderby" ------------- - err = runtime.BindQueryParameter("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) } // ------------- Optional query parameter "groupby" ------------- - err = runtime.BindQueryParameter("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) } @@ -2920,9 +7370,9 @@ func (w *ServerInterfaceWrapper) GetFrontendHiddenMenuEntries(ctx echo.Context) func (w *ServerInterfaceWrapper) DeleteGroups(ctx echo.Context) error { var err error - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Invoke the callback with all the unmarshaled arguments err = w.Handler.DeleteGroups(ctx) @@ -2933,61 +7383,68 @@ func (w *ServerInterfaceWrapper) DeleteGroups(ctx echo.Context) error { func (w *ServerInterfaceWrapper) GetGroups(ctx echo.Context) error { var err error - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context var params GetGroupsParams // ------------- Optional query parameter "props" ------------- - err = runtime.BindQueryParameter("form", true, false, "props", ctx.QueryParams(), ¶ms.Props) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) } // ------------- Optional query parameter "limit" ------------- - err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit) + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) } // ------------- Optional query parameter "offset" ------------- - err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset) + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) } // ------------- Optional query parameter "meta" ------------- - err = runtime.BindQueryParameter("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta) + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) } // ------------- Optional query parameter "stats" ------------- - err = runtime.BindQueryParameter("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats) + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) } // ------------- Optional query parameter "orderby" ------------- - err = runtime.BindQueryParameter("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) } // ------------- Optional query parameter "groupby" ------------- - err = runtime.BindQueryParameter("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) } + // ------------- Optional query parameter "filter" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "filter", ctx.QueryParams(), ¶ms.Filter, runtime.BindQueryParameterOptions{Type: "array", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter filter: %s", err)) + } + // Invoke the callback with all the unmarshaled arguments err = w.Handler.GetGroups(ctx, params) return err @@ -2997,9 +7454,9 @@ func (w *ServerInterfaceWrapper) GetGroups(ctx echo.Context) error { func (w *ServerInterfaceWrapper) PostGroups(ctx echo.Context) error { var err error - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Invoke the callback with all the unmarshaled arguments err = w.Handler.PostGroups(ctx) @@ -3012,14 +7469,14 @@ func (w *ServerInterfaceWrapper) DeleteGroup(ctx echo.Context) error { // ------------- Path parameter "group_id" ------------- var groupId string - err = runtime.BindStyledParameterWithOptions("simple", "group_id", ctx.Param("group_id"), &groupId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "group_id", ctx.Param("group_id"), &groupId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter group_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Invoke the callback with all the unmarshaled arguments err = w.Handler.DeleteGroup(ctx, groupId) @@ -3032,62 +7489,62 @@ func (w *ServerInterfaceWrapper) GetGroup(ctx echo.Context) error { // ------------- Path parameter "group_id" ------------- var groupId string - err = runtime.BindStyledParameterWithOptions("simple", "group_id", ctx.Param("group_id"), &groupId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "group_id", ctx.Param("group_id"), &groupId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter group_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context var params GetGroupParams // ------------- Optional query parameter "props" ------------- - err = runtime.BindQueryParameter("form", true, false, "props", ctx.QueryParams(), ¶ms.Props) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) } // ------------- Optional query parameter "limit" ------------- - err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit) + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) } // ------------- Optional query parameter "offset" ------------- - err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset) + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) } // ------------- Optional query parameter "meta" ------------- - err = runtime.BindQueryParameter("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta) + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) } // ------------- Optional query parameter "stats" ------------- - err = runtime.BindQueryParameter("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats) + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) } // ------------- Optional query parameter "orderby" ------------- - err = runtime.BindQueryParameter("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) } // ------------- Optional query parameter "groupby" ------------- - err = runtime.BindQueryParameter("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) } @@ -3103,14 +7560,14 @@ func (w *ServerInterfaceWrapper) PostGroup(ctx echo.Context) error { // ------------- Path parameter "group_id" ------------- var groupId string - err = runtime.BindStyledParameterWithOptions("simple", "group_id", ctx.Param("group_id"), &groupId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "group_id", ctx.Param("group_id"), &groupId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter group_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Invoke the callback with all the unmarshaled arguments err = w.Handler.PostGroup(ctx, groupId) @@ -3123,62 +7580,62 @@ func (w *ServerInterfaceWrapper) GetGroupApps(ctx echo.Context) error { // ------------- Path parameter "group_id" ------------- var groupId string - err = runtime.BindStyledParameterWithOptions("simple", "group_id", ctx.Param("group_id"), &groupId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "group_id", ctx.Param("group_id"), &groupId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter group_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context var params GetGroupAppsParams // ------------- Optional query parameter "props" ------------- - err = runtime.BindQueryParameter("form", true, false, "props", ctx.QueryParams(), ¶ms.Props) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) } // ------------- Optional query parameter "limit" ------------- - err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit) + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) } // ------------- Optional query parameter "offset" ------------- - err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset) + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) } // ------------- Optional query parameter "meta" ------------- - err = runtime.BindQueryParameter("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta) + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) } // ------------- Optional query parameter "stats" ------------- - err = runtime.BindQueryParameter("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats) + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) } // ------------- Optional query parameter "orderby" ------------- - err = runtime.BindQueryParameter("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) } // ------------- Optional query parameter "groupby" ------------- - err = runtime.BindQueryParameter("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) } @@ -3194,14 +7651,14 @@ func (w *ServerInterfaceWrapper) DeleteGroupHiddenMenuEntries(ctx echo.Context) // ------------- Path parameter "group_id" ------------- var groupId string - err = runtime.BindStyledParameterWithOptions("simple", "group_id", ctx.Param("group_id"), &groupId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "group_id", ctx.Param("group_id"), &groupId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter group_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Invoke the callback with all the unmarshaled arguments err = w.Handler.DeleteGroupHiddenMenuEntries(ctx, groupId) @@ -3214,62 +7671,62 @@ func (w *ServerInterfaceWrapper) GetGroupHiddenMenuEntries(ctx echo.Context) err // ------------- Path parameter "group_id" ------------- var groupId string - err = runtime.BindStyledParameterWithOptions("simple", "group_id", ctx.Param("group_id"), &groupId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "group_id", ctx.Param("group_id"), &groupId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter group_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context var params GetGroupHiddenMenuEntriesParams // ------------- Optional query parameter "props" ------------- - err = runtime.BindQueryParameter("form", true, false, "props", ctx.QueryParams(), ¶ms.Props) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) } // ------------- Optional query parameter "limit" ------------- - err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit) + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) } // ------------- Optional query parameter "offset" ------------- - err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset) + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) } // ------------- Optional query parameter "meta" ------------- - err = runtime.BindQueryParameter("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta) + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) } // ------------- Optional query parameter "stats" ------------- - err = runtime.BindQueryParameter("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats) + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) } // ------------- Optional query parameter "orderby" ------------- - err = runtime.BindQueryParameter("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) } // ------------- Optional query parameter "groupby" ------------- - err = runtime.BindQueryParameter("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) } @@ -3285,14 +7742,14 @@ func (w *ServerInterfaceWrapper) PostGroupHiddenMenuEntries(ctx echo.Context) er // ------------- Path parameter "group_id" ------------- var groupId string - err = runtime.BindStyledParameterWithOptions("simple", "group_id", ctx.Param("group_id"), &groupId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "group_id", ctx.Param("group_id"), &groupId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter group_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Invoke the callback with all the unmarshaled arguments err = w.Handler.PostGroupHiddenMenuEntries(ctx, groupId) @@ -3305,62 +7762,62 @@ func (w *ServerInterfaceWrapper) GetGroupModulesets(ctx echo.Context) error { // ------------- Path parameter "group_id" ------------- var groupId string - err = runtime.BindStyledParameterWithOptions("simple", "group_id", ctx.Param("group_id"), &groupId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "group_id", ctx.Param("group_id"), &groupId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter group_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context var params GetGroupModulesetsParams // ------------- Optional query parameter "props" ------------- - err = runtime.BindQueryParameter("form", true, false, "props", ctx.QueryParams(), ¶ms.Props) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) } // ------------- Optional query parameter "limit" ------------- - err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit) + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) } // ------------- Optional query parameter "offset" ------------- - err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset) + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) } // ------------- Optional query parameter "meta" ------------- - err = runtime.BindQueryParameter("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta) + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) } // ------------- Optional query parameter "stats" ------------- - err = runtime.BindQueryParameter("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats) + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) } // ------------- Optional query parameter "orderby" ------------- - err = runtime.BindQueryParameter("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) } // ------------- Optional query parameter "groupby" ------------- - err = runtime.BindQueryParameter("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) } @@ -3376,62 +7833,62 @@ func (w *ServerInterfaceWrapper) GetGroupNodes(ctx echo.Context) error { // ------------- Path parameter "group_id" ------------- var groupId string - err = runtime.BindStyledParameterWithOptions("simple", "group_id", ctx.Param("group_id"), &groupId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "group_id", ctx.Param("group_id"), &groupId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter group_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context var params GetGroupNodesParams // ------------- Optional query parameter "props" ------------- - err = runtime.BindQueryParameter("form", true, false, "props", ctx.QueryParams(), ¶ms.Props) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) } // ------------- Optional query parameter "limit" ------------- - err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit) + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) } // ------------- Optional query parameter "offset" ------------- - err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset) + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) } // ------------- Optional query parameter "meta" ------------- - err = runtime.BindQueryParameter("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta) + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) } // ------------- Optional query parameter "stats" ------------- - err = runtime.BindQueryParameter("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats) + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) } // ------------- Optional query parameter "orderby" ------------- - err = runtime.BindQueryParameter("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) } // ------------- Optional query parameter "groupby" ------------- - err = runtime.BindQueryParameter("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) } @@ -3447,62 +7904,62 @@ func (w *ServerInterfaceWrapper) GetGroupRulesets(ctx echo.Context) error { // ------------- Path parameter "group_id" ------------- var groupId string - err = runtime.BindStyledParameterWithOptions("simple", "group_id", ctx.Param("group_id"), &groupId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "group_id", ctx.Param("group_id"), &groupId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter group_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context var params GetGroupRulesetsParams // ------------- Optional query parameter "props" ------------- - err = runtime.BindQueryParameter("form", true, false, "props", ctx.QueryParams(), ¶ms.Props) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) } // ------------- Optional query parameter "limit" ------------- - err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit) + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) } // ------------- Optional query parameter "offset" ------------- - err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset) + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) } // ------------- Optional query parameter "meta" ------------- - err = runtime.BindQueryParameter("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta) + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) } // ------------- Optional query parameter "stats" ------------- - err = runtime.BindQueryParameter("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats) + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) } // ------------- Optional query parameter "orderby" ------------- - err = runtime.BindQueryParameter("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) } // ------------- Optional query parameter "groupby" ------------- - err = runtime.BindQueryParameter("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) } @@ -3518,62 +7975,62 @@ func (w *ServerInterfaceWrapper) GetGroupServices(ctx echo.Context) error { // ------------- Path parameter "group_id" ------------- var groupId string - err = runtime.BindStyledParameterWithOptions("simple", "group_id", ctx.Param("group_id"), &groupId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "group_id", ctx.Param("group_id"), &groupId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter group_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context var params GetGroupServicesParams // ------------- Optional query parameter "props" ------------- - err = runtime.BindQueryParameter("form", true, false, "props", ctx.QueryParams(), ¶ms.Props) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) } // ------------- Optional query parameter "limit" ------------- - err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit) + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) } // ------------- Optional query parameter "offset" ------------- - err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset) + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) } // ------------- Optional query parameter "meta" ------------- - err = runtime.BindQueryParameter("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta) + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) } // ------------- Optional query parameter "stats" ------------- - err = runtime.BindQueryParameter("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats) + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) } // ------------- Optional query parameter "orderby" ------------- - err = runtime.BindQueryParameter("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) } // ------------- Optional query parameter "groupby" ------------- - err = runtime.BindQueryParameter("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) } @@ -3589,62 +8046,62 @@ func (w *ServerInterfaceWrapper) GetGroupUsers(ctx echo.Context) error { // ------------- Path parameter "group_id" ------------- var groupId string - err = runtime.BindStyledParameterWithOptions("simple", "group_id", ctx.Param("group_id"), &groupId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "group_id", ctx.Param("group_id"), &groupId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter group_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context var params GetGroupUsersParams // ------------- Optional query parameter "props" ------------- - err = runtime.BindQueryParameter("form", true, false, "props", ctx.QueryParams(), ¶ms.Props) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) } // ------------- Optional query parameter "limit" ------------- - err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit) + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) } // ------------- Optional query parameter "offset" ------------- - err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset) + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) } // ------------- Optional query parameter "meta" ------------- - err = runtime.BindQueryParameter("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta) + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) } // ------------- Optional query parameter "stats" ------------- - err = runtime.BindQueryParameter("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats) + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) } // ------------- Optional query parameter "orderby" ------------- - err = runtime.BindQueryParameter("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) } // ------------- Optional query parameter "groupby" ------------- - err = runtime.BindQueryParameter("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) } @@ -3658,9 +8115,9 @@ func (w *ServerInterfaceWrapper) GetGroupUsers(ctx echo.Context) error { func (w *ServerInterfaceWrapper) DeleteIps(ctx echo.Context) error { var err error - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Invoke the callback with all the unmarshaled arguments err = w.Handler.DeleteIps(ctx) @@ -3671,57 +8128,64 @@ func (w *ServerInterfaceWrapper) DeleteIps(ctx echo.Context) error { func (w *ServerInterfaceWrapper) GetIps(ctx echo.Context) error { var err error - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context var params GetIpsParams // ------------- Optional query parameter "props" ------------- - err = runtime.BindQueryParameter("form", true, false, "props", ctx.QueryParams(), ¶ms.Props) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) } // ------------- Optional query parameter "limit" ------------- - err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit) + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) } // ------------- Optional query parameter "offset" ------------- - err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset) + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) } // ------------- Optional query parameter "meta" ------------- - err = runtime.BindQueryParameter("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta) + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) } // ------------- Optional query parameter "stats" ------------- - err = runtime.BindQueryParameter("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats) + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) } // ------------- Optional query parameter "orderby" ------------- - err = runtime.BindQueryParameter("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) } + // ------------- Optional query parameter "filter" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "filter", ctx.QueryParams(), ¶ms.Filter, runtime.BindQueryParameterOptions{Type: "array", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter filter: %s", err)) + } + // ------------- Optional query parameter "groupby" ------------- - err = runtime.BindQueryParameter("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) } @@ -3737,14 +8201,14 @@ func (w *ServerInterfaceWrapper) DeleteIp(ctx echo.Context) error { // ------------- Path parameter "id" ------------- var id string - err = runtime.BindStyledParameterWithOptions("simple", "id", ctx.Param("id"), &id, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "id", ctx.Param("id"), &id, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Invoke the callback with all the unmarshaled arguments err = w.Handler.DeleteIp(ctx, id) @@ -3757,62 +8221,62 @@ func (w *ServerInterfaceWrapper) GetIp(ctx echo.Context) error { // ------------- Path parameter "id" ------------- var id string - err = runtime.BindStyledParameterWithOptions("simple", "id", ctx.Param("id"), &id, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "id", ctx.Param("id"), &id, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context var params GetIpParams // ------------- Optional query parameter "props" ------------- - err = runtime.BindQueryParameter("form", true, false, "props", ctx.QueryParams(), ¶ms.Props) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) } // ------------- Optional query parameter "limit" ------------- - err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit) + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) } // ------------- Optional query parameter "offset" ------------- - err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset) + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) } // ------------- Optional query parameter "meta" ------------- - err = runtime.BindQueryParameter("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta) + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) } // ------------- Optional query parameter "stats" ------------- - err = runtime.BindQueryParameter("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats) + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) } // ------------- Optional query parameter "orderby" ------------- - err = runtime.BindQueryParameter("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) } // ------------- Optional query parameter "groupby" ------------- - err = runtime.BindQueryParameter("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) } @@ -3826,64 +8290,64 @@ func (w *ServerInterfaceWrapper) GetIp(ctx echo.Context) error { func (w *ServerInterfaceWrapper) GetLogs(ctx echo.Context) error { var err error - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context var params GetLogsParams // ------------- Optional query parameter "fset_id" ------------- - err = runtime.BindQueryParameter("form", true, false, "fset_id", ctx.QueryParams(), ¶ms.FsetId) + err = runtime.BindQueryParameterWithOptions("form", true, false, "fset_id", ctx.QueryParams(), ¶ms.FsetId, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter fset_id: %s", err)) } // ------------- Optional query parameter "props" ------------- - err = runtime.BindQueryParameter("form", true, false, "props", ctx.QueryParams(), ¶ms.Props) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) } // ------------- Optional query parameter "limit" ------------- - err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit) + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) } // ------------- Optional query parameter "offset" ------------- - err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset) + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) } // ------------- Optional query parameter "meta" ------------- - err = runtime.BindQueryParameter("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta) + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) } // ------------- Optional query parameter "stats" ------------- - err = runtime.BindQueryParameter("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats) + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) } // ------------- Optional query parameter "orderby" ------------- - err = runtime.BindQueryParameter("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) } // ------------- Optional query parameter "groupby" ------------- - err = runtime.BindQueryParameter("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) } @@ -3897,9 +8361,9 @@ func (w *ServerInterfaceWrapper) GetLogs(ctx echo.Context) error { func (w *ServerInterfaceWrapper) PostLogs(ctx echo.Context) error { var err error - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Invoke the callback with all the unmarshaled arguments err = w.Handler.PostLogs(ctx) @@ -3912,62 +8376,62 @@ func (w *ServerInterfaceWrapper) GetLog(ctx echo.Context) error { // ------------- Path parameter "log_id" ------------- var logId string - err = runtime.BindStyledParameterWithOptions("simple", "log_id", ctx.Param("log_id"), &logId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "log_id", ctx.Param("log_id"), &logId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter log_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context var params GetLogParams // ------------- Optional query parameter "props" ------------- - err = runtime.BindQueryParameter("form", true, false, "props", ctx.QueryParams(), ¶ms.Props) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) } // ------------- Optional query parameter "limit" ------------- - err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit) + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) } // ------------- Optional query parameter "offset" ------------- - err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset) + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) } // ------------- Optional query parameter "meta" ------------- - err = runtime.BindQueryParameter("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta) + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) } // ------------- Optional query parameter "stats" ------------- - err = runtime.BindQueryParameter("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats) + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) } // ------------- Optional query parameter "orderby" ------------- - err = runtime.BindQueryParameter("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) } // ------------- Optional query parameter "groupby" ------------- - err = runtime.BindQueryParameter("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) } @@ -3977,13 +8441,117 @@ func (w *ServerInterfaceWrapper) GetLog(ctx echo.Context) error { return err } +// GetNetworks converts echo context to params. +func (w *ServerInterfaceWrapper) GetNetworks(ctx echo.Context) error { + var err error + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Parameter object where we will unmarshal all parameters from the context + var params GetNetworksParams + // ------------- Optional query parameter "props" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) + } + + // ------------- Optional query parameter "limit" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) + } + + // ------------- Optional query parameter "offset" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) + } + + // ------------- Optional query parameter "meta" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) + } + + // ------------- Optional query parameter "stats" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) + } + + // ------------- Optional query parameter "orderby" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) + } + + // ------------- Optional query parameter "filter" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "filter", ctx.QueryParams(), ¶ms.Filter, runtime.BindQueryParameterOptions{Type: "array", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter filter: %s", err)) + } + + // ------------- Optional query parameter "groupby" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) + } + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.GetNetworks(ctx, params) + return err +} + +// PostNetworks converts echo context to params. +func (w *ServerInterfaceWrapper) PostNetworks(ctx echo.Context) error { + var err error + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.PostNetworks(ctx) + return err +} + +// PostNetworkSegments converts echo context to params. +func (w *ServerInterfaceWrapper) PostNetworkSegments(ctx echo.Context) error { + var err error + // ------------- Path parameter "net_id" ------------- + var netId string + + err = runtime.BindStyledParameterWithOptions("simple", "net_id", ctx.Param("net_id"), &netId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter net_id: %s", err)) + } + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.PostNetworkSegments(ctx, netId) + return err +} + // DeleteNodes converts echo context to params. func (w *ServerInterfaceWrapper) DeleteNodes(ctx echo.Context) error { var err error - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Invoke the callback with all the unmarshaled arguments err = w.Handler.DeleteNodes(ctx) @@ -3994,57 +8562,64 @@ func (w *ServerInterfaceWrapper) DeleteNodes(ctx echo.Context) error { func (w *ServerInterfaceWrapper) GetNodes(ctx echo.Context) error { var err error - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context var params GetNodesParams // ------------- Optional query parameter "props" ------------- - err = runtime.BindQueryParameter("form", true, false, "props", ctx.QueryParams(), ¶ms.Props) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) } // ------------- Optional query parameter "limit" ------------- - err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit) + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) } // ------------- Optional query parameter "offset" ------------- - err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset) + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) } // ------------- Optional query parameter "meta" ------------- - err = runtime.BindQueryParameter("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta) + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) } // ------------- Optional query parameter "stats" ------------- - err = runtime.BindQueryParameter("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats) + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) } // ------------- Optional query parameter "orderby" ------------- - err = runtime.BindQueryParameter("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) } + // ------------- Optional query parameter "filter" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "filter", ctx.QueryParams(), ¶ms.Filter, runtime.BindQueryParameterOptions{Type: "array", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter filter: %s", err)) + } + // ------------- Optional query parameter "groupby" ------------- - err = runtime.BindQueryParameter("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) } @@ -4058,9 +8633,9 @@ func (w *ServerInterfaceWrapper) GetNodes(ctx echo.Context) error { func (w *ServerInterfaceWrapper) PostNodes(ctx echo.Context) error { var err error - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Invoke the callback with all the unmarshaled arguments err = w.Handler.PostNodes(ctx) @@ -4071,57 +8646,64 @@ func (w *ServerInterfaceWrapper) PostNodes(ctx echo.Context) error { func (w *ServerInterfaceWrapper) GetNodesHardware(ctx echo.Context) error { var err error - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context var params GetNodesHardwareParams // ------------- Optional query parameter "props" ------------- - err = runtime.BindQueryParameter("form", true, false, "props", ctx.QueryParams(), ¶ms.Props) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) } // ------------- Optional query parameter "limit" ------------- - err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit) + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) } // ------------- Optional query parameter "offset" ------------- - err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset) + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) } // ------------- Optional query parameter "meta" ------------- - err = runtime.BindQueryParameter("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta) + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) } // ------------- Optional query parameter "stats" ------------- - err = runtime.BindQueryParameter("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats) + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) } // ------------- Optional query parameter "orderby" ------------- - err = runtime.BindQueryParameter("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) } + // ------------- Optional query parameter "filter" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "filter", ctx.QueryParams(), ¶ms.Filter, runtime.BindQueryParameterOptions{Type: "array", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter filter: %s", err)) + } + // ------------- Optional query parameter "groupby" ------------- - err = runtime.BindQueryParameter("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) } @@ -4135,57 +8717,57 @@ func (w *ServerInterfaceWrapper) GetNodesHardware(ctx echo.Context) error { func (w *ServerInterfaceWrapper) GetNodesHbas(ctx echo.Context) error { var err error - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context var params GetNodesHbasParams // ------------- Optional query parameter "props" ------------- - err = runtime.BindQueryParameter("form", true, false, "props", ctx.QueryParams(), ¶ms.Props) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) } // ------------- Optional query parameter "limit" ------------- - err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit) + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) } // ------------- Optional query parameter "offset" ------------- - err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset) + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) } // ------------- Optional query parameter "meta" ------------- - err = runtime.BindQueryParameter("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta) + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) } // ------------- Optional query parameter "stats" ------------- - err = runtime.BindQueryParameter("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats) + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) } // ------------- Optional query parameter "orderby" ------------- - err = runtime.BindQueryParameter("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) } // ------------- Optional query parameter "groupby" ------------- - err = runtime.BindQueryParameter("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) } @@ -4201,14 +8783,14 @@ func (w *ServerInterfaceWrapper) DeleteNode(ctx echo.Context) error { // ------------- Path parameter "node_id" ------------- var nodeId string - err = runtime.BindStyledParameterWithOptions("simple", "node_id", ctx.Param("node_id"), &nodeId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "node_id", ctx.Param("node_id"), &nodeId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter node_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Invoke the callback with all the unmarshaled arguments err = w.Handler.DeleteNode(ctx, nodeId) @@ -4221,62 +8803,62 @@ func (w *ServerInterfaceWrapper) GetNode(ctx echo.Context) error { // ------------- Path parameter "node_id" ------------- var nodeId string - err = runtime.BindStyledParameterWithOptions("simple", "node_id", ctx.Param("node_id"), &nodeId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "node_id", ctx.Param("node_id"), &nodeId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter node_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context var params GetNodeParams // ------------- Optional query parameter "props" ------------- - err = runtime.BindQueryParameter("form", true, false, "props", ctx.QueryParams(), ¶ms.Props) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) } // ------------- Optional query parameter "limit" ------------- - err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit) + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) } // ------------- Optional query parameter "offset" ------------- - err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset) + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) } // ------------- Optional query parameter "meta" ------------- - err = runtime.BindQueryParameter("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta) + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) } // ------------- Optional query parameter "stats" ------------- - err = runtime.BindQueryParameter("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats) + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) } // ------------- Optional query parameter "orderby" ------------- - err = runtime.BindQueryParameter("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) } // ------------- Optional query parameter "groupby" ------------- - err = runtime.BindQueryParameter("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) } @@ -4292,14 +8874,14 @@ func (w *ServerInterfaceWrapper) PostNode(ctx echo.Context) error { // ------------- Path parameter "node_id" ------------- var nodeId string - err = runtime.BindStyledParameterWithOptions("simple", "node_id", ctx.Param("node_id"), &nodeId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "node_id", ctx.Param("node_id"), &nodeId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter node_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Invoke the callback with all the unmarshaled arguments err = w.Handler.PostNode(ctx, nodeId) @@ -4312,62 +8894,62 @@ func (w *ServerInterfaceWrapper) GetNodeAlerts(ctx echo.Context) error { // ------------- Path parameter "node_id" ------------- var nodeId string - err = runtime.BindStyledParameterWithOptions("simple", "node_id", ctx.Param("node_id"), &nodeId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "node_id", ctx.Param("node_id"), &nodeId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter node_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context var params GetNodeAlertsParams // ------------- Optional query parameter "props" ------------- - err = runtime.BindQueryParameter("form", true, false, "props", ctx.QueryParams(), ¶ms.Props) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) } // ------------- Optional query parameter "limit" ------------- - err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit) + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) } // ------------- Optional query parameter "offset" ------------- - err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset) + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) } // ------------- Optional query parameter "meta" ------------- - err = runtime.BindQueryParameter("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta) + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) } // ------------- Optional query parameter "stats" ------------- - err = runtime.BindQueryParameter("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats) + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) } // ------------- Optional query parameter "orderby" ------------- - err = runtime.BindQueryParameter("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) } // ------------- Optional query parameter "groupby" ------------- - err = runtime.BindQueryParameter("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) } @@ -4383,14 +8965,14 @@ func (w *ServerInterfaceWrapper) GetNodeAmIResponsible(ctx echo.Context) error { // ------------- Path parameter "node_id" ------------- var nodeId string - err = runtime.BindStyledParameterWithOptions("simple", "node_id", ctx.Param("node_id"), &nodeId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "node_id", ctx.Param("node_id"), &nodeId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter node_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Invoke the callback with all the unmarshaled arguments err = w.Handler.GetNodeAmIResponsible(ctx, nodeId) @@ -4403,62 +8985,62 @@ func (w *ServerInterfaceWrapper) GetNodeCandidateTags(ctx echo.Context) error { // ------------- Path parameter "node_id" ------------- var nodeId string - err = runtime.BindStyledParameterWithOptions("simple", "node_id", ctx.Param("node_id"), &nodeId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "node_id", ctx.Param("node_id"), &nodeId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter node_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context var params GetNodeCandidateTagsParams // ------------- Optional query parameter "props" ------------- - err = runtime.BindQueryParameter("form", true, false, "props", ctx.QueryParams(), ¶ms.Props) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) } // ------------- Optional query parameter "limit" ------------- - err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit) + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) } // ------------- Optional query parameter "offset" ------------- - err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset) + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) } // ------------- Optional query parameter "meta" ------------- - err = runtime.BindQueryParameter("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta) + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) } // ------------- Optional query parameter "stats" ------------- - err = runtime.BindQueryParameter("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats) + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) } // ------------- Optional query parameter "orderby" ------------- - err = runtime.BindQueryParameter("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) } // ------------- Optional query parameter "groupby" ------------- - err = runtime.BindQueryParameter("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) } @@ -4474,62 +9056,62 @@ func (w *ServerInterfaceWrapper) GetNodeChecks(ctx echo.Context) error { // ------------- Path parameter "node_id" ------------- var nodeId string - err = runtime.BindStyledParameterWithOptions("simple", "node_id", ctx.Param("node_id"), &nodeId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "node_id", ctx.Param("node_id"), &nodeId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter node_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context var params GetNodeChecksParams // ------------- Optional query parameter "props" ------------- - err = runtime.BindQueryParameter("form", true, false, "props", ctx.QueryParams(), ¶ms.Props) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) } // ------------- Optional query parameter "limit" ------------- - err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit) + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) } // ------------- Optional query parameter "offset" ------------- - err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset) + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) } // ------------- Optional query parameter "meta" ------------- - err = runtime.BindQueryParameter("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta) + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) } // ------------- Optional query parameter "stats" ------------- - err = runtime.BindQueryParameter("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats) + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) } // ------------- Optional query parameter "orderby" ------------- - err = runtime.BindQueryParameter("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) } // ------------- Optional query parameter "groupby" ------------- - err = runtime.BindQueryParameter("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) } @@ -4545,62 +9127,62 @@ func (w *ServerInterfaceWrapper) GetNodeComplianceCandidateModulesets(ctx echo.C // ------------- Path parameter "node_id" ------------- var nodeId InPathNodeId - err = runtime.BindStyledParameterWithOptions("simple", "node_id", ctx.Param("node_id"), &nodeId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "node_id", ctx.Param("node_id"), &nodeId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter node_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context var params GetNodeComplianceCandidateModulesetsParams // ------------- Optional query parameter "props" ------------- - err = runtime.BindQueryParameter("form", true, false, "props", ctx.QueryParams(), ¶ms.Props) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) } // ------------- Optional query parameter "limit" ------------- - err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit) + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) } // ------------- Optional query parameter "offset" ------------- - err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset) + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) } // ------------- Optional query parameter "meta" ------------- - err = runtime.BindQueryParameter("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta) + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) } // ------------- Optional query parameter "stats" ------------- - err = runtime.BindQueryParameter("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats) + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) } // ------------- Optional query parameter "orderby" ------------- - err = runtime.BindQueryParameter("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) } // ------------- Optional query parameter "groupby" ------------- - err = runtime.BindQueryParameter("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) } @@ -4616,62 +9198,62 @@ func (w *ServerInterfaceWrapper) GetNodeComplianceCandidateRulesets(ctx echo.Con // ------------- Path parameter "node_id" ------------- var nodeId InPathNodeId - err = runtime.BindStyledParameterWithOptions("simple", "node_id", ctx.Param("node_id"), &nodeId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "node_id", ctx.Param("node_id"), &nodeId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter node_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context var params GetNodeComplianceCandidateRulesetsParams // ------------- Optional query parameter "props" ------------- - err = runtime.BindQueryParameter("form", true, false, "props", ctx.QueryParams(), ¶ms.Props) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) } // ------------- Optional query parameter "limit" ------------- - err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit) + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) } // ------------- Optional query parameter "offset" ------------- - err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset) + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) } // ------------- Optional query parameter "meta" ------------- - err = runtime.BindQueryParameter("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta) + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) } // ------------- Optional query parameter "stats" ------------- - err = runtime.BindQueryParameter("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats) + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) } // ------------- Optional query parameter "orderby" ------------- - err = runtime.BindQueryParameter("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) } // ------------- Optional query parameter "groupby" ------------- - err = runtime.BindQueryParameter("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) } @@ -4687,62 +9269,62 @@ func (w *ServerInterfaceWrapper) GetNodeComplianceLogs(ctx echo.Context) error { // ------------- Path parameter "node_id" ------------- var nodeId InPathNodeId - err = runtime.BindStyledParameterWithOptions("simple", "node_id", ctx.Param("node_id"), &nodeId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "node_id", ctx.Param("node_id"), &nodeId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter node_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context var params GetNodeComplianceLogsParams // ------------- Optional query parameter "props" ------------- - err = runtime.BindQueryParameter("form", true, false, "props", ctx.QueryParams(), ¶ms.Props) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) } // ------------- Optional query parameter "limit" ------------- - err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit) + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) } // ------------- Optional query parameter "offset" ------------- - err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset) + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) } // ------------- Optional query parameter "meta" ------------- - err = runtime.BindQueryParameter("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta) + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) } // ------------- Optional query parameter "stats" ------------- - err = runtime.BindQueryParameter("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats) + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) } // ------------- Optional query parameter "orderby" ------------- - err = runtime.BindQueryParameter("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) } // ------------- Optional query parameter "groupby" ------------- - err = runtime.BindQueryParameter("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) } @@ -4758,62 +9340,62 @@ func (w *ServerInterfaceWrapper) GetNodeComplianceModulesets(ctx echo.Context) e // ------------- Path parameter "node_id" ------------- var nodeId InPathNodeId - err = runtime.BindStyledParameterWithOptions("simple", "node_id", ctx.Param("node_id"), &nodeId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "node_id", ctx.Param("node_id"), &nodeId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter node_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context var params GetNodeComplianceModulesetsParams // ------------- Optional query parameter "props" ------------- - err = runtime.BindQueryParameter("form", true, false, "props", ctx.QueryParams(), ¶ms.Props) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) } // ------------- Optional query parameter "limit" ------------- - err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit) + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) } // ------------- Optional query parameter "offset" ------------- - err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset) + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) } // ------------- Optional query parameter "meta" ------------- - err = runtime.BindQueryParameter("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta) + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) } // ------------- Optional query parameter "stats" ------------- - err = runtime.BindQueryParameter("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats) + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) } // ------------- Optional query parameter "orderby" ------------- - err = runtime.BindQueryParameter("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) } // ------------- Optional query parameter "groupby" ------------- - err = runtime.BindQueryParameter("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) } @@ -4829,7 +9411,7 @@ func (w *ServerInterfaceWrapper) DeleteNodeComplianceModuleset(ctx echo.Context) // ------------- Path parameter "node_id" ------------- var nodeId InPathNodeId - err = runtime.BindStyledParameterWithOptions("simple", "node_id", ctx.Param("node_id"), &nodeId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "node_id", ctx.Param("node_id"), &nodeId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter node_id: %s", err)) } @@ -4837,14 +9419,14 @@ func (w *ServerInterfaceWrapper) DeleteNodeComplianceModuleset(ctx echo.Context) // ------------- Path parameter "mset_id" ------------- var msetId InPathMsetId - err = runtime.BindStyledParameterWithOptions("simple", "mset_id", ctx.Param("mset_id"), &msetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "mset_id", ctx.Param("mset_id"), &msetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter mset_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Invoke the callback with all the unmarshaled arguments err = w.Handler.DeleteNodeComplianceModuleset(ctx, nodeId, msetId) @@ -4857,7 +9439,7 @@ func (w *ServerInterfaceWrapper) PostNodeComplianceModuleset(ctx echo.Context) e // ------------- Path parameter "node_id" ------------- var nodeId InPathNodeId - err = runtime.BindStyledParameterWithOptions("simple", "node_id", ctx.Param("node_id"), &nodeId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "node_id", ctx.Param("node_id"), &nodeId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter node_id: %s", err)) } @@ -4865,14 +9447,14 @@ func (w *ServerInterfaceWrapper) PostNodeComplianceModuleset(ctx echo.Context) e // ------------- Path parameter "mset_id" ------------- var msetId InPathMsetId - err = runtime.BindStyledParameterWithOptions("simple", "mset_id", ctx.Param("mset_id"), &msetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "mset_id", ctx.Param("mset_id"), &msetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter mset_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Invoke the callback with all the unmarshaled arguments err = w.Handler.PostNodeComplianceModuleset(ctx, nodeId, msetId) @@ -4885,62 +9467,62 @@ func (w *ServerInterfaceWrapper) GetNodeComplianceRulesets(ctx echo.Context) err // ------------- Path parameter "node_id" ------------- var nodeId InPathNodeId - err = runtime.BindStyledParameterWithOptions("simple", "node_id", ctx.Param("node_id"), &nodeId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "node_id", ctx.Param("node_id"), &nodeId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter node_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context var params GetNodeComplianceRulesetsParams // ------------- Optional query parameter "props" ------------- - err = runtime.BindQueryParameter("form", true, false, "props", ctx.QueryParams(), ¶ms.Props) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) } // ------------- Optional query parameter "limit" ------------- - err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit) + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) } // ------------- Optional query parameter "offset" ------------- - err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset) + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) } // ------------- Optional query parameter "meta" ------------- - err = runtime.BindQueryParameter("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta) + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) } // ------------- Optional query parameter "stats" ------------- - err = runtime.BindQueryParameter("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats) + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) } // ------------- Optional query parameter "orderby" ------------- - err = runtime.BindQueryParameter("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) } // ------------- Optional query parameter "groupby" ------------- - err = runtime.BindQueryParameter("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) } @@ -4956,7 +9538,7 @@ func (w *ServerInterfaceWrapper) DeleteNodeComplianceRuleset(ctx echo.Context) e // ------------- Path parameter "node_id" ------------- var nodeId InPathNodeId - err = runtime.BindStyledParameterWithOptions("simple", "node_id", ctx.Param("node_id"), &nodeId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "node_id", ctx.Param("node_id"), &nodeId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter node_id: %s", err)) } @@ -4964,14 +9546,14 @@ func (w *ServerInterfaceWrapper) DeleteNodeComplianceRuleset(ctx echo.Context) e // ------------- Path parameter "rset_id" ------------- var rsetId InPathRsetId - err = runtime.BindStyledParameterWithOptions("simple", "rset_id", ctx.Param("rset_id"), &rsetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "rset_id", ctx.Param("rset_id"), &rsetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter rset_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Invoke the callback with all the unmarshaled arguments err = w.Handler.DeleteNodeComplianceRuleset(ctx, nodeId, rsetId) @@ -4984,7 +9566,7 @@ func (w *ServerInterfaceWrapper) PostNodeComplianceRuleset(ctx echo.Context) err // ------------- Path parameter "node_id" ------------- var nodeId InPathNodeId - err = runtime.BindStyledParameterWithOptions("simple", "node_id", ctx.Param("node_id"), &nodeId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "node_id", ctx.Param("node_id"), &nodeId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter node_id: %s", err)) } @@ -4992,14 +9574,14 @@ func (w *ServerInterfaceWrapper) PostNodeComplianceRuleset(ctx echo.Context) err // ------------- Path parameter "rset_id" ------------- var rsetId InPathRsetId - err = runtime.BindStyledParameterWithOptions("simple", "rset_id", ctx.Param("rset_id"), &rsetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "rset_id", ctx.Param("rset_id"), &rsetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter rset_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Invoke the callback with all the unmarshaled arguments err = w.Handler.PostNodeComplianceRuleset(ctx, nodeId, rsetId) @@ -5012,62 +9594,62 @@ func (w *ServerInterfaceWrapper) GetNodeComplianceStatus(ctx echo.Context) error // ------------- Path parameter "node_id" ------------- var nodeId InPathNodeId - err = runtime.BindStyledParameterWithOptions("simple", "node_id", ctx.Param("node_id"), &nodeId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "node_id", ctx.Param("node_id"), &nodeId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter node_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context var params GetNodeComplianceStatusParams // ------------- Optional query parameter "props" ------------- - err = runtime.BindQueryParameter("form", true, false, "props", ctx.QueryParams(), ¶ms.Props) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) } // ------------- Optional query parameter "limit" ------------- - err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit) + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) } // ------------- Optional query parameter "offset" ------------- - err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset) + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) } // ------------- Optional query parameter "meta" ------------- - err = runtime.BindQueryParameter("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta) + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) } // ------------- Optional query parameter "stats" ------------- - err = runtime.BindQueryParameter("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats) + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) } // ------------- Optional query parameter "orderby" ------------- - err = runtime.BindQueryParameter("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) } // ------------- Optional query parameter "groupby" ------------- - err = runtime.BindQueryParameter("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) } @@ -5083,62 +9665,62 @@ func (w *ServerInterfaceWrapper) GetNodeDisks(ctx echo.Context) error { // ------------- Path parameter "node_id" ------------- var nodeId string - err = runtime.BindStyledParameterWithOptions("simple", "node_id", ctx.Param("node_id"), &nodeId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "node_id", ctx.Param("node_id"), &nodeId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter node_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context var params GetNodeDisksParams // ------------- Optional query parameter "props" ------------- - err = runtime.BindQueryParameter("form", true, false, "props", ctx.QueryParams(), ¶ms.Props) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) } // ------------- Optional query parameter "limit" ------------- - err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit) + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) } // ------------- Optional query parameter "offset" ------------- - err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset) + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) } // ------------- Optional query parameter "meta" ------------- - err = runtime.BindQueryParameter("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta) + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) } // ------------- Optional query parameter "stats" ------------- - err = runtime.BindQueryParameter("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats) + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) } // ------------- Optional query parameter "orderby" ------------- - err = runtime.BindQueryParameter("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) } // ------------- Optional query parameter "groupby" ------------- - err = runtime.BindQueryParameter("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) } @@ -5154,62 +9736,62 @@ func (w *ServerInterfaceWrapper) GetNodeHardware(ctx echo.Context) error { // ------------- Path parameter "node_id" ------------- var nodeId string - err = runtime.BindStyledParameterWithOptions("simple", "node_id", ctx.Param("node_id"), &nodeId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "node_id", ctx.Param("node_id"), &nodeId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter node_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context var params GetNodeHardwareParams // ------------- Optional query parameter "props" ------------- - err = runtime.BindQueryParameter("form", true, false, "props", ctx.QueryParams(), ¶ms.Props) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) } // ------------- Optional query parameter "limit" ------------- - err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit) + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) } // ------------- Optional query parameter "offset" ------------- - err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset) + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) } // ------------- Optional query parameter "meta" ------------- - err = runtime.BindQueryParameter("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta) + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) } // ------------- Optional query parameter "stats" ------------- - err = runtime.BindQueryParameter("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats) + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) } // ------------- Optional query parameter "orderby" ------------- - err = runtime.BindQueryParameter("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) } // ------------- Optional query parameter "groupby" ------------- - err = runtime.BindQueryParameter("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) } @@ -5225,62 +9807,62 @@ func (w *ServerInterfaceWrapper) GetNodeHbas(ctx echo.Context) error { // ------------- Path parameter "node_id" ------------- var nodeId string - err = runtime.BindStyledParameterWithOptions("simple", "node_id", ctx.Param("node_id"), &nodeId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "node_id", ctx.Param("node_id"), &nodeId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter node_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context var params GetNodeHbasParams // ------------- Optional query parameter "props" ------------- - err = runtime.BindQueryParameter("form", true, false, "props", ctx.QueryParams(), ¶ms.Props) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) } // ------------- Optional query parameter "limit" ------------- - err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit) + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) } // ------------- Optional query parameter "offset" ------------- - err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset) + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) } // ------------- Optional query parameter "meta" ------------- - err = runtime.BindQueryParameter("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta) + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) } // ------------- Optional query parameter "stats" ------------- - err = runtime.BindQueryParameter("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats) + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) } // ------------- Optional query parameter "orderby" ------------- - err = runtime.BindQueryParameter("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) } // ------------- Optional query parameter "groupby" ------------- - err = runtime.BindQueryParameter("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) } @@ -5296,62 +9878,62 @@ func (w *ServerInterfaceWrapper) GetNodeInterfaces(ctx echo.Context) error { // ------------- Path parameter "node_id" ------------- var nodeId string - err = runtime.BindStyledParameterWithOptions("simple", "node_id", ctx.Param("node_id"), &nodeId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "node_id", ctx.Param("node_id"), &nodeId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter node_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context var params GetNodeInterfacesParams // ------------- Optional query parameter "props" ------------- - err = runtime.BindQueryParameter("form", true, false, "props", ctx.QueryParams(), ¶ms.Props) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) } // ------------- Optional query parameter "limit" ------------- - err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit) + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) } // ------------- Optional query parameter "offset" ------------- - err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset) + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) } // ------------- Optional query parameter "meta" ------------- - err = runtime.BindQueryParameter("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta) + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) } // ------------- Optional query parameter "stats" ------------- - err = runtime.BindQueryParameter("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats) + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) } // ------------- Optional query parameter "orderby" ------------- - err = runtime.BindQueryParameter("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) } // ------------- Optional query parameter "groupby" ------------- - err = runtime.BindQueryParameter("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) } @@ -5367,62 +9949,62 @@ func (w *ServerInterfaceWrapper) GetNodeIps(ctx echo.Context) error { // ------------- Path parameter "node_id" ------------- var nodeId string - err = runtime.BindStyledParameterWithOptions("simple", "node_id", ctx.Param("node_id"), &nodeId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "node_id", ctx.Param("node_id"), &nodeId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter node_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context var params GetNodeIpsParams // ------------- Optional query parameter "props" ------------- - err = runtime.BindQueryParameter("form", true, false, "props", ctx.QueryParams(), ¶ms.Props) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) } // ------------- Optional query parameter "limit" ------------- - err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit) + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) } // ------------- Optional query parameter "offset" ------------- - err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset) + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) } // ------------- Optional query parameter "meta" ------------- - err = runtime.BindQueryParameter("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta) + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) } // ------------- Optional query parameter "stats" ------------- - err = runtime.BindQueryParameter("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats) + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) } // ------------- Optional query parameter "orderby" ------------- - err = runtime.BindQueryParameter("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) } // ------------- Optional query parameter "groupby" ------------- - err = runtime.BindQueryParameter("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) } @@ -5438,62 +10020,62 @@ func (w *ServerInterfaceWrapper) GetNodeServices(ctx echo.Context) error { // ------------- Path parameter "node_id" ------------- var nodeId string - err = runtime.BindStyledParameterWithOptions("simple", "node_id", ctx.Param("node_id"), &nodeId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "node_id", ctx.Param("node_id"), &nodeId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter node_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context var params GetNodeServicesParams // ------------- Optional query parameter "props" ------------- - err = runtime.BindQueryParameter("form", true, false, "props", ctx.QueryParams(), ¶ms.Props) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) } // ------------- Optional query parameter "limit" ------------- - err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit) + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) } // ------------- Optional query parameter "offset" ------------- - err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset) + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) } // ------------- Optional query parameter "meta" ------------- - err = runtime.BindQueryParameter("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta) + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) } // ------------- Optional query parameter "stats" ------------- - err = runtime.BindQueryParameter("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats) + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) } // ------------- Optional query parameter "orderby" ------------- - err = runtime.BindQueryParameter("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) } // ------------- Optional query parameter "groupby" ------------- - err = runtime.BindQueryParameter("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) } @@ -5509,7 +10091,7 @@ func (w *ServerInterfaceWrapper) GetNodeService(ctx echo.Context) error { // ------------- Path parameter "node_id" ------------- var nodeId string - err = runtime.BindStyledParameterWithOptions("simple", "node_id", ctx.Param("node_id"), &nodeId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "node_id", ctx.Param("node_id"), &nodeId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter node_id: %s", err)) } @@ -5517,62 +10099,62 @@ func (w *ServerInterfaceWrapper) GetNodeService(ctx echo.Context) error { // ------------- Path parameter "svc_id" ------------- var svcId string - err = runtime.BindStyledParameterWithOptions("simple", "svc_id", ctx.Param("svc_id"), &svcId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "svc_id", ctx.Param("svc_id"), &svcId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter svc_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context var params GetNodeServiceParams // ------------- Optional query parameter "props" ------------- - err = runtime.BindQueryParameter("form", true, false, "props", ctx.QueryParams(), ¶ms.Props) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) } // ------------- Optional query parameter "limit" ------------- - err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit) + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) } // ------------- Optional query parameter "offset" ------------- - err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset) + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) } // ------------- Optional query parameter "meta" ------------- - err = runtime.BindQueryParameter("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta) + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) } // ------------- Optional query parameter "stats" ------------- - err = runtime.BindQueryParameter("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats) + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) } // ------------- Optional query parameter "orderby" ------------- - err = runtime.BindQueryParameter("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) } // ------------- Optional query parameter "groupby" ------------- - err = runtime.BindQueryParameter("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) } @@ -5588,14 +10170,14 @@ func (w *ServerInterfaceWrapper) PostNodeSnooze(ctx echo.Context) error { // ------------- Path parameter "node_id" ------------- var nodeId InPathNodeId - err = runtime.BindStyledParameterWithOptions("simple", "node_id", ctx.Param("node_id"), &nodeId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "node_id", ctx.Param("node_id"), &nodeId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter node_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Invoke the callback with all the unmarshaled arguments err = w.Handler.PostNodeSnooze(ctx, nodeId) @@ -5608,62 +10190,62 @@ func (w *ServerInterfaceWrapper) GetNodeTags(ctx echo.Context) error { // ------------- Path parameter "node_id" ------------- var nodeId string - err = runtime.BindStyledParameterWithOptions("simple", "node_id", ctx.Param("node_id"), &nodeId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "node_id", ctx.Param("node_id"), &nodeId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter node_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context var params GetNodeTagsParams // ------------- Optional query parameter "props" ------------- - err = runtime.BindQueryParameter("form", true, false, "props", ctx.QueryParams(), ¶ms.Props) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) } // ------------- Optional query parameter "limit" ------------- - err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit) + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) } // ------------- Optional query parameter "offset" ------------- - err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset) + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) } // ------------- Optional query parameter "meta" ------------- - err = runtime.BindQueryParameter("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta) + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) } // ------------- Optional query parameter "stats" ------------- - err = runtime.BindQueryParameter("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats) + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) } // ------------- Optional query parameter "orderby" ------------- - err = runtime.BindQueryParameter("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) } // ------------- Optional query parameter "groupby" ------------- - err = runtime.BindQueryParameter("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) } @@ -5679,14 +10261,14 @@ func (w *ServerInterfaceWrapper) GetNodeUUID(ctx echo.Context) error { // ------------- Path parameter "node_id" ------------- var nodeId string - err = runtime.BindStyledParameterWithOptions("simple", "node_id", ctx.Param("node_id"), &nodeId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "node_id", ctx.Param("node_id"), &nodeId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter node_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Invoke the callback with all the unmarshaled arguments err = w.Handler.GetNodeUUID(ctx, nodeId) @@ -5697,9 +10279,9 @@ func (w *ServerInterfaceWrapper) GetNodeUUID(ctx echo.Context) error { func (w *ServerInterfaceWrapper) PutObsolescenceRefresh(ctx echo.Context) error { var err error - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Invoke the callback with all the unmarshaled arguments err = w.Handler.PutObsolescenceRefresh(ctx) @@ -5710,9 +10292,9 @@ func (w *ServerInterfaceWrapper) PutObsolescenceRefresh(ctx echo.Context) error func (w *ServerInterfaceWrapper) DeleteObsolescenceSettings(ctx echo.Context) error { var err error - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Invoke the callback with all the unmarshaled arguments err = w.Handler.DeleteObsolescenceSettings(ctx) @@ -5723,57 +10305,57 @@ func (w *ServerInterfaceWrapper) DeleteObsolescenceSettings(ctx echo.Context) er func (w *ServerInterfaceWrapper) GetObsolescenceSettings(ctx echo.Context) error { var err error - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context var params GetObsolescenceSettingsParams // ------------- Optional query parameter "props" ------------- - err = runtime.BindQueryParameter("form", true, false, "props", ctx.QueryParams(), ¶ms.Props) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) } // ------------- Optional query parameter "limit" ------------- - err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit) + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) } // ------------- Optional query parameter "offset" ------------- - err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset) + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) } // ------------- Optional query parameter "meta" ------------- - err = runtime.BindQueryParameter("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta) + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) } // ------------- Optional query parameter "stats" ------------- - err = runtime.BindQueryParameter("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats) + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) } // ------------- Optional query parameter "orderby" ------------- - err = runtime.BindQueryParameter("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) } // ------------- Optional query parameter "groupby" ------------- - err = runtime.BindQueryParameter("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) } @@ -5787,9 +10369,9 @@ func (w *ServerInterfaceWrapper) GetObsolescenceSettings(ctx echo.Context) error func (w *ServerInterfaceWrapper) PostObsolescenceSettings(ctx echo.Context) error { var err error - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Invoke the callback with all the unmarshaled arguments err = w.Handler.PostObsolescenceSettings(ctx) @@ -5802,14 +10384,14 @@ func (w *ServerInterfaceWrapper) DeleteObsolescenceSetting(ctx echo.Context) err // ------------- Path parameter "id" ------------- var id string - err = runtime.BindStyledParameterWithOptions("simple", "id", ctx.Param("id"), &id, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "id", ctx.Param("id"), &id, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Invoke the callback with all the unmarshaled arguments err = w.Handler.DeleteObsolescenceSetting(ctx, id) @@ -5822,62 +10404,62 @@ func (w *ServerInterfaceWrapper) GetObsolescenceSetting(ctx echo.Context) error // ------------- Path parameter "id" ------------- var id string - err = runtime.BindStyledParameterWithOptions("simple", "id", ctx.Param("id"), &id, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "id", ctx.Param("id"), &id, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context var params GetObsolescenceSettingParams // ------------- Optional query parameter "props" ------------- - err = runtime.BindQueryParameter("form", true, false, "props", ctx.QueryParams(), ¶ms.Props) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) } // ------------- Optional query parameter "limit" ------------- - err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit) + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) } // ------------- Optional query parameter "offset" ------------- - err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset) + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) } // ------------- Optional query parameter "meta" ------------- - err = runtime.BindQueryParameter("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta) + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) } // ------------- Optional query parameter "stats" ------------- - err = runtime.BindQueryParameter("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats) + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) } // ------------- Optional query parameter "orderby" ------------- - err = runtime.BindQueryParameter("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) } // ------------- Optional query parameter "groupby" ------------- - err = runtime.BindQueryParameter("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) } @@ -5893,26 +10475,169 @@ func (w *ServerInterfaceWrapper) PostObsolescenceSetting(ctx echo.Context) error // ------------- Path parameter "id" ------------- var id string - err = runtime.BindStyledParameterWithOptions("simple", "id", ctx.Param("id"), &id, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "id", ctx.Param("id"), &id, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter id: %s", err)) + } + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.PostObsolescenceSetting(ctx, id) + return err +} + +// GetSwagger converts echo context to params. +func (w *ServerInterfaceWrapper) GetSwagger(ctx echo.Context) error { + var err error + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.GetSwagger(ctx) + return err +} + +// GetPackages converts echo context to params. +func (w *ServerInterfaceWrapper) GetPackages(ctx echo.Context) error { + var err error + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Parameter object where we will unmarshal all parameters from the context + var params GetPackagesParams + // ------------- Optional query parameter "props" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) + } + + // ------------- Optional query parameter "limit" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) + } + + // ------------- Optional query parameter "offset" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) + } + + // ------------- Optional query parameter "meta" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) + } + + // ------------- Optional query parameter "stats" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) + } + + // ------------- Optional query parameter "orderby" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) + } + + // ------------- Optional query parameter "filter" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "filter", ctx.QueryParams(), ¶ms.Filter, runtime.BindQueryParameterOptions{Type: "array", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter filter: %s", err)) + } + + // ------------- Optional query parameter "groupby" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) + } + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.GetPackages(ctx, params) + return err +} + +// GetPackagesDiff converts echo context to params. +func (w *ServerInterfaceWrapper) GetPackagesDiff(ctx echo.Context) error { + var err error + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Parameter object where we will unmarshal all parameters from the context + var params GetPackagesDiffParams + // ------------- Optional query parameter "node_ids" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "node_ids", ctx.QueryParams(), ¶ms.NodeIds, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter node_ids: %s", err)) + } + + // ------------- Optional query parameter "svc_ids" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "svc_ids", ctx.QueryParams(), ¶ms.SvcIds, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter svc_ids: %s", err)) + } + + // ------------- Optional query parameter "encap" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "encap", ctx.QueryParams(), ¶ms.Encap, runtime.BindQueryParameterOptions{Type: "boolean", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter encap: %s", err)) + } + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.GetPackagesDiff(ctx, params) + return err +} + +// GetSearch converts echo context to params. +func (w *ServerInterfaceWrapper) GetSearch(ctx echo.Context) error { + var err error + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Parameter object where we will unmarshal all parameters from the context + var params GetSearchParams + // ------------- Required query parameter "q" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, true, "q", ctx.QueryParams(), ¶ms.Q, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { - return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter id: %s", err)) + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter q: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + // ------------- Optional query parameter "kinds" ------------- - ctx.Set(BearerAuthScopes, []string{}) + err = runtime.BindQueryParameterWithOptions("form", true, false, "kinds", ctx.QueryParams(), ¶ms.Kinds, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter kinds: %s", err)) + } - // Invoke the callback with all the unmarshaled arguments - err = w.Handler.PostObsolescenceSetting(ctx, id) - return err -} + // ------------- Optional query parameter "limit" ------------- -// GetSwagger converts echo context to params. -func (w *ServerInterfaceWrapper) GetSwagger(ctx echo.Context) error { - var err error + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) + } // Invoke the callback with all the unmarshaled arguments - err = w.Handler.GetSwagger(ctx) + err = w.Handler.GetSearch(ctx, params) return err } @@ -5920,9 +10645,9 @@ func (w *ServerInterfaceWrapper) GetSwagger(ctx echo.Context) error { func (w *ServerInterfaceWrapper) DeleteServices(ctx echo.Context) error { var err error - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Invoke the callback with all the unmarshaled arguments err = w.Handler.DeleteServices(ctx) @@ -5933,57 +10658,64 @@ func (w *ServerInterfaceWrapper) DeleteServices(ctx echo.Context) error { func (w *ServerInterfaceWrapper) GetServices(ctx echo.Context) error { var err error - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context var params GetServicesParams // ------------- Optional query parameter "props" ------------- - err = runtime.BindQueryParameter("form", true, false, "props", ctx.QueryParams(), ¶ms.Props) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) } // ------------- Optional query parameter "limit" ------------- - err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit) + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) } // ------------- Optional query parameter "offset" ------------- - err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset) + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) } // ------------- Optional query parameter "meta" ------------- - err = runtime.BindQueryParameter("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta) + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) } // ------------- Optional query parameter "stats" ------------- - err = runtime.BindQueryParameter("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats) + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) } // ------------- Optional query parameter "orderby" ------------- - err = runtime.BindQueryParameter("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) } + // ------------- Optional query parameter "filter" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "filter", ctx.QueryParams(), ¶ms.Filter, runtime.BindQueryParameterOptions{Type: "array", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter filter: %s", err)) + } + // ------------- Optional query parameter "groupby" ------------- - err = runtime.BindQueryParameter("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) } @@ -5997,9 +10729,9 @@ func (w *ServerInterfaceWrapper) GetServices(ctx echo.Context) error { func (w *ServerInterfaceWrapper) PostServices(ctx echo.Context) error { var err error - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Invoke the callback with all the unmarshaled arguments err = w.Handler.PostServices(ctx) @@ -6012,14 +10744,14 @@ func (w *ServerInterfaceWrapper) DeleteService(ctx echo.Context) error { // ------------- Path parameter "svc_id" ------------- var svcId string - err = runtime.BindStyledParameterWithOptions("simple", "svc_id", ctx.Param("svc_id"), &svcId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "svc_id", ctx.Param("svc_id"), &svcId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter svc_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Invoke the callback with all the unmarshaled arguments err = w.Handler.DeleteService(ctx, svcId) @@ -6032,62 +10764,62 @@ func (w *ServerInterfaceWrapper) GetService(ctx echo.Context) error { // ------------- Path parameter "svc_id" ------------- var svcId string - err = runtime.BindStyledParameterWithOptions("simple", "svc_id", ctx.Param("svc_id"), &svcId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "svc_id", ctx.Param("svc_id"), &svcId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter svc_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context var params GetServiceParams // ------------- Optional query parameter "props" ------------- - err = runtime.BindQueryParameter("form", true, false, "props", ctx.QueryParams(), ¶ms.Props) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) } // ------------- Optional query parameter "limit" ------------- - err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit) + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) } // ------------- Optional query parameter "offset" ------------- - err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset) + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) } // ------------- Optional query parameter "meta" ------------- - err = runtime.BindQueryParameter("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta) + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) } // ------------- Optional query parameter "stats" ------------- - err = runtime.BindQueryParameter("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats) + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) } // ------------- Optional query parameter "orderby" ------------- - err = runtime.BindQueryParameter("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) } // ------------- Optional query parameter "groupby" ------------- - err = runtime.BindQueryParameter("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) } @@ -6103,14 +10835,14 @@ func (w *ServerInterfaceWrapper) PostService(ctx echo.Context) error { // ------------- Path parameter "svc_id" ------------- var svcId string - err = runtime.BindStyledParameterWithOptions("simple", "svc_id", ctx.Param("svc_id"), &svcId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "svc_id", ctx.Param("svc_id"), &svcId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter svc_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Invoke the callback with all the unmarshaled arguments err = w.Handler.PostService(ctx, svcId) @@ -6123,62 +10855,62 @@ func (w *ServerInterfaceWrapper) GetServiceAlerts(ctx echo.Context) error { // ------------- Path parameter "svc_id" ------------- var svcId string - err = runtime.BindStyledParameterWithOptions("simple", "svc_id", ctx.Param("svc_id"), &svcId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "svc_id", ctx.Param("svc_id"), &svcId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter svc_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context var params GetServiceAlertsParams // ------------- Optional query parameter "props" ------------- - err = runtime.BindQueryParameter("form", true, false, "props", ctx.QueryParams(), ¶ms.Props) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) } // ------------- Optional query parameter "limit" ------------- - err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit) + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) } // ------------- Optional query parameter "offset" ------------- - err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset) + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) } // ------------- Optional query parameter "meta" ------------- - err = runtime.BindQueryParameter("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta) + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) } // ------------- Optional query parameter "stats" ------------- - err = runtime.BindQueryParameter("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats) + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) } // ------------- Optional query parameter "orderby" ------------- - err = runtime.BindQueryParameter("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) } // ------------- Optional query parameter "groupby" ------------- - err = runtime.BindQueryParameter("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) } @@ -6194,14 +10926,14 @@ func (w *ServerInterfaceWrapper) GetServiceAmIResponsible(ctx echo.Context) erro // ------------- Path parameter "svc_id" ------------- var svcId string - err = runtime.BindStyledParameterWithOptions("simple", "svc_id", ctx.Param("svc_id"), &svcId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "svc_id", ctx.Param("svc_id"), &svcId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter svc_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Invoke the callback with all the unmarshaled arguments err = w.Handler.GetServiceAmIResponsible(ctx, svcId) @@ -6214,62 +10946,62 @@ func (w *ServerInterfaceWrapper) GetServiceCandidateTags(ctx echo.Context) error // ------------- Path parameter "svc_id" ------------- var svcId string - err = runtime.BindStyledParameterWithOptions("simple", "svc_id", ctx.Param("svc_id"), &svcId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "svc_id", ctx.Param("svc_id"), &svcId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter svc_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context var params GetServiceCandidateTagsParams // ------------- Optional query parameter "props" ------------- - err = runtime.BindQueryParameter("form", true, false, "props", ctx.QueryParams(), ¶ms.Props) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) } // ------------- Optional query parameter "limit" ------------- - err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit) + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) } // ------------- Optional query parameter "offset" ------------- - err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset) + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) } // ------------- Optional query parameter "meta" ------------- - err = runtime.BindQueryParameter("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta) + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) } // ------------- Optional query parameter "stats" ------------- - err = runtime.BindQueryParameter("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats) + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) } // ------------- Optional query parameter "orderby" ------------- - err = runtime.BindQueryParameter("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) } // ------------- Optional query parameter "groupby" ------------- - err = runtime.BindQueryParameter("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) } @@ -6285,62 +11017,62 @@ func (w *ServerInterfaceWrapper) GetServiceChecks(ctx echo.Context) error { // ------------- Path parameter "svc_id" ------------- var svcId string - err = runtime.BindStyledParameterWithOptions("simple", "svc_id", ctx.Param("svc_id"), &svcId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "svc_id", ctx.Param("svc_id"), &svcId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter svc_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context var params GetServiceChecksParams // ------------- Optional query parameter "props" ------------- - err = runtime.BindQueryParameter("form", true, false, "props", ctx.QueryParams(), ¶ms.Props) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) } // ------------- Optional query parameter "limit" ------------- - err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit) + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) } // ------------- Optional query parameter "offset" ------------- - err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset) + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) } // ------------- Optional query parameter "meta" ------------- - err = runtime.BindQueryParameter("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta) + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) } // ------------- Optional query parameter "stats" ------------- - err = runtime.BindQueryParameter("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats) + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) } // ------------- Optional query parameter "orderby" ------------- - err = runtime.BindQueryParameter("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) } // ------------- Optional query parameter "groupby" ------------- - err = runtime.BindQueryParameter("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) } @@ -6356,62 +11088,62 @@ func (w *ServerInterfaceWrapper) GetServiceComplianceCandidateModulesets(ctx ech // ------------- Path parameter "svc_id" ------------- var svcId string - err = runtime.BindStyledParameterWithOptions("simple", "svc_id", ctx.Param("svc_id"), &svcId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "svc_id", ctx.Param("svc_id"), &svcId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter svc_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context var params GetServiceComplianceCandidateModulesetsParams // ------------- Optional query parameter "props" ------------- - err = runtime.BindQueryParameter("form", true, false, "props", ctx.QueryParams(), ¶ms.Props) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) } // ------------- Optional query parameter "limit" ------------- - err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit) + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) } // ------------- Optional query parameter "offset" ------------- - err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset) + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) } // ------------- Optional query parameter "meta" ------------- - err = runtime.BindQueryParameter("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta) + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) } // ------------- Optional query parameter "stats" ------------- - err = runtime.BindQueryParameter("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats) + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) } // ------------- Optional query parameter "orderby" ------------- - err = runtime.BindQueryParameter("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) } // ------------- Optional query parameter "groupby" ------------- - err = runtime.BindQueryParameter("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) } @@ -6427,69 +11159,69 @@ func (w *ServerInterfaceWrapper) GetServiceComplianceCandidateRulesets(ctx echo. // ------------- Path parameter "svc_id" ------------- var svcId string - err = runtime.BindStyledParameterWithOptions("simple", "svc_id", ctx.Param("svc_id"), &svcId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "svc_id", ctx.Param("svc_id"), &svcId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter svc_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context var params GetServiceComplianceCandidateRulesetsParams // ------------- Optional query parameter "slave" ------------- - err = runtime.BindQueryParameter("form", true, false, "slave", ctx.QueryParams(), ¶ms.Slave) + err = runtime.BindQueryParameterWithOptions("form", true, false, "slave", ctx.QueryParams(), ¶ms.Slave, runtime.BindQueryParameterOptions{Type: "boolean", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter slave: %s", err)) } // ------------- Optional query parameter "props" ------------- - err = runtime.BindQueryParameter("form", true, false, "props", ctx.QueryParams(), ¶ms.Props) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) } // ------------- Optional query parameter "limit" ------------- - err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit) + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) } // ------------- Optional query parameter "offset" ------------- - err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset) + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) } // ------------- Optional query parameter "meta" ------------- - err = runtime.BindQueryParameter("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta) + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) } // ------------- Optional query parameter "stats" ------------- - err = runtime.BindQueryParameter("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats) + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) } // ------------- Optional query parameter "orderby" ------------- - err = runtime.BindQueryParameter("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) } // ------------- Optional query parameter "groupby" ------------- - err = runtime.BindQueryParameter("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) } @@ -6505,62 +11237,62 @@ func (w *ServerInterfaceWrapper) GetServiceComplianceLogs(ctx echo.Context) erro // ------------- Path parameter "svc_id" ------------- var svcId string - err = runtime.BindStyledParameterWithOptions("simple", "svc_id", ctx.Param("svc_id"), &svcId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "svc_id", ctx.Param("svc_id"), &svcId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter svc_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context var params GetServiceComplianceLogsParams // ------------- Optional query parameter "props" ------------- - err = runtime.BindQueryParameter("form", true, false, "props", ctx.QueryParams(), ¶ms.Props) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) } // ------------- Optional query parameter "limit" ------------- - err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit) + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) } // ------------- Optional query parameter "offset" ------------- - err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset) + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) } // ------------- Optional query parameter "meta" ------------- - err = runtime.BindQueryParameter("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta) + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) } // ------------- Optional query parameter "stats" ------------- - err = runtime.BindQueryParameter("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats) + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) } // ------------- Optional query parameter "orderby" ------------- - err = runtime.BindQueryParameter("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) } // ------------- Optional query parameter "groupby" ------------- - err = runtime.BindQueryParameter("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) } @@ -6576,69 +11308,69 @@ func (w *ServerInterfaceWrapper) GetServiceComplianceModulesets(ctx echo.Context // ------------- Path parameter "svc_id" ------------- var svcId string - err = runtime.BindStyledParameterWithOptions("simple", "svc_id", ctx.Param("svc_id"), &svcId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "svc_id", ctx.Param("svc_id"), &svcId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter svc_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context var params GetServiceComplianceModulesetsParams // ------------- Optional query parameter "slave" ------------- - err = runtime.BindQueryParameter("form", true, false, "slave", ctx.QueryParams(), ¶ms.Slave) + err = runtime.BindQueryParameterWithOptions("form", true, false, "slave", ctx.QueryParams(), ¶ms.Slave, runtime.BindQueryParameterOptions{Type: "boolean", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter slave: %s", err)) } // ------------- Optional query parameter "props" ------------- - err = runtime.BindQueryParameter("form", true, false, "props", ctx.QueryParams(), ¶ms.Props) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) } // ------------- Optional query parameter "limit" ------------- - err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit) + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) } // ------------- Optional query parameter "offset" ------------- - err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset) + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) } // ------------- Optional query parameter "meta" ------------- - err = runtime.BindQueryParameter("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta) + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) } // ------------- Optional query parameter "stats" ------------- - err = runtime.BindQueryParameter("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats) + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) } // ------------- Optional query parameter "orderby" ------------- - err = runtime.BindQueryParameter("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) } // ------------- Optional query parameter "groupby" ------------- - err = runtime.BindQueryParameter("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) } @@ -6654,7 +11386,7 @@ func (w *ServerInterfaceWrapper) DeleteServiceComplianceModuleset(ctx echo.Conte // ------------- Path parameter "svc_id" ------------- var svcId string - err = runtime.BindStyledParameterWithOptions("simple", "svc_id", ctx.Param("svc_id"), &svcId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "svc_id", ctx.Param("svc_id"), &svcId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter svc_id: %s", err)) } @@ -6662,20 +11394,20 @@ func (w *ServerInterfaceWrapper) DeleteServiceComplianceModuleset(ctx echo.Conte // ------------- Path parameter "mset_id" ------------- var msetId InPathMsetId - err = runtime.BindStyledParameterWithOptions("simple", "mset_id", ctx.Param("mset_id"), &msetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "mset_id", ctx.Param("mset_id"), &msetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter mset_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context var params DeleteServiceComplianceModulesetParams // ------------- Optional query parameter "slave" ------------- - err = runtime.BindQueryParameter("form", true, false, "slave", ctx.QueryParams(), ¶ms.Slave) + err = runtime.BindQueryParameterWithOptions("form", true, false, "slave", ctx.QueryParams(), ¶ms.Slave, runtime.BindQueryParameterOptions{Type: "boolean", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter slave: %s", err)) } @@ -6691,7 +11423,7 @@ func (w *ServerInterfaceWrapper) PostServiceComplianceModuleset(ctx echo.Context // ------------- Path parameter "svc_id" ------------- var svcId string - err = runtime.BindStyledParameterWithOptions("simple", "svc_id", ctx.Param("svc_id"), &svcId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "svc_id", ctx.Param("svc_id"), &svcId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter svc_id: %s", err)) } @@ -6699,20 +11431,20 @@ func (w *ServerInterfaceWrapper) PostServiceComplianceModuleset(ctx echo.Context // ------------- Path parameter "mset_id" ------------- var msetId InPathMsetId - err = runtime.BindStyledParameterWithOptions("simple", "mset_id", ctx.Param("mset_id"), &msetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "mset_id", ctx.Param("mset_id"), &msetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter mset_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context var params PostServiceComplianceModulesetParams // ------------- Optional query parameter "slave" ------------- - err = runtime.BindQueryParameter("form", true, false, "slave", ctx.QueryParams(), ¶ms.Slave) + err = runtime.BindQueryParameterWithOptions("form", true, false, "slave", ctx.QueryParams(), ¶ms.Slave, runtime.BindQueryParameterOptions{Type: "boolean", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter slave: %s", err)) } @@ -6728,69 +11460,69 @@ func (w *ServerInterfaceWrapper) GetServiceComplianceRulesets(ctx echo.Context) // ------------- Path parameter "svc_id" ------------- var svcId string - err = runtime.BindStyledParameterWithOptions("simple", "svc_id", ctx.Param("svc_id"), &svcId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "svc_id", ctx.Param("svc_id"), &svcId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter svc_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context var params GetServiceComplianceRulesetsParams // ------------- Optional query parameter "slave" ------------- - err = runtime.BindQueryParameter("form", true, false, "slave", ctx.QueryParams(), ¶ms.Slave) + err = runtime.BindQueryParameterWithOptions("form", true, false, "slave", ctx.QueryParams(), ¶ms.Slave, runtime.BindQueryParameterOptions{Type: "boolean", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter slave: %s", err)) } // ------------- Optional query parameter "props" ------------- - err = runtime.BindQueryParameter("form", true, false, "props", ctx.QueryParams(), ¶ms.Props) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) } // ------------- Optional query parameter "limit" ------------- - err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit) + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) } // ------------- Optional query parameter "offset" ------------- - err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset) + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) } // ------------- Optional query parameter "meta" ------------- - err = runtime.BindQueryParameter("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta) + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) } // ------------- Optional query parameter "stats" ------------- - err = runtime.BindQueryParameter("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats) + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) } // ------------- Optional query parameter "orderby" ------------- - err = runtime.BindQueryParameter("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) } // ------------- Optional query parameter "groupby" ------------- - err = runtime.BindQueryParameter("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) } @@ -6806,7 +11538,7 @@ func (w *ServerInterfaceWrapper) DeleteServiceComplianceRuleset(ctx echo.Context // ------------- Path parameter "svc_id" ------------- var svcId string - err = runtime.BindStyledParameterWithOptions("simple", "svc_id", ctx.Param("svc_id"), &svcId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "svc_id", ctx.Param("svc_id"), &svcId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter svc_id: %s", err)) } @@ -6814,20 +11546,20 @@ func (w *ServerInterfaceWrapper) DeleteServiceComplianceRuleset(ctx echo.Context // ------------- Path parameter "rset_id" ------------- var rsetId InPathRsetId - err = runtime.BindStyledParameterWithOptions("simple", "rset_id", ctx.Param("rset_id"), &rsetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "rset_id", ctx.Param("rset_id"), &rsetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter rset_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context var params DeleteServiceComplianceRulesetParams // ------------- Optional query parameter "slave" ------------- - err = runtime.BindQueryParameter("form", true, false, "slave", ctx.QueryParams(), ¶ms.Slave) + err = runtime.BindQueryParameterWithOptions("form", true, false, "slave", ctx.QueryParams(), ¶ms.Slave, runtime.BindQueryParameterOptions{Type: "boolean", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter slave: %s", err)) } @@ -6843,7 +11575,7 @@ func (w *ServerInterfaceWrapper) PostServiceComplianceRuleset(ctx echo.Context) // ------------- Path parameter "svc_id" ------------- var svcId string - err = runtime.BindStyledParameterWithOptions("simple", "svc_id", ctx.Param("svc_id"), &svcId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "svc_id", ctx.Param("svc_id"), &svcId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter svc_id: %s", err)) } @@ -6851,20 +11583,20 @@ func (w *ServerInterfaceWrapper) PostServiceComplianceRuleset(ctx echo.Context) // ------------- Path parameter "rset_id" ------------- var rsetId InPathRsetId - err = runtime.BindStyledParameterWithOptions("simple", "rset_id", ctx.Param("rset_id"), &rsetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "rset_id", ctx.Param("rset_id"), &rsetId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter rset_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context var params PostServiceComplianceRulesetParams // ------------- Optional query parameter "slave" ------------- - err = runtime.BindQueryParameter("form", true, false, "slave", ctx.QueryParams(), ¶ms.Slave) + err = runtime.BindQueryParameterWithOptions("form", true, false, "slave", ctx.QueryParams(), ¶ms.Slave, runtime.BindQueryParameterOptions{Type: "boolean", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter slave: %s", err)) } @@ -6880,62 +11612,62 @@ func (w *ServerInterfaceWrapper) GetServiceComplianceStatus(ctx echo.Context) er // ------------- Path parameter "svc_id" ------------- var svcId string - err = runtime.BindStyledParameterWithOptions("simple", "svc_id", ctx.Param("svc_id"), &svcId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "svc_id", ctx.Param("svc_id"), &svcId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter svc_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context var params GetServiceComplianceStatusParams // ------------- Optional query parameter "props" ------------- - err = runtime.BindQueryParameter("form", true, false, "props", ctx.QueryParams(), ¶ms.Props) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) } // ------------- Optional query parameter "limit" ------------- - err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit) + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) } // ------------- Optional query parameter "offset" ------------- - err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset) + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) } // ------------- Optional query parameter "meta" ------------- - err = runtime.BindQueryParameter("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta) + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) } // ------------- Optional query parameter "stats" ------------- - err = runtime.BindQueryParameter("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats) + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) } // ------------- Optional query parameter "orderby" ------------- - err = runtime.BindQueryParameter("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) } // ------------- Optional query parameter "groupby" ------------- - err = runtime.BindQueryParameter("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) } @@ -6951,62 +11683,62 @@ func (w *ServerInterfaceWrapper) GetServiceDisks(ctx echo.Context) error { // ------------- Path parameter "svc_id" ------------- var svcId string - err = runtime.BindStyledParameterWithOptions("simple", "svc_id", ctx.Param("svc_id"), &svcId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "svc_id", ctx.Param("svc_id"), &svcId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter svc_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context var params GetServiceDisksParams // ------------- Optional query parameter "props" ------------- - err = runtime.BindQueryParameter("form", true, false, "props", ctx.QueryParams(), ¶ms.Props) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) } // ------------- Optional query parameter "limit" ------------- - err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit) + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) } // ------------- Optional query parameter "offset" ------------- - err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset) + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) } // ------------- Optional query parameter "meta" ------------- - err = runtime.BindQueryParameter("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta) + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) } // ------------- Optional query parameter "stats" ------------- - err = runtime.BindQueryParameter("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats) + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) } // ------------- Optional query parameter "orderby" ------------- - err = runtime.BindQueryParameter("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) } // ------------- Optional query parameter "groupby" ------------- - err = runtime.BindQueryParameter("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) } @@ -7022,7 +11754,7 @@ func (w *ServerInterfaceWrapper) DeleteServiceInstance(ctx echo.Context) error { // ------------- Path parameter "svc_id" ------------- var svcId string - err = runtime.BindStyledParameterWithOptions("simple", "svc_id", ctx.Param("svc_id"), &svcId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "svc_id", ctx.Param("svc_id"), &svcId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter svc_id: %s", err)) } @@ -7030,14 +11762,14 @@ func (w *ServerInterfaceWrapper) DeleteServiceInstance(ctx echo.Context) error { // ------------- Path parameter "node_id" ------------- var nodeId string - err = runtime.BindStyledParameterWithOptions("simple", "node_id", ctx.Param("node_id"), &nodeId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "node_id", ctx.Param("node_id"), &nodeId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter node_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Invoke the callback with all the unmarshaled arguments err = w.Handler.DeleteServiceInstance(ctx, svcId, nodeId) @@ -7050,7 +11782,7 @@ func (w *ServerInterfaceWrapper) GetServiceInstance(ctx echo.Context) error { // ------------- Path parameter "svc_id" ------------- var svcId string - err = runtime.BindStyledParameterWithOptions("simple", "svc_id", ctx.Param("svc_id"), &svcId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "svc_id", ctx.Param("svc_id"), &svcId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter svc_id: %s", err)) } @@ -7058,62 +11790,62 @@ func (w *ServerInterfaceWrapper) GetServiceInstance(ctx echo.Context) error { // ------------- Path parameter "node_id" ------------- var nodeId string - err = runtime.BindStyledParameterWithOptions("simple", "node_id", ctx.Param("node_id"), &nodeId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "node_id", ctx.Param("node_id"), &nodeId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter node_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context var params GetServiceInstanceParams // ------------- Optional query parameter "props" ------------- - err = runtime.BindQueryParameter("form", true, false, "props", ctx.QueryParams(), ¶ms.Props) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) } // ------------- Optional query parameter "limit" ------------- - err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit) + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) } // ------------- Optional query parameter "offset" ------------- - err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset) + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) } // ------------- Optional query parameter "meta" ------------- - err = runtime.BindQueryParameter("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta) + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) } // ------------- Optional query parameter "stats" ------------- - err = runtime.BindQueryParameter("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats) + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) } // ------------- Optional query parameter "orderby" ------------- - err = runtime.BindQueryParameter("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) } // ------------- Optional query parameter "groupby" ------------- - err = runtime.BindQueryParameter("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) } @@ -7129,62 +11861,62 @@ func (w *ServerInterfaceWrapper) GetServiceNodes(ctx echo.Context) error { // ------------- Path parameter "svc_id" ------------- var svcId string - err = runtime.BindStyledParameterWithOptions("simple", "svc_id", ctx.Param("svc_id"), &svcId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "svc_id", ctx.Param("svc_id"), &svcId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter svc_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context var params GetServiceNodesParams // ------------- Optional query parameter "props" ------------- - err = runtime.BindQueryParameter("form", true, false, "props", ctx.QueryParams(), ¶ms.Props) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) } // ------------- Optional query parameter "limit" ------------- - err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit) + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) } // ------------- Optional query parameter "offset" ------------- - err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset) + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) } // ------------- Optional query parameter "meta" ------------- - err = runtime.BindQueryParameter("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta) + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) } // ------------- Optional query parameter "stats" ------------- - err = runtime.BindQueryParameter("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats) + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) } // ------------- Optional query parameter "orderby" ------------- - err = runtime.BindQueryParameter("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) } // ------------- Optional query parameter "groupby" ------------- - err = runtime.BindQueryParameter("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) } @@ -7200,7 +11932,7 @@ func (w *ServerInterfaceWrapper) GetServiceNode(ctx echo.Context) error { // ------------- Path parameter "svc_id" ------------- var svcId string - err = runtime.BindStyledParameterWithOptions("simple", "svc_id", ctx.Param("svc_id"), &svcId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "svc_id", ctx.Param("svc_id"), &svcId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter svc_id: %s", err)) } @@ -7208,62 +11940,62 @@ func (w *ServerInterfaceWrapper) GetServiceNode(ctx echo.Context) error { // ------------- Path parameter "node_id" ------------- var nodeId string - err = runtime.BindStyledParameterWithOptions("simple", "node_id", ctx.Param("node_id"), &nodeId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "node_id", ctx.Param("node_id"), &nodeId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter node_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context var params GetServiceNodeParams // ------------- Optional query parameter "props" ------------- - err = runtime.BindQueryParameter("form", true, false, "props", ctx.QueryParams(), ¶ms.Props) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) } // ------------- Optional query parameter "limit" ------------- - err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit) + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) } // ------------- Optional query parameter "offset" ------------- - err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset) + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) } // ------------- Optional query parameter "meta" ------------- - err = runtime.BindQueryParameter("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta) + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) } // ------------- Optional query parameter "stats" ------------- - err = runtime.BindQueryParameter("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats) + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) } // ------------- Optional query parameter "orderby" ------------- - err = runtime.BindQueryParameter("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) } // ------------- Optional query parameter "groupby" ------------- - err = runtime.BindQueryParameter("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) } @@ -7279,7 +12011,7 @@ func (w *ServerInterfaceWrapper) GetServiceNodeResources(ctx echo.Context) error // ------------- Path parameter "svc_id" ------------- var svcId string - err = runtime.BindStyledParameterWithOptions("simple", "svc_id", ctx.Param("svc_id"), &svcId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "svc_id", ctx.Param("svc_id"), &svcId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter svc_id: %s", err)) } @@ -7287,62 +12019,62 @@ func (w *ServerInterfaceWrapper) GetServiceNodeResources(ctx echo.Context) error // ------------- Path parameter "node_id" ------------- var nodeId string - err = runtime.BindStyledParameterWithOptions("simple", "node_id", ctx.Param("node_id"), &nodeId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "node_id", ctx.Param("node_id"), &nodeId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter node_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context var params GetServiceNodeResourcesParams // ------------- Optional query parameter "props" ------------- - err = runtime.BindQueryParameter("form", true, false, "props", ctx.QueryParams(), ¶ms.Props) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) } // ------------- Optional query parameter "limit" ------------- - err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit) + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) } // ------------- Optional query parameter "offset" ------------- - err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset) + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) } // ------------- Optional query parameter "meta" ------------- - err = runtime.BindQueryParameter("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta) + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) } // ------------- Optional query parameter "stats" ------------- - err = runtime.BindQueryParameter("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats) + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) } // ------------- Optional query parameter "orderby" ------------- - err = runtime.BindQueryParameter("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) } // ------------- Optional query parameter "groupby" ------------- - err = runtime.BindQueryParameter("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) } @@ -7358,7 +12090,7 @@ func (w *ServerInterfaceWrapper) GetServiceNodeResourceLogs(ctx echo.Context) er // ------------- Path parameter "svc_id" ------------- var svcId string - err = runtime.BindStyledParameterWithOptions("simple", "svc_id", ctx.Param("svc_id"), &svcId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "svc_id", ctx.Param("svc_id"), &svcId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter svc_id: %s", err)) } @@ -7366,62 +12098,62 @@ func (w *ServerInterfaceWrapper) GetServiceNodeResourceLogs(ctx echo.Context) er // ------------- Path parameter "node_id" ------------- var nodeId string - err = runtime.BindStyledParameterWithOptions("simple", "node_id", ctx.Param("node_id"), &nodeId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "node_id", ctx.Param("node_id"), &nodeId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter node_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context var params GetServiceNodeResourceLogsParams // ------------- Optional query parameter "props" ------------- - err = runtime.BindQueryParameter("form", true, false, "props", ctx.QueryParams(), ¶ms.Props) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) } // ------------- Optional query parameter "limit" ------------- - err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit) + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) } // ------------- Optional query parameter "offset" ------------- - err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset) + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) } // ------------- Optional query parameter "meta" ------------- - err = runtime.BindQueryParameter("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta) + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) } // ------------- Optional query parameter "stats" ------------- - err = runtime.BindQueryParameter("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats) + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) } // ------------- Optional query parameter "orderby" ------------- - err = runtime.BindQueryParameter("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) } // ------------- Optional query parameter "groupby" ------------- - err = runtime.BindQueryParameter("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) } @@ -7437,62 +12169,62 @@ func (w *ServerInterfaceWrapper) GetServiceResinfo(ctx echo.Context) error { // ------------- Path parameter "svc_id" ------------- var svcId string - err = runtime.BindStyledParameterWithOptions("simple", "svc_id", ctx.Param("svc_id"), &svcId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "svc_id", ctx.Param("svc_id"), &svcId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter svc_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context var params GetServiceResinfoParams // ------------- Optional query parameter "props" ------------- - err = runtime.BindQueryParameter("form", true, false, "props", ctx.QueryParams(), ¶ms.Props) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) } // ------------- Optional query parameter "limit" ------------- - err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit) + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) } // ------------- Optional query parameter "offset" ------------- - err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset) + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) } // ------------- Optional query parameter "meta" ------------- - err = runtime.BindQueryParameter("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta) + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) } // ------------- Optional query parameter "stats" ------------- - err = runtime.BindQueryParameter("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats) + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) } // ------------- Optional query parameter "orderby" ------------- - err = runtime.BindQueryParameter("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) } // ------------- Optional query parameter "groupby" ------------- - err = runtime.BindQueryParameter("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) } @@ -7508,62 +12240,62 @@ func (w *ServerInterfaceWrapper) GetServiceResources(ctx echo.Context) error { // ------------- Path parameter "svc_id" ------------- var svcId string - err = runtime.BindStyledParameterWithOptions("simple", "svc_id", ctx.Param("svc_id"), &svcId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "svc_id", ctx.Param("svc_id"), &svcId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter svc_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context var params GetServiceResourcesParams // ------------- Optional query parameter "props" ------------- - err = runtime.BindQueryParameter("form", true, false, "props", ctx.QueryParams(), ¶ms.Props) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) } // ------------- Optional query parameter "limit" ------------- - err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit) + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) } // ------------- Optional query parameter "offset" ------------- - err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset) + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) } // ------------- Optional query parameter "meta" ------------- - err = runtime.BindQueryParameter("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta) + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) } // ------------- Optional query parameter "stats" ------------- - err = runtime.BindQueryParameter("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats) + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) } // ------------- Optional query parameter "orderby" ------------- - err = runtime.BindQueryParameter("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) } // ------------- Optional query parameter "groupby" ------------- - err = runtime.BindQueryParameter("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) } @@ -7579,62 +12311,62 @@ func (w *ServerInterfaceWrapper) GetServiceResourceLogs(ctx echo.Context) error // ------------- Path parameter "svc_id" ------------- var svcId string - err = runtime.BindStyledParameterWithOptions("simple", "svc_id", ctx.Param("svc_id"), &svcId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "svc_id", ctx.Param("svc_id"), &svcId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter svc_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context var params GetServiceResourceLogsParams // ------------- Optional query parameter "props" ------------- - err = runtime.BindQueryParameter("form", true, false, "props", ctx.QueryParams(), ¶ms.Props) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) } // ------------- Optional query parameter "limit" ------------- - err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit) + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) } // ------------- Optional query parameter "offset" ------------- - err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset) + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) } // ------------- Optional query parameter "meta" ------------- - err = runtime.BindQueryParameter("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta) + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) } // ------------- Optional query parameter "stats" ------------- - err = runtime.BindQueryParameter("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats) + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) } // ------------- Optional query parameter "orderby" ------------- - err = runtime.BindQueryParameter("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) } // ------------- Optional query parameter "groupby" ------------- - err = runtime.BindQueryParameter("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) } @@ -7650,62 +12382,62 @@ func (w *ServerInterfaceWrapper) GetServiceTags(ctx echo.Context) error { // ------------- Path parameter "svc_id" ------------- var svcId string - err = runtime.BindStyledParameterWithOptions("simple", "svc_id", ctx.Param("svc_id"), &svcId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "svc_id", ctx.Param("svc_id"), &svcId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter svc_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context var params GetServiceTagsParams // ------------- Optional query parameter "props" ------------- - err = runtime.BindQueryParameter("form", true, false, "props", ctx.QueryParams(), ¶ms.Props) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) } // ------------- Optional query parameter "limit" ------------- - err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit) + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) } // ------------- Optional query parameter "offset" ------------- - err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset) + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) } // ------------- Optional query parameter "meta" ------------- - err = runtime.BindQueryParameter("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta) + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) } // ------------- Optional query parameter "stats" ------------- - err = runtime.BindQueryParameter("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats) + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) } // ------------- Optional query parameter "orderby" ------------- - err = runtime.BindQueryParameter("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) } // ------------- Optional query parameter "groupby" ------------- - err = runtime.BindQueryParameter("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) } @@ -7719,9 +12451,9 @@ func (w *ServerInterfaceWrapper) GetServiceTags(ctx echo.Context) error { func (w *ServerInterfaceWrapper) DeleteServicesInstances(ctx echo.Context) error { var err error - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Invoke the callback with all the unmarshaled arguments err = w.Handler.DeleteServicesInstances(ctx) @@ -7732,57 +12464,64 @@ func (w *ServerInterfaceWrapper) DeleteServicesInstances(ctx echo.Context) error func (w *ServerInterfaceWrapper) GetServicesInstances(ctx echo.Context) error { var err error - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context var params GetServicesInstancesParams // ------------- Optional query parameter "props" ------------- - err = runtime.BindQueryParameter("form", true, false, "props", ctx.QueryParams(), ¶ms.Props) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) } // ------------- Optional query parameter "limit" ------------- - err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit) + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) } // ------------- Optional query parameter "offset" ------------- - err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset) + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) } // ------------- Optional query parameter "meta" ------------- - err = runtime.BindQueryParameter("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta) + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) } // ------------- Optional query parameter "stats" ------------- - err = runtime.BindQueryParameter("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats) + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) } // ------------- Optional query parameter "orderby" ------------- - err = runtime.BindQueryParameter("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) } + // ------------- Optional query parameter "filter" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "filter", ctx.QueryParams(), ¶ms.Filter, runtime.BindQueryParameterOptions{Type: "array", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter filter: %s", err)) + } + // ------------- Optional query parameter "groupby" ------------- - err = runtime.BindQueryParameter("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) } @@ -7798,62 +12537,62 @@ func (w *ServerInterfaceWrapper) GetServicesInstance(ctx echo.Context) error { // ------------- Path parameter "svc_id" ------------- var svcId string - err = runtime.BindStyledParameterWithOptions("simple", "svc_id", ctx.Param("svc_id"), &svcId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "svc_id", ctx.Param("svc_id"), &svcId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter svc_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context var params GetServicesInstanceParams // ------------- Optional query parameter "props" ------------- - err = runtime.BindQueryParameter("form", true, false, "props", ctx.QueryParams(), ¶ms.Props) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) } // ------------- Optional query parameter "limit" ------------- - err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit) + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) } // ------------- Optional query parameter "offset" ------------- - err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset) + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) } // ------------- Optional query parameter "meta" ------------- - err = runtime.BindQueryParameter("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta) + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) } // ------------- Optional query parameter "stats" ------------- - err = runtime.BindQueryParameter("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats) + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) } // ------------- Optional query parameter "orderby" ------------- - err = runtime.BindQueryParameter("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) } // ------------- Optional query parameter "groupby" ------------- - err = runtime.BindQueryParameter("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) } @@ -7867,57 +12606,57 @@ func (w *ServerInterfaceWrapper) GetServicesInstance(ctx echo.Context) error { func (w *ServerInterfaceWrapper) GetServicesInstancesStatusLog(ctx echo.Context) error { var err error - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context var params GetServicesInstancesStatusLogParams // ------------- Optional query parameter "props" ------------- - err = runtime.BindQueryParameter("form", true, false, "props", ctx.QueryParams(), ¶ms.Props) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) } // ------------- Optional query parameter "limit" ------------- - err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit) + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) } // ------------- Optional query parameter "offset" ------------- - err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset) + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) } // ------------- Optional query parameter "meta" ------------- - err = runtime.BindQueryParameter("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta) + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) } // ------------- Optional query parameter "stats" ------------- - err = runtime.BindQueryParameter("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats) + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) } // ------------- Optional query parameter "orderby" ------------- - err = runtime.BindQueryParameter("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) } // ------------- Optional query parameter "groupby" ------------- - err = runtime.BindQueryParameter("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) } @@ -7931,57 +12670,57 @@ func (w *ServerInterfaceWrapper) GetServicesInstancesStatusLog(ctx echo.Context) func (w *ServerInterfaceWrapper) GetServicesStatusLog(ctx echo.Context) error { var err error - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context var params GetServicesStatusLogParams // ------------- Optional query parameter "props" ------------- - err = runtime.BindQueryParameter("form", true, false, "props", ctx.QueryParams(), ¶ms.Props) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) } // ------------- Optional query parameter "limit" ------------- - err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit) + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) } // ------------- Optional query parameter "offset" ------------- - err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset) + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) } // ------------- Optional query parameter "meta" ------------- - err = runtime.BindQueryParameter("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta) + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) } // ------------- Optional query parameter "stats" ------------- - err = runtime.BindQueryParameter("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats) + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) } // ------------- Optional query parameter "orderby" ------------- - err = runtime.BindQueryParameter("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) } // ------------- Optional query parameter "groupby" ------------- - err = runtime.BindQueryParameter("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) } @@ -7995,9 +12734,9 @@ func (w *ServerInterfaceWrapper) GetServicesStatusLog(ctx echo.Context) error { func (w *ServerInterfaceWrapper) DeleteTags(ctx echo.Context) error { var err error - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Invoke the callback with all the unmarshaled arguments err = w.Handler.DeleteTags(ctx) @@ -8008,57 +12747,57 @@ func (w *ServerInterfaceWrapper) DeleteTags(ctx echo.Context) error { func (w *ServerInterfaceWrapper) GetTags(ctx echo.Context) error { var err error - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context var params GetTagsParams // ------------- Optional query parameter "props" ------------- - err = runtime.BindQueryParameter("form", true, false, "props", ctx.QueryParams(), ¶ms.Props) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) } // ------------- Optional query parameter "limit" ------------- - err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit) + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) } // ------------- Optional query parameter "offset" ------------- - err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset) + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) } // ------------- Optional query parameter "meta" ------------- - err = runtime.BindQueryParameter("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta) + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) } // ------------- Optional query parameter "stats" ------------- - err = runtime.BindQueryParameter("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats) + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) } // ------------- Optional query parameter "orderby" ------------- - err = runtime.BindQueryParameter("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) } // ------------- Optional query parameter "groupby" ------------- - err = runtime.BindQueryParameter("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) } @@ -8072,9 +12811,9 @@ func (w *ServerInterfaceWrapper) GetTags(ctx echo.Context) error { func (w *ServerInterfaceWrapper) PostTags(ctx echo.Context) error { var err error - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Invoke the callback with all the unmarshaled arguments err = w.Handler.PostTags(ctx) @@ -8085,9 +12824,9 @@ func (w *ServerInterfaceWrapper) PostTags(ctx echo.Context) error { func (w *ServerInterfaceWrapper) DeleteTagsNodes(ctx echo.Context) error { var err error - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Invoke the callback with all the unmarshaled arguments err = w.Handler.DeleteTagsNodes(ctx) @@ -8098,57 +12837,57 @@ func (w *ServerInterfaceWrapper) DeleteTagsNodes(ctx echo.Context) error { func (w *ServerInterfaceWrapper) GetTagsNodes(ctx echo.Context) error { var err error - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context var params GetTagsNodesParams // ------------- Optional query parameter "props" ------------- - err = runtime.BindQueryParameter("form", true, false, "props", ctx.QueryParams(), ¶ms.Props) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) } // ------------- Optional query parameter "limit" ------------- - err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit) + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) } // ------------- Optional query parameter "offset" ------------- - err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset) + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) } // ------------- Optional query parameter "meta" ------------- - err = runtime.BindQueryParameter("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta) + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) } // ------------- Optional query parameter "stats" ------------- - err = runtime.BindQueryParameter("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats) + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) } // ------------- Optional query parameter "orderby" ------------- - err = runtime.BindQueryParameter("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) } // ------------- Optional query parameter "groupby" ------------- - err = runtime.BindQueryParameter("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) } @@ -8162,9 +12901,9 @@ func (w *ServerInterfaceWrapper) GetTagsNodes(ctx echo.Context) error { func (w *ServerInterfaceWrapper) PostTagsNodes(ctx echo.Context) error { var err error - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Invoke the callback with all the unmarshaled arguments err = w.Handler.PostTagsNodes(ctx) @@ -8175,9 +12914,9 @@ func (w *ServerInterfaceWrapper) PostTagsNodes(ctx echo.Context) error { func (w *ServerInterfaceWrapper) DeleteTagsServices(ctx echo.Context) error { var err error - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Invoke the callback with all the unmarshaled arguments err = w.Handler.DeleteTagsServices(ctx) @@ -8188,57 +12927,57 @@ func (w *ServerInterfaceWrapper) DeleteTagsServices(ctx echo.Context) error { func (w *ServerInterfaceWrapper) GetTagsServices(ctx echo.Context) error { var err error - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context var params GetTagsServicesParams // ------------- Optional query parameter "props" ------------- - err = runtime.BindQueryParameter("form", true, false, "props", ctx.QueryParams(), ¶ms.Props) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) } // ------------- Optional query parameter "limit" ------------- - err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit) + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) } // ------------- Optional query parameter "offset" ------------- - err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset) + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) } // ------------- Optional query parameter "meta" ------------- - err = runtime.BindQueryParameter("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta) + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) } // ------------- Optional query parameter "stats" ------------- - err = runtime.BindQueryParameter("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats) + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) } // ------------- Optional query parameter "orderby" ------------- - err = runtime.BindQueryParameter("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) } // ------------- Optional query parameter "groupby" ------------- - err = runtime.BindQueryParameter("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) } @@ -8252,9 +12991,9 @@ func (w *ServerInterfaceWrapper) GetTagsServices(ctx echo.Context) error { func (w *ServerInterfaceWrapper) PostTagsServices(ctx echo.Context) error { var err error - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Invoke the callback with all the unmarshaled arguments err = w.Handler.PostTagsServices(ctx) @@ -8267,14 +13006,14 @@ func (w *ServerInterfaceWrapper) DeleteTag(ctx echo.Context) error { // ------------- Path parameter "tag_id" ------------- var tagId int - err = runtime.BindStyledParameterWithOptions("simple", "tag_id", ctx.Param("tag_id"), &tagId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "tag_id", ctx.Param("tag_id"), &tagId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter tag_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Invoke the callback with all the unmarshaled arguments err = w.Handler.DeleteTag(ctx, tagId) @@ -8287,20 +13026,20 @@ func (w *ServerInterfaceWrapper) GetTag(ctx echo.Context) error { // ------------- Path parameter "tag_id" ------------- var tagId int - err = runtime.BindStyledParameterWithOptions("simple", "tag_id", ctx.Param("tag_id"), &tagId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "tag_id", ctx.Param("tag_id"), &tagId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter tag_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context var params GetTagParams // ------------- Optional query parameter "props" ------------- - err = runtime.BindQueryParameter("form", true, false, "props", ctx.QueryParams(), ¶ms.Props) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) } @@ -8316,14 +13055,14 @@ func (w *ServerInterfaceWrapper) PostTag(ctx echo.Context) error { // ------------- Path parameter "tag_id" ------------- var tagId int - err = runtime.BindStyledParameterWithOptions("simple", "tag_id", ctx.Param("tag_id"), &tagId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "tag_id", ctx.Param("tag_id"), &tagId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter tag_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Invoke the callback with all the unmarshaled arguments err = w.Handler.PostTag(ctx, tagId) @@ -8336,34 +13075,34 @@ func (w *ServerInterfaceWrapper) GetTagNodes(ctx echo.Context) error { // ------------- Path parameter "tag_id" ------------- var tagId int - err = runtime.BindStyledParameterWithOptions("simple", "tag_id", ctx.Param("tag_id"), &tagId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "tag_id", ctx.Param("tag_id"), &tagId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter tag_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context var params GetTagNodesParams // ------------- Optional query parameter "props" ------------- - err = runtime.BindQueryParameter("form", true, false, "props", ctx.QueryParams(), ¶ms.Props) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) } // ------------- Optional query parameter "limit" ------------- - err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit) + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) } // ------------- Optional query parameter "offset" ------------- - err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset) + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) } @@ -8379,7 +13118,7 @@ func (w *ServerInterfaceWrapper) DeleteTagNode(ctx echo.Context) error { // ------------- Path parameter "tag_id" ------------- var tagId int - err = runtime.BindStyledParameterWithOptions("simple", "tag_id", ctx.Param("tag_id"), &tagId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "tag_id", ctx.Param("tag_id"), &tagId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter tag_id: %s", err)) } @@ -8387,14 +13126,14 @@ func (w *ServerInterfaceWrapper) DeleteTagNode(ctx echo.Context) error { // ------------- Path parameter "node_id" ------------- var nodeId string - err = runtime.BindStyledParameterWithOptions("simple", "node_id", ctx.Param("node_id"), &nodeId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "node_id", ctx.Param("node_id"), &nodeId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter node_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Invoke the callback with all the unmarshaled arguments err = w.Handler.DeleteTagNode(ctx, tagId, nodeId) @@ -8407,7 +13146,7 @@ func (w *ServerInterfaceWrapper) PostTagNode(ctx echo.Context) error { // ------------- Path parameter "tag_id" ------------- var tagId int - err = runtime.BindStyledParameterWithOptions("simple", "tag_id", ctx.Param("tag_id"), &tagId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "tag_id", ctx.Param("tag_id"), &tagId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter tag_id: %s", err)) } @@ -8415,14 +13154,14 @@ func (w *ServerInterfaceWrapper) PostTagNode(ctx echo.Context) error { // ------------- Path parameter "node_id" ------------- var nodeId string - err = runtime.BindStyledParameterWithOptions("simple", "node_id", ctx.Param("node_id"), &nodeId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "node_id", ctx.Param("node_id"), &nodeId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter node_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Invoke the callback with all the unmarshaled arguments err = w.Handler.PostTagNode(ctx, tagId, nodeId) @@ -8435,62 +13174,62 @@ func (w *ServerInterfaceWrapper) GetTagServices(ctx echo.Context) error { // ------------- Path parameter "tag_id" ------------- var tagId int - err = runtime.BindStyledParameterWithOptions("simple", "tag_id", ctx.Param("tag_id"), &tagId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "tag_id", ctx.Param("tag_id"), &tagId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter tag_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Parameter object where we will unmarshal all parameters from the context var params GetTagServicesParams // ------------- Optional query parameter "props" ------------- - err = runtime.BindQueryParameter("form", true, false, "props", ctx.QueryParams(), ¶ms.Props) + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) } // ------------- Optional query parameter "limit" ------------- - err = runtime.BindQueryParameter("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit) + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) } // ------------- Optional query parameter "offset" ------------- - err = runtime.BindQueryParameter("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset) + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) } // ------------- Optional query parameter "meta" ------------- - err = runtime.BindQueryParameter("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta) + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) } // ------------- Optional query parameter "stats" ------------- - err = runtime.BindQueryParameter("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats) + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) } // ------------- Optional query parameter "orderby" ------------- - err = runtime.BindQueryParameter("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) } // ------------- Optional query parameter "groupby" ------------- - err = runtime.BindQueryParameter("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby) + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) } @@ -8506,7 +13245,7 @@ func (w *ServerInterfaceWrapper) DeleteTagService(ctx echo.Context) error { // ------------- Path parameter "tag_id" ------------- var tagId int - err = runtime.BindStyledParameterWithOptions("simple", "tag_id", ctx.Param("tag_id"), &tagId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "tag_id", ctx.Param("tag_id"), &tagId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter tag_id: %s", err)) } @@ -8514,14 +13253,14 @@ func (w *ServerInterfaceWrapper) DeleteTagService(ctx echo.Context) error { // ------------- Path parameter "svc_id" ------------- var svcId string - err = runtime.BindStyledParameterWithOptions("simple", "svc_id", ctx.Param("svc_id"), &svcId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "svc_id", ctx.Param("svc_id"), &svcId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter svc_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Invoke the callback with all the unmarshaled arguments err = w.Handler.DeleteTagService(ctx, tagId, svcId) @@ -8534,7 +13273,7 @@ func (w *ServerInterfaceWrapper) PostTagService(ctx echo.Context) error { // ------------- Path parameter "tag_id" ------------- var tagId int - err = runtime.BindStyledParameterWithOptions("simple", "tag_id", ctx.Param("tag_id"), &tagId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "tag_id", ctx.Param("tag_id"), &tagId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "integer", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter tag_id: %s", err)) } @@ -8542,20 +13281,248 @@ func (w *ServerInterfaceWrapper) PostTagService(ctx echo.Context) error { // ------------- Path parameter "svc_id" ------------- var svcId string - err = runtime.BindStyledParameterWithOptions("simple", "svc_id", ctx.Param("svc_id"), &svcId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true}) + err = runtime.BindStyledParameterWithOptions("simple", "svc_id", ctx.Param("svc_id"), &svcId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) if err != nil { return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter svc_id: %s", err)) } - ctx.Set(BasicAuthScopes, []string{}) + ctx.Set(string(BasicAuthScopes), []string{}) - ctx.Set(BearerAuthScopes, []string{}) + ctx.Set(string(BearerAuthScopes), []string{}) // Invoke the callback with all the unmarshaled arguments err = w.Handler.PostTagService(ctx, tagId, svcId) return err } +// GetUsers converts echo context to params. +func (w *ServerInterfaceWrapper) GetUsers(ctx echo.Context) error { + var err error + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Parameter object where we will unmarshal all parameters from the context + var params GetUsersParams + // ------------- Optional query parameter "props" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) + } + + // ------------- Optional query parameter "limit" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) + } + + // ------------- Optional query parameter "offset" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) + } + + // ------------- Optional query parameter "meta" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) + } + + // ------------- Optional query parameter "stats" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) + } + + // ------------- Optional query parameter "orderby" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) + } + + // ------------- Optional query parameter "groupby" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) + } + + // ------------- Optional query parameter "filter" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "filter", ctx.QueryParams(), ¶ms.Filter, runtime.BindQueryParameterOptions{Type: "array", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter filter: %s", err)) + } + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.GetUsers(ctx, params) + return err +} + +// PostUsers converts echo context to params. +func (w *ServerInterfaceWrapper) PostUsers(ctx echo.Context) error { + var err error + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.PostUsers(ctx) + return err +} + +// PostUserSelfPassword converts echo context to params. +func (w *ServerInterfaceWrapper) PostUserSelfPassword(ctx echo.Context) error { + var err error + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.PostUserSelfPassword(ctx) + return err +} + +// GetUser converts echo context to params. +func (w *ServerInterfaceWrapper) GetUser(ctx echo.Context) error { + var err error + // ------------- Path parameter "user_id" ------------- + var userId string + + err = runtime.BindStyledParameterWithOptions("simple", "user_id", ctx.Param("user_id"), &userId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter user_id: %s", err)) + } + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Parameter object where we will unmarshal all parameters from the context + var params GetUserParams + // ------------- Optional query parameter "props" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) + } + + // ------------- Optional query parameter "limit" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) + } + + // ------------- Optional query parameter "offset" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) + } + + // ------------- Optional query parameter "meta" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) + } + + // ------------- Optional query parameter "stats" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) + } + + // ------------- Optional query parameter "orderby" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) + } + + // ------------- Optional query parameter "groupby" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) + } + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.GetUser(ctx, userId, params) + return err +} + +// PostUser converts echo context to params. +func (w *ServerInterfaceWrapper) PostUser(ctx echo.Context) error { + var err error + // ------------- Path parameter "user_id" ------------- + var userId string + + err = runtime.BindStyledParameterWithOptions("simple", "user_id", ctx.Param("user_id"), &userId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter user_id: %s", err)) + } + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.PostUser(ctx, userId) + return err +} + +// GetUserPrefs converts echo context to params. +func (w *ServerInterfaceWrapper) GetUserPrefs(ctx echo.Context) error { + var err error + // ------------- Path parameter "user_id" ------------- + var userId string + + err = runtime.BindStyledParameterWithOptions("simple", "user_id", ctx.Param("user_id"), &userId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter user_id: %s", err)) + } + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.GetUserPrefs(ctx, userId) + return err +} + +// PostUserPrefs converts echo context to params. +func (w *ServerInterfaceWrapper) PostUserPrefs(ctx echo.Context) error { + var err error + // ------------- Path parameter "user_id" ------------- + var userId string + + err = runtime.BindStyledParameterWithOptions("simple", "user_id", ctx.Param("user_id"), &userId, runtime.BindStyledParameterOptions{ParamLocation: runtime.ParamLocationPath, Explode: false, Required: true, Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter user_id: %s", err)) + } + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.PostUserPrefs(ctx, userId) + return err +} + // GetVersion converts echo context to params. func (w *ServerInterfaceWrapper) GetVersion(ctx echo.Context) error { var err error @@ -8565,6 +13532,84 @@ func (w *ServerInterfaceWrapper) GetVersion(ctx echo.Context) error { return err } +// GetWorkflows converts echo context to params. +func (w *ServerInterfaceWrapper) GetWorkflows(ctx echo.Context) error { + var err error + + ctx.Set(string(BasicAuthScopes), []string{}) + + ctx.Set(string(BearerAuthScopes), []string{}) + + // Parameter object where we will unmarshal all parameters from the context + var params GetWorkflowsParams + // ------------- Optional query parameter "props" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "props", ctx.QueryParams(), ¶ms.Props, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter props: %s", err)) + } + + // ------------- Optional query parameter "limit" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "limit", ctx.QueryParams(), ¶ms.Limit, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter limit: %s", err)) + } + + // ------------- Optional query parameter "offset" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "offset", ctx.QueryParams(), ¶ms.Offset, runtime.BindQueryParameterOptions{Type: "integer", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter offset: %s", err)) + } + + // ------------- Optional query parameter "meta" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "meta", ctx.QueryParams(), ¶ms.Meta, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter meta: %s", err)) + } + + // ------------- Optional query parameter "stats" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "stats", ctx.QueryParams(), ¶ms.Stats, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter stats: %s", err)) + } + + // ------------- Optional query parameter "orderby" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "orderby", ctx.QueryParams(), ¶ms.Orderby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter orderby: %s", err)) + } + + // ------------- Optional query parameter "filter" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "filter", ctx.QueryParams(), ¶ms.Filter, runtime.BindQueryParameterOptions{Type: "array", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter filter: %s", err)) + } + + // ------------- Optional query parameter "groupby" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "groupby", ctx.QueryParams(), ¶ms.Groupby, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter groupby: %s", err)) + } + + // ------------- Optional query parameter "assigned" ------------- + + err = runtime.BindQueryParameterWithOptions("form", true, false, "assigned", ctx.QueryParams(), ¶ms.Assigned, runtime.BindQueryParameterOptions{Type: "string", Format: ""}) + if err != nil { + return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter assigned: %s", err)) + } + + // Invoke the callback with all the unmarshaled arguments + err = w.Handler.GetWorkflows(ctx, params) + return err +} + // This is a simple interface which specifies echo.Route addition functions which // are present on both echo.Echo and echo.Group, since we want to allow using // either of them for path registration @@ -8580,389 +13625,843 @@ type EchoRouter interface { TRACE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route } +// RegisterHandlersOptions configures RegisterHandlersWithOptions. +type RegisterHandlersOptions struct { + // BaseURL is prepended to every registered path so the API can be served + // under a prefix. + BaseURL string + // OperationMiddlewares lets the caller attach per-operation middleware at + // registration time. The map key is the OpenAPI `operationId` value as it + // appears in the spec (the raw, un-normalized form). Operations that have + // no entry are registered with no extra middleware. A nil map disables + // per-operation middleware entirely. + OperationMiddlewares map[string][]echo.MiddlewareFunc +} + // RegisterHandlers adds each server route to the EchoRouter. func RegisterHandlers(router EchoRouter, si ServerInterface) { - RegisterHandlersWithBaseURL(router, si, "") + RegisterHandlersWithOptions(router, si, RegisterHandlersOptions{}) } -// Registers handlers, and prepends BaseURL to the paths, so that the paths -// can be served under a prefix. +// RegisterHandlersWithBaseURL registers handlers and prepends BaseURL to the +// paths so the API can be served under a prefix. func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL string) { + RegisterHandlersWithOptions(router, si, RegisterHandlersOptions{BaseURL: baseURL}) +} + +// RegisterHandlersWithOptions registers handlers using the supplied options, +// including any per-operation middleware. +func RegisterHandlersWithOptions(router EchoRouter, si ServerInterface, options RegisterHandlersOptions) { wrapper := ServerInterfaceWrapper{ Handler: si, } - router.GET(baseURL+"/actions", wrapper.GetActions) - router.POST(baseURL+"/actions", wrapper.PostActions) - router.DELETE(baseURL+"/actions/:id", wrapper.DeleteAction) - router.GET(baseURL+"/actions/:id", wrapper.GetAction) - router.GET(baseURL+"/alert_event", wrapper.GetAlertEvent) - router.DELETE(baseURL+"/alerts", wrapper.DeleteAlerts) - router.GET(baseURL+"/alerts", wrapper.GetAlerts) - router.POST(baseURL+"/alerts", wrapper.PostAlerts) - router.DELETE(baseURL+"/alerts/:id", wrapper.DeleteAlert) - router.GET(baseURL+"/alerts/:id", wrapper.GetAlert) - router.POST(baseURL+"/alerts/:id", wrapper.PostAlert) - router.DELETE(baseURL+"/apps", wrapper.DeleteApps) - router.GET(baseURL+"/apps", wrapper.GetApps) - router.POST(baseURL+"/apps", wrapper.PostApps) - router.DELETE(baseURL+"/apps/:app_id", wrapper.DeleteApp) - router.GET(baseURL+"/apps/:app_id", wrapper.GetApp) - router.POST(baseURL+"/apps/:app_id", wrapper.PostApp) - router.GET(baseURL+"/apps/:app_id/am_i_responsible", wrapper.GetAppAmIResponsible) - router.GET(baseURL+"/apps/:app_id/nodes", wrapper.GetAppNodes) - router.GET(baseURL+"/apps/:app_id/publications", wrapper.GetAppPublications) - router.DELETE(baseURL+"/apps/:app_id/publications/:group_id", wrapper.DeleteAppPublication) - router.POST(baseURL+"/apps/:app_id/publications/:group_id", wrapper.PostAppPublication) - router.GET(baseURL+"/apps/:app_id/quotas", wrapper.GetAppQuotas) - router.GET(baseURL+"/apps/:app_id/responsibles", wrapper.GetAppResponsibles) - router.DELETE(baseURL+"/apps/:app_id/responsibles/:group_id", wrapper.DeleteAppResponsible) - router.POST(baseURL+"/apps/:app_id/responsibles/:group_id", wrapper.PostAppResponsible) - router.GET(baseURL+"/apps/:app_id/services", wrapper.GetAppServices) - router.DELETE(baseURL+"/apps_publications", wrapper.DeleteAppsPublications) - router.POST(baseURL+"/apps_publications", wrapper.PostAppsPublications) - router.DELETE(baseURL+"/apps_responsibles", wrapper.DeleteAppsResponsibles) - router.POST(baseURL+"/apps_responsibles", wrapper.PostAppsResponsibles) - router.GET(baseURL+"/arrays", wrapper.GetArrays) - router.POST(baseURL+"/auth/node", wrapper.PostAuthNode) - router.DELETE(baseURL+"/disks", wrapper.DeleteDisks) - router.GET(baseURL+"/disks", wrapper.GetDisks) - router.POST(baseURL+"/disks", wrapper.PostDisks) - router.DELETE(baseURL+"/disks/:disk_id", wrapper.DeleteDisk) - router.GET(baseURL+"/disks/:disk_id", wrapper.GetDisk) - router.DELETE(baseURL+"/filters", wrapper.DeleteFilters) - router.GET(baseURL+"/filters", wrapper.GetFilters) - router.POST(baseURL+"/filters", wrapper.PostFilters) - router.DELETE(baseURL+"/filters/:filter_id", wrapper.DeleteFilter) - router.GET(baseURL+"/filters/:filter_id", wrapper.GetFilter) - router.POST(baseURL+"/filters/:filter_id", wrapper.PostFilter) - router.DELETE(baseURL+"/filtersets", wrapper.DeleteFiltersets) - router.GET(baseURL+"/filtersets", wrapper.GetFiltersets) - router.POST(baseURL+"/filtersets", wrapper.PostFiltersets) - router.DELETE(baseURL+"/filtersets/:filterset_id", wrapper.DeleteFilterset) - router.GET(baseURL+"/filtersets/:filterset_id", wrapper.GetFilterset) - router.POST(baseURL+"/filtersets/:filterset_id", wrapper.PostFilterset) - router.GET(baseURL+"/filtersets/:filterset_id/export", wrapper.GetFiltersetExport) - router.GET(baseURL+"/filtersets/:filterset_id/filters", wrapper.GetFiltersetFilters) - router.DELETE(baseURL+"/filtersets/:filterset_id/filters/:f_id", wrapper.DeleteFiltersetFilter) - router.POST(baseURL+"/filtersets/:filterset_id/filters/:f_id", wrapper.PostFiltersetFilter) - router.GET(baseURL+"/filtersets/:filterset_id/filtersets", wrapper.GetFiltersetFiltersets) - router.DELETE(baseURL+"/filtersets/:filterset_id/filtersets/:child_id", wrapper.DeleteFiltersetFilterset) - router.POST(baseURL+"/filtersets/:filterset_id/filtersets/:child_id", wrapper.PostFiltersetFilterset) - router.GET(baseURL+"/filtersets/:filterset_id/nodes", wrapper.GetFiltersetNodes) - router.GET(baseURL+"/filtersets/:filterset_id/services", wrapper.GetFiltersetServices) - router.GET(baseURL+"/filtersets/:filterset_id/usage", wrapper.GetFiltersetUsage) - router.DELETE(baseURL+"/filtersets_filters", wrapper.DeleteFiltersetsFilters) - router.POST(baseURL+"/filtersets_filters", wrapper.PostFiltersetsFilters) - router.DELETE(baseURL+"/filtersets_filtersets", wrapper.DeleteFiltersetsFiltersets) - router.POST(baseURL+"/filtersets_filtersets", wrapper.PostFiltersetsFiltersets) - router.GET(baseURL+"/frontend/hidden_menu_entries", wrapper.GetFrontendHiddenMenuEntries) - router.DELETE(baseURL+"/groups", wrapper.DeleteGroups) - router.GET(baseURL+"/groups", wrapper.GetGroups) - router.POST(baseURL+"/groups", wrapper.PostGroups) - router.DELETE(baseURL+"/groups/:group_id", wrapper.DeleteGroup) - router.GET(baseURL+"/groups/:group_id", wrapper.GetGroup) - router.POST(baseURL+"/groups/:group_id", wrapper.PostGroup) - router.GET(baseURL+"/groups/:group_id/apps", wrapper.GetGroupApps) - router.DELETE(baseURL+"/groups/:group_id/hidden_menu_entries", wrapper.DeleteGroupHiddenMenuEntries) - router.GET(baseURL+"/groups/:group_id/hidden_menu_entries", wrapper.GetGroupHiddenMenuEntries) - router.POST(baseURL+"/groups/:group_id/hidden_menu_entries", wrapper.PostGroupHiddenMenuEntries) - router.GET(baseURL+"/groups/:group_id/modulesets", wrapper.GetGroupModulesets) - router.GET(baseURL+"/groups/:group_id/nodes", wrapper.GetGroupNodes) - router.GET(baseURL+"/groups/:group_id/rulesets", wrapper.GetGroupRulesets) - router.GET(baseURL+"/groups/:group_id/services", wrapper.GetGroupServices) - router.GET(baseURL+"/groups/:group_id/users", wrapper.GetGroupUsers) - router.DELETE(baseURL+"/ips", wrapper.DeleteIps) - router.GET(baseURL+"/ips", wrapper.GetIps) - router.DELETE(baseURL+"/ips/:id", wrapper.DeleteIp) - router.GET(baseURL+"/ips/:id", wrapper.GetIp) - router.GET(baseURL+"/logs", wrapper.GetLogs) - router.POST(baseURL+"/logs", wrapper.PostLogs) - router.GET(baseURL+"/logs/:log_id", wrapper.GetLog) - router.DELETE(baseURL+"/nodes", wrapper.DeleteNodes) - router.GET(baseURL+"/nodes", wrapper.GetNodes) - router.POST(baseURL+"/nodes", wrapper.PostNodes) - router.GET(baseURL+"/nodes/hardware", wrapper.GetNodesHardware) - router.GET(baseURL+"/nodes/hbas", wrapper.GetNodesHbas) - router.DELETE(baseURL+"/nodes/:node_id", wrapper.DeleteNode) - router.GET(baseURL+"/nodes/:node_id", wrapper.GetNode) - router.POST(baseURL+"/nodes/:node_id", wrapper.PostNode) - router.GET(baseURL+"/nodes/:node_id/alerts", wrapper.GetNodeAlerts) - router.GET(baseURL+"/nodes/:node_id/am_i_responsible", wrapper.GetNodeAmIResponsible) - router.GET(baseURL+"/nodes/:node_id/candidate_tags", wrapper.GetNodeCandidateTags) - router.GET(baseURL+"/nodes/:node_id/checks", wrapper.GetNodeChecks) - router.GET(baseURL+"/nodes/:node_id/compliance/candidate_modulesets", wrapper.GetNodeComplianceCandidateModulesets) - router.GET(baseURL+"/nodes/:node_id/compliance/candidate_rulesets", wrapper.GetNodeComplianceCandidateRulesets) - router.GET(baseURL+"/nodes/:node_id/compliance/logs", wrapper.GetNodeComplianceLogs) - router.GET(baseURL+"/nodes/:node_id/compliance/modulesets", wrapper.GetNodeComplianceModulesets) - router.DELETE(baseURL+"/nodes/:node_id/compliance/modulesets/:mset_id", wrapper.DeleteNodeComplianceModuleset) - router.POST(baseURL+"/nodes/:node_id/compliance/modulesets/:mset_id", wrapper.PostNodeComplianceModuleset) - router.GET(baseURL+"/nodes/:node_id/compliance/rulesets", wrapper.GetNodeComplianceRulesets) - router.DELETE(baseURL+"/nodes/:node_id/compliance/rulesets/:rset_id", wrapper.DeleteNodeComplianceRuleset) - router.POST(baseURL+"/nodes/:node_id/compliance/rulesets/:rset_id", wrapper.PostNodeComplianceRuleset) - router.GET(baseURL+"/nodes/:node_id/compliance/status", wrapper.GetNodeComplianceStatus) - router.GET(baseURL+"/nodes/:node_id/disks", wrapper.GetNodeDisks) - router.GET(baseURL+"/nodes/:node_id/hardware", wrapper.GetNodeHardware) - router.GET(baseURL+"/nodes/:node_id/hbas", wrapper.GetNodeHbas) - router.GET(baseURL+"/nodes/:node_id/interfaces", wrapper.GetNodeInterfaces) - router.GET(baseURL+"/nodes/:node_id/ips", wrapper.GetNodeIps) - router.GET(baseURL+"/nodes/:node_id/services", wrapper.GetNodeServices) - router.GET(baseURL+"/nodes/:node_id/services/:svc_id", wrapper.GetNodeService) - router.POST(baseURL+"/nodes/:node_id/snooze", wrapper.PostNodeSnooze) - router.GET(baseURL+"/nodes/:node_id/tags", wrapper.GetNodeTags) - router.GET(baseURL+"/nodes/:node_id/uuid", wrapper.GetNodeUUID) - router.PUT(baseURL+"/obsolescence/refresh", wrapper.PutObsolescenceRefresh) - router.DELETE(baseURL+"/obsolescence/settings", wrapper.DeleteObsolescenceSettings) - router.GET(baseURL+"/obsolescence/settings", wrapper.GetObsolescenceSettings) - router.POST(baseURL+"/obsolescence/settings", wrapper.PostObsolescenceSettings) - router.DELETE(baseURL+"/obsolescence/settings/:id", wrapper.DeleteObsolescenceSetting) - router.GET(baseURL+"/obsolescence/settings/:id", wrapper.GetObsolescenceSetting) - router.POST(baseURL+"/obsolescence/settings/:id", wrapper.PostObsolescenceSetting) - router.GET(baseURL+"/openapi.json", wrapper.GetSwagger) - router.DELETE(baseURL+"/services", wrapper.DeleteServices) - router.GET(baseURL+"/services", wrapper.GetServices) - router.POST(baseURL+"/services", wrapper.PostServices) - router.DELETE(baseURL+"/services/:svc_id", wrapper.DeleteService) - router.GET(baseURL+"/services/:svc_id", wrapper.GetService) - router.POST(baseURL+"/services/:svc_id", wrapper.PostService) - router.GET(baseURL+"/services/:svc_id/alerts", wrapper.GetServiceAlerts) - router.GET(baseURL+"/services/:svc_id/am_i_responsible", wrapper.GetServiceAmIResponsible) - router.GET(baseURL+"/services/:svc_id/candidate_tags", wrapper.GetServiceCandidateTags) - router.GET(baseURL+"/services/:svc_id/checks", wrapper.GetServiceChecks) - router.GET(baseURL+"/services/:svc_id/compliance/candidate_modulesets", wrapper.GetServiceComplianceCandidateModulesets) - router.GET(baseURL+"/services/:svc_id/compliance/candidate_rulesets", wrapper.GetServiceComplianceCandidateRulesets) - router.GET(baseURL+"/services/:svc_id/compliance/logs", wrapper.GetServiceComplianceLogs) - router.GET(baseURL+"/services/:svc_id/compliance/modulesets", wrapper.GetServiceComplianceModulesets) - router.DELETE(baseURL+"/services/:svc_id/compliance/modulesets/:mset_id", wrapper.DeleteServiceComplianceModuleset) - router.POST(baseURL+"/services/:svc_id/compliance/modulesets/:mset_id", wrapper.PostServiceComplianceModuleset) - router.GET(baseURL+"/services/:svc_id/compliance/rulesets", wrapper.GetServiceComplianceRulesets) - router.DELETE(baseURL+"/services/:svc_id/compliance/rulesets/:rset_id", wrapper.DeleteServiceComplianceRuleset) - router.POST(baseURL+"/services/:svc_id/compliance/rulesets/:rset_id", wrapper.PostServiceComplianceRuleset) - router.GET(baseURL+"/services/:svc_id/compliance/status", wrapper.GetServiceComplianceStatus) - router.GET(baseURL+"/services/:svc_id/disks", wrapper.GetServiceDisks) - router.DELETE(baseURL+"/services/:svc_id/instances/:node_id", wrapper.DeleteServiceInstance) - router.GET(baseURL+"/services/:svc_id/instances/:node_id", wrapper.GetServiceInstance) - router.GET(baseURL+"/services/:svc_id/nodes", wrapper.GetServiceNodes) - router.GET(baseURL+"/services/:svc_id/nodes/:node_id", wrapper.GetServiceNode) - router.GET(baseURL+"/services/:svc_id/nodes/:node_id/resources", wrapper.GetServiceNodeResources) - router.GET(baseURL+"/services/:svc_id/nodes/:node_id/resources/logs", wrapper.GetServiceNodeResourceLogs) - router.GET(baseURL+"/services/:svc_id/resinfo", wrapper.GetServiceResinfo) - router.GET(baseURL+"/services/:svc_id/resources", wrapper.GetServiceResources) - router.GET(baseURL+"/services/:svc_id/resources/logs", wrapper.GetServiceResourceLogs) - router.GET(baseURL+"/services/:svc_id/tags", wrapper.GetServiceTags) - router.DELETE(baseURL+"/services_instances", wrapper.DeleteServicesInstances) - router.GET(baseURL+"/services_instances", wrapper.GetServicesInstances) - router.GET(baseURL+"/services_instances/:svc_id", wrapper.GetServicesInstance) - router.GET(baseURL+"/services_instances_status_log", wrapper.GetServicesInstancesStatusLog) - router.GET(baseURL+"/services_status_log", wrapper.GetServicesStatusLog) - router.DELETE(baseURL+"/tags", wrapper.DeleteTags) - router.GET(baseURL+"/tags", wrapper.GetTags) - router.POST(baseURL+"/tags", wrapper.PostTags) - router.DELETE(baseURL+"/tags/nodes", wrapper.DeleteTagsNodes) - router.GET(baseURL+"/tags/nodes", wrapper.GetTagsNodes) - router.POST(baseURL+"/tags/nodes", wrapper.PostTagsNodes) - router.DELETE(baseURL+"/tags/services", wrapper.DeleteTagsServices) - router.GET(baseURL+"/tags/services", wrapper.GetTagsServices) - router.POST(baseURL+"/tags/services", wrapper.PostTagsServices) - router.DELETE(baseURL+"/tags/:tag_id", wrapper.DeleteTag) - router.GET(baseURL+"/tags/:tag_id", wrapper.GetTag) - router.POST(baseURL+"/tags/:tag_id", wrapper.PostTag) - router.GET(baseURL+"/tags/:tag_id/nodes", wrapper.GetTagNodes) - router.DELETE(baseURL+"/tags/:tag_id/nodes/:node_id", wrapper.DeleteTagNode) - router.POST(baseURL+"/tags/:tag_id/nodes/:node_id", wrapper.PostTagNode) - router.GET(baseURL+"/tags/:tag_id/services", wrapper.GetTagServices) - router.DELETE(baseURL+"/tags/:tag_id/services/:svc_id", wrapper.DeleteTagService) - router.POST(baseURL+"/tags/:tag_id/services/:svc_id", wrapper.PostTagService) - router.GET(baseURL+"/version", wrapper.GetVersion) - -} - -// Base64 encoded, gzipped, json marshaled Swagger object + router.GET(options.BaseURL+"/actions", wrapper.GetActions, options.OperationMiddlewares["GetActions"]...) + router.POST(options.BaseURL+"/actions", wrapper.PostActions, options.OperationMiddlewares["PostActions"]...) + router.PUT(options.BaseURL+"/actions", wrapper.PutActions, options.OperationMiddlewares["PutActions"]...) + router.DELETE(options.BaseURL+"/actions/:id", wrapper.DeleteAction, options.OperationMiddlewares["DeleteAction"]...) + router.GET(options.BaseURL+"/actions/:id", wrapper.GetAction, options.OperationMiddlewares["GetAction"]...) + router.GET(options.BaseURL+"/alert_event", wrapper.GetAlertEvent, options.OperationMiddlewares["GetAlertEvent"]...) + router.DELETE(options.BaseURL+"/alerts", wrapper.DeleteAlerts, options.OperationMiddlewares["DeleteAlerts"]...) + router.GET(options.BaseURL+"/alerts", wrapper.GetAlerts, options.OperationMiddlewares["GetAlerts"]...) + router.POST(options.BaseURL+"/alerts", wrapper.PostAlerts, options.OperationMiddlewares["PostAlerts"]...) + router.DELETE(options.BaseURL+"/alerts/:id", wrapper.DeleteAlert, options.OperationMiddlewares["DeleteAlert"]...) + router.GET(options.BaseURL+"/alerts/:id", wrapper.GetAlert, options.OperationMiddlewares["GetAlert"]...) + router.POST(options.BaseURL+"/alerts/:id", wrapper.PostAlert, options.OperationMiddlewares["PostAlert"]...) + router.DELETE(options.BaseURL+"/apps", wrapper.DeleteApps, options.OperationMiddlewares["DeleteApps"]...) + router.GET(options.BaseURL+"/apps", wrapper.GetApps, options.OperationMiddlewares["GetApps"]...) + router.POST(options.BaseURL+"/apps", wrapper.PostApps, options.OperationMiddlewares["PostApps"]...) + router.DELETE(options.BaseURL+"/apps/:app_id", wrapper.DeleteApp, options.OperationMiddlewares["DeleteApp"]...) + router.GET(options.BaseURL+"/apps/:app_id", wrapper.GetApp, options.OperationMiddlewares["GetApp"]...) + router.POST(options.BaseURL+"/apps/:app_id", wrapper.PostApp, options.OperationMiddlewares["PostApp"]...) + router.GET(options.BaseURL+"/apps/:app_id/am_i_responsible", wrapper.GetAppAmIResponsible, options.OperationMiddlewares["GetAppAmIResponsible"]...) + router.GET(options.BaseURL+"/apps/:app_id/nodes", wrapper.GetAppNodes, options.OperationMiddlewares["GetAppNodes"]...) + router.GET(options.BaseURL+"/apps/:app_id/publications", wrapper.GetAppPublications, options.OperationMiddlewares["GetAppPublications"]...) + router.DELETE(options.BaseURL+"/apps/:app_id/publications/:group_id", wrapper.DeleteAppPublication, options.OperationMiddlewares["DeleteAppPublication"]...) + router.POST(options.BaseURL+"/apps/:app_id/publications/:group_id", wrapper.PostAppPublication, options.OperationMiddlewares["PostAppPublication"]...) + router.GET(options.BaseURL+"/apps/:app_id/quotas", wrapper.GetAppQuotas, options.OperationMiddlewares["GetAppQuotas"]...) + router.GET(options.BaseURL+"/apps/:app_id/responsibles", wrapper.GetAppResponsibles, options.OperationMiddlewares["GetAppResponsibles"]...) + router.DELETE(options.BaseURL+"/apps/:app_id/responsibles/:group_id", wrapper.DeleteAppResponsible, options.OperationMiddlewares["DeleteAppResponsible"]...) + router.POST(options.BaseURL+"/apps/:app_id/responsibles/:group_id", wrapper.PostAppResponsible, options.OperationMiddlewares["PostAppResponsible"]...) + router.GET(options.BaseURL+"/apps/:app_id/services", wrapper.GetAppServices, options.OperationMiddlewares["GetAppServices"]...) + router.DELETE(options.BaseURL+"/apps_publications", wrapper.DeleteAppsPublications, options.OperationMiddlewares["DeleteAppsPublications"]...) + router.POST(options.BaseURL+"/apps_publications", wrapper.PostAppsPublications, options.OperationMiddlewares["PostAppsPublications"]...) + router.DELETE(options.BaseURL+"/apps_responsibles", wrapper.DeleteAppsResponsibles, options.OperationMiddlewares["DeleteAppsResponsibles"]...) + router.POST(options.BaseURL+"/apps_responsibles", wrapper.PostAppsResponsibles, options.OperationMiddlewares["PostAppsResponsibles"]...) + router.GET(options.BaseURL+"/arrays", wrapper.GetArrays, options.OperationMiddlewares["GetArrays"]...) + router.POST(options.BaseURL+"/auth/node", wrapper.PostAuthNode, options.OperationMiddlewares["PostAuthNode"]...) + router.POST(options.BaseURL+"/compliance/import", wrapper.PostComplianceImport, options.OperationMiddlewares["PostComplianceImport"]...) + router.GET(options.BaseURL+"/compliance/logs", wrapper.GetComplianceLogs, options.OperationMiddlewares["GetComplianceLogs"]...) + router.GET(options.BaseURL+"/compliance/logs/:log_id", wrapper.GetComplianceLog, options.OperationMiddlewares["GetComplianceLog"]...) + router.DELETE(options.BaseURL+"/compliance/modulesets", wrapper.DeleteComplianceModulesets, options.OperationMiddlewares["DeleteComplianceModulesets"]...) + router.GET(options.BaseURL+"/compliance/modulesets", wrapper.GetComplianceModulesets, options.OperationMiddlewares["GetComplianceModulesets"]...) + router.POST(options.BaseURL+"/compliance/modulesets", wrapper.PostComplianceModulesets, options.OperationMiddlewares["PostComplianceModulesets"]...) + router.GET(options.BaseURL+"/compliance/modulesets/export", wrapper.GetComplianceModulesetsExport, options.OperationMiddlewares["GetComplianceModulesetsExport"]...) + router.DELETE(options.BaseURL+"/compliance/modulesets/:modset_id", wrapper.DeleteComplianceModuleset, options.OperationMiddlewares["DeleteComplianceModuleset"]...) + router.GET(options.BaseURL+"/compliance/modulesets/:modset_id", wrapper.GetComplianceModuleset, options.OperationMiddlewares["GetComplianceModuleset"]...) + router.POST(options.BaseURL+"/compliance/modulesets/:modset_id", wrapper.PostComplianceModuleset, options.OperationMiddlewares["PostComplianceModuleset"]...) + router.PUT(options.BaseURL+"/compliance/modulesets/:modset_id", wrapper.PutComplianceModuleset, options.OperationMiddlewares["PutComplianceModuleset"]...) + router.GET(options.BaseURL+"/compliance/modulesets/:modset_id/am_i_responsible", wrapper.GetComplianceModulesetAmIResponsible, options.OperationMiddlewares["GetComplianceModulesetAmIResponsible"]...) + router.GET(options.BaseURL+"/compliance/modulesets/:modset_id/candidate_nodes", wrapper.GetComplianceModulesetCandidateNodes, options.OperationMiddlewares["GetComplianceModulesetCandidateNodes"]...) + router.GET(options.BaseURL+"/compliance/modulesets/:modset_id/candidate_services", wrapper.GetComplianceModulesetCandidateServices, options.OperationMiddlewares["GetComplianceModulesetCandidateServices"]...) + router.GET(options.BaseURL+"/compliance/modulesets/:modset_id/export", wrapper.GetComplianceModulesetExport, options.OperationMiddlewares["GetComplianceModulesetExport"]...) + router.GET(options.BaseURL+"/compliance/modulesets/:modset_id/modules", wrapper.GetComplianceModulesetModules, options.OperationMiddlewares["GetComplianceModulesetModules"]...) + router.POST(options.BaseURL+"/compliance/modulesets/:modset_id/modules", wrapper.PostComplianceModulesetModules, options.OperationMiddlewares["PostComplianceModulesetModules"]...) + router.DELETE(options.BaseURL+"/compliance/modulesets/:modset_id/modules/:mod_id", wrapper.DeleteComplianceModulesetModule, options.OperationMiddlewares["DeleteComplianceModulesetModule"]...) + router.GET(options.BaseURL+"/compliance/modulesets/:modset_id/modules/:mod_id", wrapper.GetComplianceModulesetModule, options.OperationMiddlewares["GetComplianceModulesetModule"]...) + router.POST(options.BaseURL+"/compliance/modulesets/:modset_id/modules/:mod_id", wrapper.PostComplianceModulesetModule, options.OperationMiddlewares["PostComplianceModulesetModule"]...) + router.DELETE(options.BaseURL+"/compliance/modulesets/:modset_id/modulesets/:child_modset_id", wrapper.DeleteComplianceModulesetModuleset, options.OperationMiddlewares["DeleteComplianceModulesetModuleset"]...) + router.POST(options.BaseURL+"/compliance/modulesets/:modset_id/modulesets/:child_modset_id", wrapper.PostComplianceModulesetModuleset, options.OperationMiddlewares["PostComplianceModulesetModuleset"]...) + router.GET(options.BaseURL+"/compliance/modulesets/:modset_id/nodes", wrapper.GetComplianceModulesetNodes, options.OperationMiddlewares["GetComplianceModulesetNodes"]...) + router.GET(options.BaseURL+"/compliance/modulesets/:modset_id/publications", wrapper.GetComplianceModulesetPublications, options.OperationMiddlewares["GetComplianceModulesetPublications"]...) + router.DELETE(options.BaseURL+"/compliance/modulesets/:modset_id/publications/:group_id", wrapper.DeleteComplianceModulesetPublication, options.OperationMiddlewares["DeleteComplianceModulesetPublication"]...) + router.POST(options.BaseURL+"/compliance/modulesets/:modset_id/publications/:group_id", wrapper.PostComplianceModulesetPublication, options.OperationMiddlewares["PostComplianceModulesetPublication"]...) + router.GET(options.BaseURL+"/compliance/modulesets/:modset_id/responsibles", wrapper.GetComplianceModulesetResponsibles, options.OperationMiddlewares["GetComplianceModulesetResponsibles"]...) + router.DELETE(options.BaseURL+"/compliance/modulesets/:modset_id/responsibles/:group_id", wrapper.DeleteComplianceModulesetResponsible, options.OperationMiddlewares["DeleteComplianceModulesetResponsible"]...) + router.POST(options.BaseURL+"/compliance/modulesets/:modset_id/responsibles/:group_id", wrapper.PostComplianceModulesetResponsible, options.OperationMiddlewares["PostComplianceModulesetResponsible"]...) + router.DELETE(options.BaseURL+"/compliance/modulesets/:modset_id/rulesets/:rset_id", wrapper.DeleteComplianceModulesetRuleset, options.OperationMiddlewares["DeleteComplianceModulesetRuleset"]...) + router.POST(options.BaseURL+"/compliance/modulesets/:modset_id/rulesets/:rset_id", wrapper.PostComplianceModulesetRuleset, options.OperationMiddlewares["PostComplianceModulesetRuleset"]...) + router.GET(options.BaseURL+"/compliance/modulesets/:modset_id/services", wrapper.GetComplianceModulesetServices, options.OperationMiddlewares["GetComplianceModulesetServices"]...) + router.GET(options.BaseURL+"/compliance/modulesets/:modset_id/usage", wrapper.GetComplianceModulesetUsage, options.OperationMiddlewares["GetComplianceModulesetUsage"]...) + router.GET(options.BaseURL+"/compliance/modulesets_modules", wrapper.GetComplianceModulesetsModules, options.OperationMiddlewares["GetComplianceModulesetsModules"]...) + router.DELETE(options.BaseURL+"/compliance/modulesets_nodes", wrapper.DeleteComplianceModulesetsNodes, options.OperationMiddlewares["DeleteComplianceModulesetsNodes"]...) + router.POST(options.BaseURL+"/compliance/modulesets_nodes", wrapper.PostComplianceModulesetsNodes, options.OperationMiddlewares["PostComplianceModulesetsNodes"]...) + router.DELETE(options.BaseURL+"/compliance/modulesets_publications", wrapper.DeleteComplianceModulesetsPublications, options.OperationMiddlewares["DeleteComplianceModulesetsPublications"]...) + router.POST(options.BaseURL+"/compliance/modulesets_publications", wrapper.PostComplianceModulesetsPublications, options.OperationMiddlewares["PostComplianceModulesetsPublications"]...) + router.DELETE(options.BaseURL+"/compliance/modulesets_responsibles", wrapper.DeleteComplianceModulesetsResponsibles, options.OperationMiddlewares["DeleteComplianceModulesetsResponsibles"]...) + router.POST(options.BaseURL+"/compliance/modulesets_responsibles", wrapper.PostComplianceModulesetsResponsibles, options.OperationMiddlewares["PostComplianceModulesetsResponsibles"]...) + router.DELETE(options.BaseURL+"/compliance/modulesets_services", wrapper.DeleteComplianceModulesetsServices, options.OperationMiddlewares["DeleteComplianceModulesetsServices"]...) + router.POST(options.BaseURL+"/compliance/modulesets_services", wrapper.PostComplianceModulesetsServices, options.OperationMiddlewares["PostComplianceModulesetsServices"]...) + router.DELETE(options.BaseURL+"/compliance/rulesets", wrapper.DeleteComplianceRulesets, options.OperationMiddlewares["DeleteComplianceRulesets"]...) + router.GET(options.BaseURL+"/compliance/rulesets", wrapper.GetComplianceRulesets, options.OperationMiddlewares["GetComplianceRulesets"]...) + router.POST(options.BaseURL+"/compliance/rulesets", wrapper.PostComplianceRulesets, options.OperationMiddlewares["PostComplianceRulesets"]...) + router.GET(options.BaseURL+"/compliance/rulesets/export", wrapper.GetComplianceRulesetsExport, options.OperationMiddlewares["GetComplianceRulesetsExport"]...) + router.DELETE(options.BaseURL+"/compliance/rulesets/:rset_id", wrapper.DeleteComplianceRuleset, options.OperationMiddlewares["DeleteComplianceRuleset"]...) + router.GET(options.BaseURL+"/compliance/rulesets/:rset_id", wrapper.GetComplianceRuleset, options.OperationMiddlewares["GetComplianceRuleset"]...) + router.POST(options.BaseURL+"/compliance/rulesets/:rset_id", wrapper.PostComplianceRuleset, options.OperationMiddlewares["PostComplianceRuleset"]...) + router.PUT(options.BaseURL+"/compliance/rulesets/:rset_id", wrapper.PutComplianceRuleset, options.OperationMiddlewares["PutComplianceRuleset"]...) + router.GET(options.BaseURL+"/compliance/rulesets/:rset_id/am_i_responsible", wrapper.GetComplianceRulesetAmIResponsible, options.OperationMiddlewares["GetComplianceRulesetAmIResponsible"]...) + router.GET(options.BaseURL+"/compliance/rulesets/:rset_id/candidate_nodes", wrapper.GetComplianceRulesetCandidateNodes, options.OperationMiddlewares["GetComplianceRulesetCandidateNodes"]...) + router.GET(options.BaseURL+"/compliance/rulesets/:rset_id/candidate_services", wrapper.GetComplianceRulesetCandidateServices, options.OperationMiddlewares["GetComplianceRulesetCandidateServices"]...) + router.GET(options.BaseURL+"/compliance/rulesets/:rset_id/export", wrapper.GetComplianceRulesetExport, options.OperationMiddlewares["GetComplianceRulesetExport"]...) + router.DELETE(options.BaseURL+"/compliance/rulesets/:rset_id/filtersets/:fset_id", wrapper.DeleteComplianceRulesetFilterset, options.OperationMiddlewares["DeleteComplianceRulesetFilterset"]...) + router.POST(options.BaseURL+"/compliance/rulesets/:rset_id/filtersets/:fset_id", wrapper.PostComplianceRulesetFilterset, options.OperationMiddlewares["PostComplianceRulesetFilterset"]...) + router.GET(options.BaseURL+"/compliance/rulesets/:rset_id/nodes", wrapper.GetComplianceRulesetNodes, options.OperationMiddlewares["GetComplianceRulesetNodes"]...) + router.GET(options.BaseURL+"/compliance/rulesets/:rset_id/publications", wrapper.GetComplianceRulesetPublications, options.OperationMiddlewares["GetComplianceRulesetPublications"]...) + router.DELETE(options.BaseURL+"/compliance/rulesets/:rset_id/publications/:group_id", wrapper.DeleteComplianceRulesetPublication, options.OperationMiddlewares["DeleteComplianceRulesetPublication"]...) + router.POST(options.BaseURL+"/compliance/rulesets/:rset_id/publications/:group_id", wrapper.PostComplianceRulesetPublication, options.OperationMiddlewares["PostComplianceRulesetPublication"]...) + router.GET(options.BaseURL+"/compliance/rulesets/:rset_id/responsibles", wrapper.GetComplianceRulesetResponsibles, options.OperationMiddlewares["GetComplianceRulesetResponsibles"]...) + router.DELETE(options.BaseURL+"/compliance/rulesets/:rset_id/responsibles/:group_id", wrapper.DeleteComplianceRulesetResponsible, options.OperationMiddlewares["DeleteComplianceRulesetResponsible"]...) + router.POST(options.BaseURL+"/compliance/rulesets/:rset_id/responsibles/:group_id", wrapper.PostComplianceRulesetResponsible, options.OperationMiddlewares["PostComplianceRulesetResponsible"]...) + router.DELETE(options.BaseURL+"/compliance/rulesets/:rset_id/rulesets/:child_rset_id", wrapper.DeleteComplianceRulesetRuleset, options.OperationMiddlewares["DeleteComplianceRulesetRuleset"]...) + router.POST(options.BaseURL+"/compliance/rulesets/:rset_id/rulesets/:child_rset_id", wrapper.PostComplianceRulesetRuleset, options.OperationMiddlewares["PostComplianceRulesetRuleset"]...) + router.GET(options.BaseURL+"/compliance/rulesets/:rset_id/services", wrapper.GetComplianceRulesetServices, options.OperationMiddlewares["GetComplianceRulesetServices"]...) + router.GET(options.BaseURL+"/compliance/rulesets/:rset_id/usage", wrapper.GetComplianceRulesetUsage, options.OperationMiddlewares["GetComplianceRulesetUsage"]...) + router.GET(options.BaseURL+"/compliance/rulesets/:rset_id/variables", wrapper.GetComplianceRulesetVariables, options.OperationMiddlewares["GetComplianceRulesetVariables"]...) + router.POST(options.BaseURL+"/compliance/rulesets/:rset_id/variables", wrapper.PostComplianceRulesetVariables, options.OperationMiddlewares["PostComplianceRulesetVariables"]...) + router.DELETE(options.BaseURL+"/compliance/rulesets/:rset_id/variables/:var_id", wrapper.DeleteComplianceRulesetVariable, options.OperationMiddlewares["DeleteComplianceRulesetVariable"]...) + router.GET(options.BaseURL+"/compliance/rulesets/:rset_id/variables/:var_id", wrapper.GetComplianceRulesetVariable, options.OperationMiddlewares["GetComplianceRulesetVariable"]...) + router.POST(options.BaseURL+"/compliance/rulesets/:rset_id/variables/:var_id", wrapper.PostComplianceRulesetVariable, options.OperationMiddlewares["PostComplianceRulesetVariable"]...) + router.PUT(options.BaseURL+"/compliance/rulesets/:rset_id/variables/:var_id", wrapper.PutComplianceRulesetVariable, options.OperationMiddlewares["PutComplianceRulesetVariable"]...) + router.DELETE(options.BaseURL+"/compliance/rulesets_nodes", wrapper.DeleteComplianceRulesetsNodes, options.OperationMiddlewares["DeleteComplianceRulesetsNodes"]...) + router.POST(options.BaseURL+"/compliance/rulesets_nodes", wrapper.PostComplianceRulesetsNodes, options.OperationMiddlewares["PostComplianceRulesetsNodes"]...) + router.DELETE(options.BaseURL+"/compliance/rulesets_publications", wrapper.DeleteComplianceRulesetsPublications, options.OperationMiddlewares["DeleteComplianceRulesetsPublications"]...) + router.POST(options.BaseURL+"/compliance/rulesets_publications", wrapper.PostComplianceRulesetsPublications, options.OperationMiddlewares["PostComplianceRulesetsPublications"]...) + router.DELETE(options.BaseURL+"/compliance/rulesets_responsibles", wrapper.DeleteComplianceRulesetsResponsibles, options.OperationMiddlewares["DeleteComplianceRulesetsResponsibles"]...) + router.POST(options.BaseURL+"/compliance/rulesets_responsibles", wrapper.PostComplianceRulesetsResponsibles, options.OperationMiddlewares["PostComplianceRulesetsResponsibles"]...) + router.DELETE(options.BaseURL+"/compliance/rulesets_services", wrapper.DeleteComplianceRulesetsServices, options.OperationMiddlewares["DeleteComplianceRulesetsServices"]...) + router.POST(options.BaseURL+"/compliance/rulesets_services", wrapper.PostComplianceRulesetsServices, options.OperationMiddlewares["PostComplianceRulesetsServices"]...) + router.GET(options.BaseURL+"/compliance/rulesets_variables", wrapper.GetComplianceRulesetsVariables, options.OperationMiddlewares["GetComplianceRulesetsVariables"]...) + router.POST(options.BaseURL+"/compliance/rulesets_variables", wrapper.PostComplianceRulesetsVariables, options.OperationMiddlewares["PostComplianceRulesetsVariables"]...) + router.DELETE(options.BaseURL+"/compliance/status", wrapper.DeleteComplianceStatus, options.OperationMiddlewares["DeleteComplianceStatus"]...) + router.GET(options.BaseURL+"/compliance/status", wrapper.GetComplianceStatus, options.OperationMiddlewares["GetComplianceStatus"]...) + router.DELETE(options.BaseURL+"/compliance/status/:status_id", wrapper.DeleteComplianceStatusRun, options.OperationMiddlewares["DeleteComplianceStatusRun"]...) + router.GET(options.BaseURL+"/compliance/status/:status_id", wrapper.GetComplianceStatusRun, options.OperationMiddlewares["GetComplianceStatusRun"]...) + router.DELETE(options.BaseURL+"/disks", wrapper.DeleteDisks, options.OperationMiddlewares["DeleteDisks"]...) + router.GET(options.BaseURL+"/disks", wrapper.GetDisks, options.OperationMiddlewares["GetDisks"]...) + router.POST(options.BaseURL+"/disks", wrapper.PostDisks, options.OperationMiddlewares["PostDisks"]...) + router.DELETE(options.BaseURL+"/disks/:disk_id", wrapper.DeleteDisk, options.OperationMiddlewares["DeleteDisk"]...) + router.GET(options.BaseURL+"/disks/:disk_id", wrapper.GetDisk, options.OperationMiddlewares["GetDisk"]...) + router.DELETE(options.BaseURL+"/filters", wrapper.DeleteFilters, options.OperationMiddlewares["DeleteFilters"]...) + router.GET(options.BaseURL+"/filters", wrapper.GetFilters, options.OperationMiddlewares["GetFilters"]...) + router.POST(options.BaseURL+"/filters", wrapper.PostFilters, options.OperationMiddlewares["PostFilters"]...) + router.DELETE(options.BaseURL+"/filters/:filter_id", wrapper.DeleteFilter, options.OperationMiddlewares["DeleteFilter"]...) + router.GET(options.BaseURL+"/filters/:filter_id", wrapper.GetFilter, options.OperationMiddlewares["GetFilter"]...) + router.POST(options.BaseURL+"/filters/:filter_id", wrapper.PostFilter, options.OperationMiddlewares["PostFilter"]...) + router.DELETE(options.BaseURL+"/filtersets", wrapper.DeleteFiltersets, options.OperationMiddlewares["DeleteFiltersets"]...) + router.GET(options.BaseURL+"/filtersets", wrapper.GetFiltersets, options.OperationMiddlewares["GetFiltersets"]...) + router.POST(options.BaseURL+"/filtersets", wrapper.PostFiltersets, options.OperationMiddlewares["PostFiltersets"]...) + router.DELETE(options.BaseURL+"/filtersets/:filterset_id", wrapper.DeleteFilterset, options.OperationMiddlewares["DeleteFilterset"]...) + router.GET(options.BaseURL+"/filtersets/:filterset_id", wrapper.GetFilterset, options.OperationMiddlewares["GetFilterset"]...) + router.POST(options.BaseURL+"/filtersets/:filterset_id", wrapper.PostFilterset, options.OperationMiddlewares["PostFilterset"]...) + router.GET(options.BaseURL+"/filtersets/:filterset_id/export", wrapper.GetFiltersetExport, options.OperationMiddlewares["GetFiltersetExport"]...) + router.GET(options.BaseURL+"/filtersets/:filterset_id/filters", wrapper.GetFiltersetFilters, options.OperationMiddlewares["GetFiltersetFilters"]...) + router.DELETE(options.BaseURL+"/filtersets/:filterset_id/filters/:f_id", wrapper.DeleteFiltersetFilter, options.OperationMiddlewares["DeleteFiltersetFilter"]...) + router.POST(options.BaseURL+"/filtersets/:filterset_id/filters/:f_id", wrapper.PostFiltersetFilter, options.OperationMiddlewares["PostFiltersetFilter"]...) + router.GET(options.BaseURL+"/filtersets/:filterset_id/filtersets", wrapper.GetFiltersetFiltersets, options.OperationMiddlewares["GetFiltersetFiltersets"]...) + router.DELETE(options.BaseURL+"/filtersets/:filterset_id/filtersets/:child_id", wrapper.DeleteFiltersetFilterset, options.OperationMiddlewares["DeleteFiltersetFilterset"]...) + router.POST(options.BaseURL+"/filtersets/:filterset_id/filtersets/:child_id", wrapper.PostFiltersetFilterset, options.OperationMiddlewares["PostFiltersetFilterset"]...) + router.GET(options.BaseURL+"/filtersets/:filterset_id/nodes", wrapper.GetFiltersetNodes, options.OperationMiddlewares["GetFiltersetNodes"]...) + router.GET(options.BaseURL+"/filtersets/:filterset_id/services", wrapper.GetFiltersetServices, options.OperationMiddlewares["GetFiltersetServices"]...) + router.GET(options.BaseURL+"/filtersets/:filterset_id/usage", wrapper.GetFiltersetUsage, options.OperationMiddlewares["GetFiltersetUsage"]...) + router.DELETE(options.BaseURL+"/filtersets_filters", wrapper.DeleteFiltersetsFilters, options.OperationMiddlewares["DeleteFiltersetsFilters"]...) + router.POST(options.BaseURL+"/filtersets_filters", wrapper.PostFiltersetsFilters, options.OperationMiddlewares["PostFiltersetsFilters"]...) + router.DELETE(options.BaseURL+"/filtersets_filtersets", wrapper.DeleteFiltersetsFiltersets, options.OperationMiddlewares["DeleteFiltersetsFiltersets"]...) + router.POST(options.BaseURL+"/filtersets_filtersets", wrapper.PostFiltersetsFiltersets, options.OperationMiddlewares["PostFiltersetsFiltersets"]...) + router.GET(options.BaseURL+"/form_output_results/:results_id", wrapper.GetFormOutputResults, options.OperationMiddlewares["GetFormOutputResults"]...) + router.PUT(options.BaseURL+"/form_output_results/:results_id", wrapper.PutFormOutputResults, options.OperationMiddlewares["PutFormOutputResults"]...) + router.DELETE(options.BaseURL+"/forms", wrapper.DeleteForms, options.OperationMiddlewares["DeleteForms"]...) + router.GET(options.BaseURL+"/forms", wrapper.GetForms, options.OperationMiddlewares["GetForms"]...) + router.POST(options.BaseURL+"/forms", wrapper.PostForms, options.OperationMiddlewares["PostForms"]...) + router.DELETE(options.BaseURL+"/forms/:form_id", wrapper.DeleteForm, options.OperationMiddlewares["DeleteForm"]...) + router.GET(options.BaseURL+"/forms/:form_id", wrapper.GetForm, options.OperationMiddlewares["GetForm"]...) + router.POST(options.BaseURL+"/forms/:form_id", wrapper.PostForm, options.OperationMiddlewares["PostForm"]...) + router.PUT(options.BaseURL+"/forms/:form_id", wrapper.PutForm, options.OperationMiddlewares["PutForm"]...) + router.GET(options.BaseURL+"/forms/:form_id/am_i_responsible", wrapper.GetFormAmIResponsible, options.OperationMiddlewares["GetFormAmIResponsible"]...) + router.GET(options.BaseURL+"/forms/:form_id/diff/:cid", wrapper.GetFormDiff, options.OperationMiddlewares["GetFormDiff"]...) + router.GET(options.BaseURL+"/forms/:form_id/publications", wrapper.GetFormPublications, options.OperationMiddlewares["GetFormPublications"]...) + router.DELETE(options.BaseURL+"/forms/:form_id/publications/:group_id", wrapper.DeleteFormPublication, options.OperationMiddlewares["DeleteFormPublication"]...) + router.POST(options.BaseURL+"/forms/:form_id/publications/:group_id", wrapper.PostFormPublication, options.OperationMiddlewares["PostFormPublication"]...) + router.GET(options.BaseURL+"/forms/:form_id/responsibles", wrapper.GetFormResponsibles, options.OperationMiddlewares["GetFormResponsibles"]...) + router.DELETE(options.BaseURL+"/forms/:form_id/responsibles/:group_id", wrapper.DeleteFormResponsible, options.OperationMiddlewares["DeleteFormResponsible"]...) + router.POST(options.BaseURL+"/forms/:form_id/responsibles/:group_id", wrapper.PostFormResponsible, options.OperationMiddlewares["PostFormResponsible"]...) + router.GET(options.BaseURL+"/forms/:form_id/revisions", wrapper.GetFormRevisions, options.OperationMiddlewares["GetFormRevisions"]...) + router.GET(options.BaseURL+"/forms/:form_id/revisions/:cid", wrapper.GetFormRevision, options.OperationMiddlewares["GetFormRevision"]...) + router.POST(options.BaseURL+"/forms/:form_id/rollback/:cid", wrapper.PostFormRollback, options.OperationMiddlewares["PostFormRollback"]...) + router.DELETE(options.BaseURL+"/forms_publications", wrapper.DeleteFormsPublications, options.OperationMiddlewares["DeleteFormsPublications"]...) + router.POST(options.BaseURL+"/forms_publications", wrapper.PostFormsPublications, options.OperationMiddlewares["PostFormsPublications"]...) + router.DELETE(options.BaseURL+"/forms_responsibles", wrapper.DeleteFormsResponsibles, options.OperationMiddlewares["DeleteFormsResponsibles"]...) + router.POST(options.BaseURL+"/forms_responsibles", wrapper.PostFormsResponsibles, options.OperationMiddlewares["PostFormsResponsibles"]...) + router.GET(options.BaseURL+"/forms_revisions", wrapper.GetFormsRevisions, options.OperationMiddlewares["GetFormsRevisions"]...) + router.GET(options.BaseURL+"/forms_revisions/:revision_id", wrapper.GetFormsRevision, options.OperationMiddlewares["GetFormsRevision"]...) + router.GET(options.BaseURL+"/forms_store", wrapper.GetFormsStore, options.OperationMiddlewares["GetFormsStore"]...) + router.GET(options.BaseURL+"/forms_store/:store_id", wrapper.GetFormStore, options.OperationMiddlewares["GetFormStore"]...) + router.GET(options.BaseURL+"/forms_store/:store_id/dump", wrapper.GetFormStoreDump, options.OperationMiddlewares["GetFormStoreDump"]...) + router.GET(options.BaseURL+"/frontend/hidden_menu_entries", wrapper.GetFrontendHiddenMenuEntries, options.OperationMiddlewares["GetFrontendHiddenMenuEntries"]...) + router.DELETE(options.BaseURL+"/groups", wrapper.DeleteGroups, options.OperationMiddlewares["DeleteGroups"]...) + router.GET(options.BaseURL+"/groups", wrapper.GetGroups, options.OperationMiddlewares["GetGroups"]...) + router.POST(options.BaseURL+"/groups", wrapper.PostGroups, options.OperationMiddlewares["PostGroups"]...) + router.DELETE(options.BaseURL+"/groups/:group_id", wrapper.DeleteGroup, options.OperationMiddlewares["DeleteGroup"]...) + router.GET(options.BaseURL+"/groups/:group_id", wrapper.GetGroup, options.OperationMiddlewares["GetGroup"]...) + router.POST(options.BaseURL+"/groups/:group_id", wrapper.PostGroup, options.OperationMiddlewares["PostGroup"]...) + router.GET(options.BaseURL+"/groups/:group_id/apps", wrapper.GetGroupApps, options.OperationMiddlewares["GetGroupApps"]...) + router.DELETE(options.BaseURL+"/groups/:group_id/hidden_menu_entries", wrapper.DeleteGroupHiddenMenuEntries, options.OperationMiddlewares["DeleteGroupHiddenMenuEntries"]...) + router.GET(options.BaseURL+"/groups/:group_id/hidden_menu_entries", wrapper.GetGroupHiddenMenuEntries, options.OperationMiddlewares["GetGroupHiddenMenuEntries"]...) + router.POST(options.BaseURL+"/groups/:group_id/hidden_menu_entries", wrapper.PostGroupHiddenMenuEntries, options.OperationMiddlewares["PostGroupHiddenMenuEntries"]...) + router.GET(options.BaseURL+"/groups/:group_id/modulesets", wrapper.GetGroupModulesets, options.OperationMiddlewares["GetGroupModulesets"]...) + router.GET(options.BaseURL+"/groups/:group_id/nodes", wrapper.GetGroupNodes, options.OperationMiddlewares["GetGroupNodes"]...) + router.GET(options.BaseURL+"/groups/:group_id/rulesets", wrapper.GetGroupRulesets, options.OperationMiddlewares["GetGroupRulesets"]...) + router.GET(options.BaseURL+"/groups/:group_id/services", wrapper.GetGroupServices, options.OperationMiddlewares["GetGroupServices"]...) + router.GET(options.BaseURL+"/groups/:group_id/users", wrapper.GetGroupUsers, options.OperationMiddlewares["GetGroupUsers"]...) + router.DELETE(options.BaseURL+"/ips", wrapper.DeleteIps, options.OperationMiddlewares["DeleteIps"]...) + router.GET(options.BaseURL+"/ips", wrapper.GetIps, options.OperationMiddlewares["GetIps"]...) + router.DELETE(options.BaseURL+"/ips/:id", wrapper.DeleteIp, options.OperationMiddlewares["DeleteIp"]...) + router.GET(options.BaseURL+"/ips/:id", wrapper.GetIp, options.OperationMiddlewares["GetIp"]...) + router.GET(options.BaseURL+"/logs", wrapper.GetLogs, options.OperationMiddlewares["GetLogs"]...) + router.POST(options.BaseURL+"/logs", wrapper.PostLogs, options.OperationMiddlewares["PostLogs"]...) + router.GET(options.BaseURL+"/logs/:log_id", wrapper.GetLog, options.OperationMiddlewares["GetLog"]...) + router.GET(options.BaseURL+"/networks", wrapper.GetNetworks, options.OperationMiddlewares["GetNetworks"]...) + router.POST(options.BaseURL+"/networks", wrapper.PostNetworks, options.OperationMiddlewares["PostNetworks"]...) + router.POST(options.BaseURL+"/networks/:net_id/segments", wrapper.PostNetworkSegments, options.OperationMiddlewares["PostNetworkSegments"]...) + router.DELETE(options.BaseURL+"/nodes", wrapper.DeleteNodes, options.OperationMiddlewares["DeleteNodes"]...) + router.GET(options.BaseURL+"/nodes", wrapper.GetNodes, options.OperationMiddlewares["GetNodes"]...) + router.POST(options.BaseURL+"/nodes", wrapper.PostNodes, options.OperationMiddlewares["PostNodes"]...) + router.GET(options.BaseURL+"/nodes/hardware", wrapper.GetNodesHardware, options.OperationMiddlewares["GetNodesHardware"]...) + router.GET(options.BaseURL+"/nodes/hbas", wrapper.GetNodesHbas, options.OperationMiddlewares["GetNodesHbas"]...) + router.DELETE(options.BaseURL+"/nodes/:node_id", wrapper.DeleteNode, options.OperationMiddlewares["DeleteNode"]...) + router.GET(options.BaseURL+"/nodes/:node_id", wrapper.GetNode, options.OperationMiddlewares["GetNode"]...) + router.POST(options.BaseURL+"/nodes/:node_id", wrapper.PostNode, options.OperationMiddlewares["PostNode"]...) + router.GET(options.BaseURL+"/nodes/:node_id/alerts", wrapper.GetNodeAlerts, options.OperationMiddlewares["GetNodeAlerts"]...) + router.GET(options.BaseURL+"/nodes/:node_id/am_i_responsible", wrapper.GetNodeAmIResponsible, options.OperationMiddlewares["GetNodeAmIResponsible"]...) + router.GET(options.BaseURL+"/nodes/:node_id/candidate_tags", wrapper.GetNodeCandidateTags, options.OperationMiddlewares["GetNodeCandidateTags"]...) + router.GET(options.BaseURL+"/nodes/:node_id/checks", wrapper.GetNodeChecks, options.OperationMiddlewares["GetNodeChecks"]...) + router.GET(options.BaseURL+"/nodes/:node_id/compliance/candidate_modulesets", wrapper.GetNodeComplianceCandidateModulesets, options.OperationMiddlewares["GetNodeComplianceCandidateModulesets"]...) + router.GET(options.BaseURL+"/nodes/:node_id/compliance/candidate_rulesets", wrapper.GetNodeComplianceCandidateRulesets, options.OperationMiddlewares["GetNodeComplianceCandidateRulesets"]...) + router.GET(options.BaseURL+"/nodes/:node_id/compliance/logs", wrapper.GetNodeComplianceLogs, options.OperationMiddlewares["GetNodeComplianceLogs"]...) + router.GET(options.BaseURL+"/nodes/:node_id/compliance/modulesets", wrapper.GetNodeComplianceModulesets, options.OperationMiddlewares["GetNodeComplianceModulesets"]...) + router.DELETE(options.BaseURL+"/nodes/:node_id/compliance/modulesets/:mset_id", wrapper.DeleteNodeComplianceModuleset, options.OperationMiddlewares["DeleteNodeComplianceModuleset"]...) + router.POST(options.BaseURL+"/nodes/:node_id/compliance/modulesets/:mset_id", wrapper.PostNodeComplianceModuleset, options.OperationMiddlewares["PostNodeComplianceModuleset"]...) + router.GET(options.BaseURL+"/nodes/:node_id/compliance/rulesets", wrapper.GetNodeComplianceRulesets, options.OperationMiddlewares["GetNodeComplianceRulesets"]...) + router.DELETE(options.BaseURL+"/nodes/:node_id/compliance/rulesets/:rset_id", wrapper.DeleteNodeComplianceRuleset, options.OperationMiddlewares["DeleteNodeComplianceRuleset"]...) + router.POST(options.BaseURL+"/nodes/:node_id/compliance/rulesets/:rset_id", wrapper.PostNodeComplianceRuleset, options.OperationMiddlewares["PostNodeComplianceRuleset"]...) + router.GET(options.BaseURL+"/nodes/:node_id/compliance/status", wrapper.GetNodeComplianceStatus, options.OperationMiddlewares["GetNodeComplianceStatus"]...) + router.GET(options.BaseURL+"/nodes/:node_id/disks", wrapper.GetNodeDisks, options.OperationMiddlewares["GetNodeDisks"]...) + router.GET(options.BaseURL+"/nodes/:node_id/hardware", wrapper.GetNodeHardware, options.OperationMiddlewares["GetNodeHardware"]...) + router.GET(options.BaseURL+"/nodes/:node_id/hbas", wrapper.GetNodeHbas, options.OperationMiddlewares["GetNodeHbas"]...) + router.GET(options.BaseURL+"/nodes/:node_id/interfaces", wrapper.GetNodeInterfaces, options.OperationMiddlewares["GetNodeInterfaces"]...) + router.GET(options.BaseURL+"/nodes/:node_id/ips", wrapper.GetNodeIps, options.OperationMiddlewares["GetNodeIps"]...) + router.GET(options.BaseURL+"/nodes/:node_id/services", wrapper.GetNodeServices, options.OperationMiddlewares["GetNodeServices"]...) + router.GET(options.BaseURL+"/nodes/:node_id/services/:svc_id", wrapper.GetNodeService, options.OperationMiddlewares["GetNodeService"]...) + router.POST(options.BaseURL+"/nodes/:node_id/snooze", wrapper.PostNodeSnooze, options.OperationMiddlewares["PostNodeSnooze"]...) + router.GET(options.BaseURL+"/nodes/:node_id/tags", wrapper.GetNodeTags, options.OperationMiddlewares["GetNodeTags"]...) + router.GET(options.BaseURL+"/nodes/:node_id/uuid", wrapper.GetNodeUUID, options.OperationMiddlewares["GetNodeUUID"]...) + router.PUT(options.BaseURL+"/obsolescence/refresh", wrapper.PutObsolescenceRefresh, options.OperationMiddlewares["PutObsolescenceRefresh"]...) + router.DELETE(options.BaseURL+"/obsolescence/settings", wrapper.DeleteObsolescenceSettings, options.OperationMiddlewares["DeleteObsolescenceSettings"]...) + router.GET(options.BaseURL+"/obsolescence/settings", wrapper.GetObsolescenceSettings, options.OperationMiddlewares["GetObsolescenceSettings"]...) + router.POST(options.BaseURL+"/obsolescence/settings", wrapper.PostObsolescenceSettings, options.OperationMiddlewares["PostObsolescenceSettings"]...) + router.DELETE(options.BaseURL+"/obsolescence/settings/:id", wrapper.DeleteObsolescenceSetting, options.OperationMiddlewares["DeleteObsolescenceSetting"]...) + router.GET(options.BaseURL+"/obsolescence/settings/:id", wrapper.GetObsolescenceSetting, options.OperationMiddlewares["GetObsolescenceSetting"]...) + router.POST(options.BaseURL+"/obsolescence/settings/:id", wrapper.PostObsolescenceSetting, options.OperationMiddlewares["PostObsolescenceSetting"]...) + router.GET(options.BaseURL+"/openapi.json", wrapper.GetSwagger, options.OperationMiddlewares["GetSwagger"]...) + router.GET(options.BaseURL+"/packages", wrapper.GetPackages, options.OperationMiddlewares["GetPackages"]...) + router.GET(options.BaseURL+"/packages/diff", wrapper.GetPackagesDiff, options.OperationMiddlewares["GetPackagesDiff"]...) + router.GET(options.BaseURL+"/search", wrapper.GetSearch, options.OperationMiddlewares["GetSearch"]...) + router.DELETE(options.BaseURL+"/services", wrapper.DeleteServices, options.OperationMiddlewares["DeleteServices"]...) + router.GET(options.BaseURL+"/services", wrapper.GetServices, options.OperationMiddlewares["GetServices"]...) + router.POST(options.BaseURL+"/services", wrapper.PostServices, options.OperationMiddlewares["PostServices"]...) + router.DELETE(options.BaseURL+"/services/:svc_id", wrapper.DeleteService, options.OperationMiddlewares["DeleteService"]...) + router.GET(options.BaseURL+"/services/:svc_id", wrapper.GetService, options.OperationMiddlewares["GetService"]...) + router.POST(options.BaseURL+"/services/:svc_id", wrapper.PostService, options.OperationMiddlewares["PostService"]...) + router.GET(options.BaseURL+"/services/:svc_id/alerts", wrapper.GetServiceAlerts, options.OperationMiddlewares["GetServiceAlerts"]...) + router.GET(options.BaseURL+"/services/:svc_id/am_i_responsible", wrapper.GetServiceAmIResponsible, options.OperationMiddlewares["GetServiceAmIResponsible"]...) + router.GET(options.BaseURL+"/services/:svc_id/candidate_tags", wrapper.GetServiceCandidateTags, options.OperationMiddlewares["GetServiceCandidateTags"]...) + router.GET(options.BaseURL+"/services/:svc_id/checks", wrapper.GetServiceChecks, options.OperationMiddlewares["GetServiceChecks"]...) + router.GET(options.BaseURL+"/services/:svc_id/compliance/candidate_modulesets", wrapper.GetServiceComplianceCandidateModulesets, options.OperationMiddlewares["GetServiceComplianceCandidateModulesets"]...) + router.GET(options.BaseURL+"/services/:svc_id/compliance/candidate_rulesets", wrapper.GetServiceComplianceCandidateRulesets, options.OperationMiddlewares["GetServiceComplianceCandidateRulesets"]...) + router.GET(options.BaseURL+"/services/:svc_id/compliance/logs", wrapper.GetServiceComplianceLogs, options.OperationMiddlewares["GetServiceComplianceLogs"]...) + router.GET(options.BaseURL+"/services/:svc_id/compliance/modulesets", wrapper.GetServiceComplianceModulesets, options.OperationMiddlewares["GetServiceComplianceModulesets"]...) + router.DELETE(options.BaseURL+"/services/:svc_id/compliance/modulesets/:mset_id", wrapper.DeleteServiceComplianceModuleset, options.OperationMiddlewares["DeleteServiceComplianceModuleset"]...) + router.POST(options.BaseURL+"/services/:svc_id/compliance/modulesets/:mset_id", wrapper.PostServiceComplianceModuleset, options.OperationMiddlewares["PostServiceComplianceModuleset"]...) + router.GET(options.BaseURL+"/services/:svc_id/compliance/rulesets", wrapper.GetServiceComplianceRulesets, options.OperationMiddlewares["GetServiceComplianceRulesets"]...) + router.DELETE(options.BaseURL+"/services/:svc_id/compliance/rulesets/:rset_id", wrapper.DeleteServiceComplianceRuleset, options.OperationMiddlewares["DeleteServiceComplianceRuleset"]...) + router.POST(options.BaseURL+"/services/:svc_id/compliance/rulesets/:rset_id", wrapper.PostServiceComplianceRuleset, options.OperationMiddlewares["PostServiceComplianceRuleset"]...) + router.GET(options.BaseURL+"/services/:svc_id/compliance/status", wrapper.GetServiceComplianceStatus, options.OperationMiddlewares["GetServiceComplianceStatus"]...) + router.GET(options.BaseURL+"/services/:svc_id/disks", wrapper.GetServiceDisks, options.OperationMiddlewares["GetServiceDisks"]...) + router.DELETE(options.BaseURL+"/services/:svc_id/instances/:node_id", wrapper.DeleteServiceInstance, options.OperationMiddlewares["DeleteServiceInstance"]...) + router.GET(options.BaseURL+"/services/:svc_id/instances/:node_id", wrapper.GetServiceInstance, options.OperationMiddlewares["GetServiceInstance"]...) + router.GET(options.BaseURL+"/services/:svc_id/nodes", wrapper.GetServiceNodes, options.OperationMiddlewares["GetServiceNodes"]...) + router.GET(options.BaseURL+"/services/:svc_id/nodes/:node_id", wrapper.GetServiceNode, options.OperationMiddlewares["GetServiceNode"]...) + router.GET(options.BaseURL+"/services/:svc_id/nodes/:node_id/resources", wrapper.GetServiceNodeResources, options.OperationMiddlewares["GetServiceNodeResources"]...) + router.GET(options.BaseURL+"/services/:svc_id/nodes/:node_id/resources/logs", wrapper.GetServiceNodeResourceLogs, options.OperationMiddlewares["GetServiceNodeResourceLogs"]...) + router.GET(options.BaseURL+"/services/:svc_id/resinfo", wrapper.GetServiceResinfo, options.OperationMiddlewares["GetServiceResinfo"]...) + router.GET(options.BaseURL+"/services/:svc_id/resources", wrapper.GetServiceResources, options.OperationMiddlewares["GetServiceResources"]...) + router.GET(options.BaseURL+"/services/:svc_id/resources/logs", wrapper.GetServiceResourceLogs, options.OperationMiddlewares["GetServiceResourceLogs"]...) + router.GET(options.BaseURL+"/services/:svc_id/tags", wrapper.GetServiceTags, options.OperationMiddlewares["GetServiceTags"]...) + router.DELETE(options.BaseURL+"/services_instances", wrapper.DeleteServicesInstances, options.OperationMiddlewares["DeleteServicesInstances"]...) + router.GET(options.BaseURL+"/services_instances", wrapper.GetServicesInstances, options.OperationMiddlewares["GetServicesInstances"]...) + router.GET(options.BaseURL+"/services_instances/:svc_id", wrapper.GetServicesInstance, options.OperationMiddlewares["GetServicesInstance"]...) + router.GET(options.BaseURL+"/services_instances_status_log", wrapper.GetServicesInstancesStatusLog, options.OperationMiddlewares["GetServicesInstancesStatusLog"]...) + router.GET(options.BaseURL+"/services_status_log", wrapper.GetServicesStatusLog, options.OperationMiddlewares["GetServicesStatusLog"]...) + router.DELETE(options.BaseURL+"/tags", wrapper.DeleteTags, options.OperationMiddlewares["DeleteTags"]...) + router.GET(options.BaseURL+"/tags", wrapper.GetTags, options.OperationMiddlewares["GetTags"]...) + router.POST(options.BaseURL+"/tags", wrapper.PostTags, options.OperationMiddlewares["PostTags"]...) + router.DELETE(options.BaseURL+"/tags/nodes", wrapper.DeleteTagsNodes, options.OperationMiddlewares["DeleteTagsNodes"]...) + router.GET(options.BaseURL+"/tags/nodes", wrapper.GetTagsNodes, options.OperationMiddlewares["GetTagsNodes"]...) + router.POST(options.BaseURL+"/tags/nodes", wrapper.PostTagsNodes, options.OperationMiddlewares["PostTagsNodes"]...) + router.DELETE(options.BaseURL+"/tags/services", wrapper.DeleteTagsServices, options.OperationMiddlewares["DeleteTagsServices"]...) + router.GET(options.BaseURL+"/tags/services", wrapper.GetTagsServices, options.OperationMiddlewares["GetTagsServices"]...) + router.POST(options.BaseURL+"/tags/services", wrapper.PostTagsServices, options.OperationMiddlewares["PostTagsServices"]...) + router.DELETE(options.BaseURL+"/tags/:tag_id", wrapper.DeleteTag, options.OperationMiddlewares["DeleteTag"]...) + router.GET(options.BaseURL+"/tags/:tag_id", wrapper.GetTag, options.OperationMiddlewares["GetTag"]...) + router.POST(options.BaseURL+"/tags/:tag_id", wrapper.PostTag, options.OperationMiddlewares["PostTag"]...) + router.GET(options.BaseURL+"/tags/:tag_id/nodes", wrapper.GetTagNodes, options.OperationMiddlewares["GetTagNodes"]...) + router.DELETE(options.BaseURL+"/tags/:tag_id/nodes/:node_id", wrapper.DeleteTagNode, options.OperationMiddlewares["DeleteTagNode"]...) + router.POST(options.BaseURL+"/tags/:tag_id/nodes/:node_id", wrapper.PostTagNode, options.OperationMiddlewares["PostTagNode"]...) + router.GET(options.BaseURL+"/tags/:tag_id/services", wrapper.GetTagServices, options.OperationMiddlewares["GetTagServices"]...) + router.DELETE(options.BaseURL+"/tags/:tag_id/services/:svc_id", wrapper.DeleteTagService, options.OperationMiddlewares["DeleteTagService"]...) + router.POST(options.BaseURL+"/tags/:tag_id/services/:svc_id", wrapper.PostTagService, options.OperationMiddlewares["PostTagService"]...) + router.GET(options.BaseURL+"/users", wrapper.GetUsers, options.OperationMiddlewares["GetUsers"]...) + router.POST(options.BaseURL+"/users", wrapper.PostUsers, options.OperationMiddlewares["PostUsers"]...) + router.POST(options.BaseURL+"/users/self/password", wrapper.PostUserSelfPassword, options.OperationMiddlewares["PostUserSelfPassword"]...) + router.GET(options.BaseURL+"/users/:user_id", wrapper.GetUser, options.OperationMiddlewares["GetUser"]...) + router.POST(options.BaseURL+"/users/:user_id", wrapper.PostUser, options.OperationMiddlewares["PostUser"]...) + router.GET(options.BaseURL+"/users/:user_id/prefs", wrapper.GetUserPrefs, options.OperationMiddlewares["GetUserPrefs"]...) + router.POST(options.BaseURL+"/users/:user_id/prefs", wrapper.PostUserPrefs, options.OperationMiddlewares["PostUserPrefs"]...) + router.GET(options.BaseURL+"/version", wrapper.GetVersion, options.OperationMiddlewares["GetVersion"]...) + router.GET(options.BaseURL+"/workflows", wrapper.GetWorkflows, options.OperationMiddlewares["GetWorkflows"]...) + +} + +// Base64 encoded, compressed with deflate, json marshaled OpenAPI spec. +// Stored as a slice of fixed-width chunks rather than one concatenated +// const string: with thousands of chunks the chained `+` fold is several +// times slower for the Go compiler than parsing a slice literal. var swaggerSpec = []string{ - - "H4sIAAAAAAAC/+y9bXPbOLIv/lVQ+v+rnNRq5MzOnFu1mdoXOUlm1nsmD8dJ9rwYpVQQ2ZKwJgEGAOVo", - "XK66n+Z+sPtJbgHgkySApGzZlux+lVgACZDsX/evG0D31SASaSY4cK0GL68GGZU0BQ3S/sX4R6oX7xTo", - "s9j8HYOKJMs0E3zwcnD2hogZ0QsgqYjzBBTowXDATFNG9WIwHHCawuDlIFWgJyweDAcSvuVMQjx4qWUO", - "w4GKFpBSc2u9ykxXpSXj88H19bAY/L2IoX1wLmLwj2tabjrueedDy7ZHljd85P/OQa5+kyLPpqvtwV+L", - "NKU/KDBfSUNMEqa0mU4mRQZSM1BECzI3l7spgsoTTaYr8gxG85Frma7+TrNsqJaRmevzUfkA38zQ9RMU", - "fQe9Zvw7S5nenu9nIxv0O0vzlPA8nYI0swWuZTFVCTqXfERekBQoV4QLkphbhSZlG9emFMOM5okevPyP", - "F8NByrgZa/DyxbCcK+Ma5iCbk30Hmno+LI+SPAaSgqYx1ZQwXr7DTHAFI/KW02kCsXmdxagj8kUBmdFE", - "ARGSvDCPJFKmHShAUzJjkMShpzE9+r3fD7OZEbWtSX+6YO5Lz5hUunqzhYTax4hyqYQMTUG4G3vfaO8X", - "+kHGIG8ur0pII6Mj8lHCjH0ntGxfkUumF+QHMhOSmDsDjxmfE2HGK0RauLH/brBunmn4A82yoFAXvfu9", - "9I9SZGr7oV4FHoMVAsQ4ARot3NuPWWQu41SuQnPK7DC9ZvRJU618r5lrKRJlP7qdhmKC1wJsMAZxcy5m", - "9pSMB8rccDwgF7AakkhwTRk3b9hcpyCByHy1xmPGTGnGI02WNMlBkUjkXKvQk9m7tz7ZtdGPDl/2uX5+", - "8cL8Y2YC3Mo7zbKERdRM/PTfyjzuVeN+/7+E2eDl4P87ra3YqWtVpx+lmCaQulHWX9h/0picw7cclB5c", - "Dwc/v/jxPkb9wmmuF0KyPyF2w/50H8P+KuSUxTFwN+bP9zHme6HJryLnxXP+7T7GfC34LGGR/aL/cT9y", - "dMY1SE4T8gnkEiR5K6VwmrG42Nz7d6Z0aXJqKNk5LSlLjE2ZZKWqYRpS5UFKpX6plHRl/rbQa/Ss9PJw", - "UKLUjhHHzMyWJh/Xxt6+qvhFTP8N7iUWCi2+yeySkhBsjyMqW+aZg9A08TX55mde7HmhPbZfrlG/5l/B", - "4cNs8PKP7dnXd9qYffit3eJtbvzw9Xro7H+H9FXS43RlySX/cM/31TNQKa9bb0TDd+0zZ4s8pfwHCTQ2", - "skjge5ZQbpFCVAYRm7HI2De9YIqIKMqlBB5BQTLGPHPjjcZ8MPSYruac7Qx8c16CVMyBcn3OjQb4TtMs", - "Mde9GL0Y/dg5WHnp9ngGnxDlkunVJ/Oa3VBTqlj0KteLSjWYa+yv9VgLrTMz4SlQCbLs7f76VciU6sHL", - "wT//53Np9ewtbOvmPZxZnwn7ZZi2DyYy4GoZkUgkxvYKSWjGBo3XM/hx9GL0k0VRBtw0vhz8NHoxejEY", - "WgfEPsgptXbe/n/uY41GpogCuWQREMpj60KR4iqSCWWsfsEe3K+TbznkMCLvKKdzkIoogDGnSVJe9QsR", - "egGS5Mq0Cp6sTJfqnmJmx1DkciEUEJpZ1roiVMKYFwyAGeGbCekEyQiBlUHjhA1+A/2qeKjhmo/6hx89", - "dZfTNTJnsN2vv/No+vcvGHr/Cxyoe3d31G+H+RRMt/8Vpdd5/XWDlP11j8Z0TWd7LOqH/2qYb9+Nqpmd", - "mk5NKFthaID4j6/m2ZtA/eOreTZN50ZwBhXIBkYXG6nfRso7EbPZilC+hgPrZ61GxLi3Jyw+MfSZMEVS", - "ymOqhVxZUDn+rJyS1FTOQRd3+cUBxMDrxHDkXJ3ULg9TJM+Mcp8mMLIslUko7vJexPD2O0TG2Xwt0sz+", - "P5NsyRKYOyhXYGIJ0yvrOZlxivENCH34+ihUA2DSUeP/FPFqpw+/rrqZJ3rixiCNt0hskGSLT7jXsn2D", - "93BJXBt5Zp7LvsjqfVVv8XmndWCxzzBcb8Zrrm+JBc8APoH/uY/Am061t9LV98eGi9HV96eGa9DV9+cH", - "Aej1sDJrp1csvnaSkYCGbRl5Y3+vQeu1aKSwaE2AEYOvwsQZXrMjrqw+KO7OFEnEfA7xmJurKYkWlM+B", - "cKENn6JlJ0iZ1hD7MOkewyFm2+r1w5UnMrljUPK2xmBDJ5SEZwubvYFyN8L/ABbHS83eMJUl1NmGRtzF", - "hmsqMt4t1mPeZGrkBkTtZvTs4eR0iETwERLBw7dJCUg9gWXxPloxbfsS21cRzVIg0tgERZ7FVC2mgsp4", - "UrYaNvN8RF4RKS4JU2O+ZA6BlwvghGlV+W9C2j+tC8cUKftZhx1IRJME5C+Gmlp1MOYG7bAEudILxuch", - "NJupvrVPhf4W+lt3Bx3Vk8hZ6Dyb5smFsUHpc0e23KqXa0ypjoxEW2NXmM8liw0Dg285tawtkkyDZJQ8", - "Y/GQGNRNjB0ZkmKleEjUMppUbYwrTXkEQ/J///f/eW5h6KYaG2RaxKV05Yyoa7BQFJfFhDeMLQeInR9n", - "4aUKE107cC0s0L2rfblma0/njefaHsroCfulvVHm8vV5b+C8v62fyyV5X5t7973p4X4dNeSpO/FUG0KE", - "73ahYV5Ie8OOVQbMoHTJpM5pQk5st7VQx5gbpG4EoFNQis6BSOAxSIjJTIrUIXKWauuN2T9iFuk2+4Wx", - "QrRd9xgrfC2BasvHbDyqtlvBgNt+lfqUKuijsg1svKtgthX4MmwQZqkON96tPbmp4VhfMitHwNDfw1qV", - "mv/tEs2zYAoxr8IGUaXYnBuiJQjTBQEb83UGRkIEzBvCsxaHjvmNQ3hmsM7IiCWxLG4Y0RGLn2MM75EE", - "sDvifZWP0wj6bdOpINV5SOnCyBtG3g6Egn1ZJ14nqgGnjaWeNgsw5iUVMvpdgnmeXJeOiGMbp1XIoCJV", - "xPSjulwiumR6UdzJuC1MkSVNmJlgPLQmxW2ydJTINEcJTTO/Iano4oObkcNhqkdIRpFzHtNyc5b1jU7W", - "34REhpuuBSrfMhsD1OVmkWLl+IRm2cmYb20dKZbzpiLe2kZSrjbTLPvFbfA3U2CCjzmzHThZUB4nhrIq", - "8ubt728/vyX2OU6vaJZNWHzdwlKzbH++KM0yz+aPLLOvx7ffw7tZJMus8pWxd5PIUUYFjwt3xc7trr5/", - "O7jIZLWzmlAn1tu02f2O8UGMD95vfNBjL/x07w708ZbaNVYhFillPNisgaaTYv//NpNqPmFX+M1MAgNv", - "G8r4gBVsSYIq8nAzNhTmG53OTJMAELsbvmIQHnfGzfJeI2NHFPE6RlteRceyrOHJB8z5w0vTrpGwe5O+", - "IwzlvHbBdp931SIJheE8EMVy1JYbzfSRxSoqM31K0wmbNLbtBncmntuj4cR8TcKKrBZOakG60Ofa1l93", - "BLDTvjt1/Co9O29M4bGY+qkQCVCOq1sdMmh3kbefQCxOBDK9cBvY+8nVe3vjo7P1GCzAVa+9gyzLp+Xr", - "6MCal0fVV7vMQCFm/bE5DCIPkYfIayLv9MqipztComm0IHQbd25deafQSQOSB4HI9SGtXK0PKkUSGLB8", - "ece5panxIUhsv3CZ3Afdlhs5/q90ECZa7BI9R4gcIESoPl6IHFew/vRbLjTtSgKjhaRzIDFTFwXI3GUk", - "t0cwymPuPX2z/3ZDIkVEiogUsRE8u4Fz1gy9tTpn581hEHmIPEReE3m7OmdbuLuBc3ZQce+nzDzP15P2", - "oH+2T/9sGym7+WeIksNECbpo92aoihwu/TJ17r5U9qm8PdJCpIVPlRZONhfJ9hOfbz9IsbFitretQJPO", - "cxIb8N3a91OZqpc9LJ57+sLudW7udUqhGuArns/AoL2HFAbPNyJuEDdIE2vDtRlA3GPsot16bYQUEYWI", - "Qgxp9LBeiBvEDVqvwamto9Nz5bno6wtglC14RhfP6N6FlOZ6YbepW5XiNQznMGf2LAQtSuTkegFcF68i", - "ZAlyV7X0zg/vliUPu0/eVj192vletPFwkOd9UvTZXkVhpK89NPirKIJMr9XTO5yDt1Ye+wuoka5CNmOm", - "LnolH3E7d7YSI5+Ynyfe0jSN/CKuNoUnwYi5ej3DCAkmGBlzN9vTq2LMlhwjb+xj7S2LsRvPe2z0grDY", - "IHXGmpW3Qnkhixshdzn+nMRxIWJbdKKUPWQTyCYeLCOwU9eM238t+H0M4g7UJE0SEZm/ZmWRQsb1//p5", - "MPSXD72YWF4eSHFmO0Su6HACMtwnhmXbLazTGG5uuzSBJSTB6qcXkwAvKlolbbu3Yn/CLq/Kfdw++YeL", - "p9p4xZgT5eGTEW9QmP7Uy+WmD6G5pj1da/DbnMWz8l4LEKY4OeCkvq44QlGLfyZks3ZX7GTBS08eTEZw", - "ewZuz3gApTtjiZP0HsrW9Q27lr8W97rL6qVujDpYPjTUzk2MJHQKyaFUHcWFpcOxA7NKMLd0fi2z6JSi", - "U3rPaShLjVoUUrNKLIYZ48zG+9JcaTIFknP2LQ/WjN631p1NZgwSj+p9LZI85UTMyGziSj3retp2BFBE", - "C9/a52wiMt8N04xKpgQn7rGE4VPA89S8yL8PhoPfz/7r7WA4GOcvXvwE1X/+Xv4vqv5jfjp731DszbHt", - "ZLeH/7zrMyxpknvu8y/zM9HC5Z6X7paRe1m+W23Yo3J+w+rNF++rHvI+7NU+uA4m8+zLt06v3H96O7ql", - "iPLY1jd0BwRSV6hUlAYOtGqlZl3OTUGuaveGPJsDnxR3H7mtCbOJ5VmBegbVY2F1nEdWHacUwfYkoHsS", - "tL1KF7rW6FofCPN7J2I26wemmtsdttreM+f08C7n1/vbRBZoqEhfG5F7gJSrj4VnHUdcC/QuoS0FujO6", - "Bfo+AlwKtDfGZX63kMUoF5I0f5TL5wTUgS7AkswY63rAWFdAxTYCWftUsEagqn0I6/N6T1MgYtaI/xjd", - "qgWJ7IStzvU1u50G3gCRGUxZIdsa7X8WUFUgq2/HFKHEXtH48dlnM/Svz/uW6PIYDHMD89TDesKE8rpW", - "fDXYw1T0enoU6FjCUqCryJQR5t2CU0YEffEp85uEGUjgEagudtXP2bHo8fs7oCuXp0R/q9PjHhTDVY8z", - "XGUEpU/E6kgkD0NZGMo6zFBWB9DWCN7R6Pi9c9AO0tjDBCD5OrL40wahOoXvmZA6eDLzrW1egxXjhJJ/", - "fvrwnrjt0FWR8wTqfFQstde5s0Gy1dC5IZ4C0epJoA5MQhp78sLRHrvJYMGSuBQU463SNdcuLAHBXU/I", - "eJDx4L7YPug8vZr1TmhbLPa5TDAtEN1whXdZ/XtwkO5/SRK98keY3qWAghatQFjzFhAGD7Uon4h5eIFd", - "GPvjO/53/VAJDnCd8X5NYLG43s5R674EeEQzlSdUQ0ymK9tcHMqCeDfm6l3GRPKK5BXJa0/knl5Z77Ev", - "h+Xr6K2DEzcjtT2CgB+pBK6bYZDDseuvm473PqZWfgskvI+E8L6t0bIRy9ud+iJY9gUWpMWYhfEwDHHv", - "2uwp1dGC8Xnv2G6v4uxIjpEcIznewOSOpWB2RmbfWjAITgQngnMDnLYYbhCZ5bavywXIDcKtSK4gJs9q", - "/3VtC6waEpkn4P4XLSC6IHohQS1EEqvnrXj+YqeEy+hHKF2TXnlv2pfv+hwV2n9yhj0lxSl2Ht3hCaRZ", - "JagzTOyKq327nP84ZNQ0vP8NcijmLKJJlcqE/FswbkyNXjDVeBN6ASSTsGQiV0RwCORLKcMIG3EeoVxu", - "mLWjKWVCac+5jkaiTAQ8Av5OjGjHIdtzSMVynZQ1uFhbGb8tjbDPs2EuihgExWbUch0afkBYKghch++6", - "Faftc9sNnG2MMdx4EsQdrjK4VQYu7JnD3Q3vwcPsdla4OMm5ZoiBa7m6lSmONpc5nE3ONhDvNc2oNnC5", - "4hCWK6T9kvHpgsUx8EkKPJ8USZS7d/qY3lXKZXcH5zNXjTMhCSxBrlx9sxF5Rzmdg1RjrgAITRLXoH4h", - "TnXlym5s58mKmA7mRq6D+e+KTCERBtrCp9l+A/1r8Tz/sJN5Bzx/WzwMpkB4CsHO/urhQeDmRLnXCWuH", - "lyBR/s3d6S7z0mwUKfSZSluuMHShSOA0aKfQ8hx5yZ8qtYST6Vqzk4hy0ke5j/mu2r0SelTlmM3m4coJ", - "BVWzca32rJjXJnPVLz/M2zVoEhaTZ2W5ueIZGFcaaGwcGZf8xpt7JpNsyRKYe1T8yeeTosZG1cmNNiQn", - "v544uF8yBUdmNB7HUekHpDanV2VN4uv+LMfmi4moimhc1D4Em1ImhXQKUi1YNiQ0y9TpTMhUnZaLt6ep", - "iIv/jnlVRJolzGDH3jPLp+XHViNy7kTF1Vy04laYrFqGm/6JMWPFZCgv/BePITM344L/sIEDj0X7bM9s", - "p7nLpH7y1rhFUxGvToq3EFHOhU3/7oaNO9hf1zr0bwX66zVomuuFq/9VrD8buAWWnqva0ge57IxkbHMf", - "hJOh2njsSMicP34jQnaAcoh7mXAv06ElzbGCfKIaEG1jkIeq3O+D094x70ReedS88tRQwe7YtOlV2zPC", - "FKkoYgJGhtoN5JjvJR5tYfoqyxQaSTSSjzNw4gdpYD0p5BB+4QsWG4ewWlJaWT1f4c1VzDJodEWyFiKJ", - "txy5MW94cqY/jcoy+omYzyG2XiEl0YLyuXHbDNbctzB9IGW62+3qsbT0eEx19f1WHmZTf6oLWNnEw/Yr", - "dq5LN26Ka9DHvxLQfyW4geam7b2jteCjQSsaYlyMPhBv9R8HbYUr7xhtcNAGowV+Sr5wvQTSY7dW1dct", - "jKgFxOWuyALd52C+RqQ3GqzBHXOLe2d1VYfZfVfPC+0t2tsn5Pj2SPPglgxjOJT4VK/8EYhTxOljwqns", - "bTflvVnNc7SZiMUniMV+aVhs8tAyFcvulnPM9x9d6pvfBQGLgH1MgLXY6Uarg5jbxlcemvPEf/2bk5zl", - "7IVQG2XKqFKXQtro0phLmDOlHWQnF7AikUjylCtCJRAOS5AEvmdC+QNNJb6/qB41MxDcCO7jBTfreR7J", - "OKyEZeTZNE8ubFmi5w53Jyw+scFHpkhKeUy1kKvyLOxUxCsHyHIHuvlVUzkHTVj2i/3Tjl1Ef/UCeFHS", - "KCZUkTdvf3/7+S0x0zy9YvF1eHH27I6PQ52tY9y8jwkzAH+OpbmxIOWm+WOZIjFosF6h4C7e0zB7pclj", - "4dNR5hZiVkSKLhdC2U1NzvYZK7bJev127AwPTKHxuEPjYbXyLhYkuIb4XsSwdSLDrhVOoXHAw0l7FUR1", - "pfCyZoSlZdFxzG+69+esc0tuq4HwMD/M/f74ShCXLKl5DsOe+6kFwzg8UyDAqvLwPE9Bssho/KKUeyHT", - "NI4lKBXU7DtK5HJipsdBXwp5oYxgmrHqcfYipuia4NGLB7BEiZh3BCRgaWvTF45Jdb0xDz50/W5u2IGv", - "MvBPtDC3KYeo0kRvZCDqmwP2m/n4jSSwVf4eRB1yuoc8BE9rKXdmze08MsJoONRMyMitgZ2koBSdw8mw", - "cPBnNE/0mCewhMR0PTH842RoSRmkmV418WOcm5ipiMo4vA+swOd+/P1EzCcxi7TnDOrQNs5S7T2qZNrs", - "Q3lbHQWMvW1qGfmbNmIH5ehf8ZjSIW/NMvbn9Mp8rMId6iCKa/bHCX5bMX1nkLrs0e/VrZq0LxHzsBPi", - "ZowMDxneoTO8amNVv0DDdpy60MbtweoxNybJE6w2V/cNV4+5m+3pVTHmNXm2kd/iL4TmMdMW/X/xbYV+", - "Hg5FlPu19mP7GkZq/X2+t77sVkTDklbrSBactd1+lbfHAPjTCoDzQki37FhgtyGaFHRf7jGHV2EjVpUm", - "K7XaxFGlbYdjv1rXhacnThNdDYDnqU3ZmytDzrI8SRoas/YaaOavQkiVAj0Bvgy3OsLnaZ0yoSZLkCqU", - "jyFKcqVBhjyZ+gv4WzmHSE+08Ddn+SQS0r2U7TTJpjlmba0zCd+Cd05FHHDNTKteSKBxy72XwOPAYwGP", - "EqFyCe2tKhF+x3H2Lfa/7MUy8HMmRBJoWsaRv+VyIqZqQhOQemIEv63XJZU83CmhSk+mIvA0tjUSaepv", - "ZUoDBznJhNT+t52IaELjWAac7GgyzVkSm79DHSKrO0KNIi/PT3nbZ4kQ4bEljS7CjUKkwcY/mR+uKTXP", - "zimPYAI8DvTh+YxGOpfgn1oK6WRK+UVAgG3zSkNLs5HOUHMQOVZJhjSNbZxJ8Sc0pXsqRAKUb3SYUL1z", - "1KTU1oHGmj4r//BCTaiMFt7LhZpEgkeBWQk1uQDJAy9FqElwWkL1QWHRqx2FQk0kJEBVsLlFZWXiEuRk", - "KoFegPyxu8tfW7pEdMo46B+7u7TdJZNCQ6S7e5RTaump8ixLVhM+9ctzIPmP5R2TPwUPNUpG/V9ccSH+", - "hIlmSaA9a7WpSlOdK2+TBppO7NTDzY3V8HAn80rWNW6jQ0E8thv+9P7siJMflG3PeUmlpFyvAmruPpIv", - "4anSHoGV0wWV8SWV0L6IRpOk2JD08fWZjd6nkAq5ItXlIY/vH3UH9PzQ87s7OZ5S1VeGf31tRZh9ev3p", - "jCyE0mSaK0JjmhXF6AKibIZAMUYxvkMxriLHfSLenHzIgH/612sX1gikU5aQGBNepukZtUSXuxaagqHh", - "L1/O3mzGhz2rTiXFP8jcwhjIXd83U2R1cmk3VQaRcbLsFw5pyEMUH1y1xFXLAwlHf1kLQres+pdh54NV", - "xxgJx0g4RsIxEo6R8DuLhGO0G6PdGO3GaPcjjHYfx5bDOhRzapVaV3SxiMG4rgEH+VXZim4yusm4udeD", - "tHTCNtW+F3PnoHPJiRFrwlyGmcItBelJDeWOZJlhRkFspmfnjYExEvrk1X5EecwMIZi4K1rTHtG5IlRr", - "Gi1smT8tqs2GXGiyAl20FifSzY/wPUryGDz7DguRfF1O4DOdo9VAq4FWIwDUBUQX/fhZ0TUEuLIVkYZI", - "Q6R5kCbSLGGUR9Cwjj2S0f8GmlQXNDPSu9VFc39/sguLymrQyiC25ZnvlIKPVC/Mfc/iAeLqkeHK6nox", - "8wpbA3EehW4Y2UzkPG6AbSOtCtcgOU1sNlqQBKQU8v7hJncDm7wl1M4RaAi0PkCTjwFmrflkLLCqvsT0", - "3RFV/uwyCKQnDKTXHoEqk9wdO0fsyQwbfLAKklQBlD6wQjqI4Gq1UpVYPRI2WD/G6VXq8oR17Bg2z09o", - "/fyuTGcQYvWeYA/K7gFkpv87Bdr03xagn7319osHU3kUgVKzPElWJAb34du/tpCNF/PQnz60ffCV3vqG", - "bUqy3ER4IN/vZlsGb7Bs/tc22Sj1AB788uuVXr6lvJ2xRocSTXUfU/0o/ElZmWm5i5mWNzbS5/eq4s93", - "MdHntzLQ8ljMs7yRcX7A7/aQpvkcDXMvPVLvpAwvcTZCUwVFJAk1vy8guiAy58TdZceY1Sc3NFprtNbe", - "qFUhVM3zgp741ZGY7piprp0EtotlKv1ORb6xt8Q9BYhJ3FPgg1zPDCRu/86O6UfC2UcQfgg/hJ+BX3fi", - "FAc9pYWkc+ifMMWfLwWBh8BD4MXXp8yQ2xntrH9dwK+o30QalwVwd9bsgehD9CH6POjL+sHu7GNZJq0F", - "cBkiDZGGSPMjTYFcsk4rV2YyK3oTxpWmPAJFhKvSUcRaIG4NtnwqB0M8Ih4Rj214PL1ytci6y1ZtYrIM", - "+d4EmQcKzPVJfCofuDEP97Kqaahl1DKLosobagfUDsemHWzGF5uuzbvM/cm225oq3PVdK19llYKjzqMx", - "P5uROJdVse1MiiWLIR6S4sqca5YQLi7JX+qOz2A0H5Hx4MfFeDAk48Ff4/Hg+fbNhKvcPaznUa46jcb8", - "c1klPKK8HIxpBclsRL7Yevu2Bvl0vfo45TEJ1Rsftaziu3dyyxXSvSXWK1+SR5+Xr88pna03/dOLtPnK", - "yYeU2W0M5Rseeat+bW0EwHJex5/7YKeMB80dgCHzjykM0Oyi2Q3iLc9dbtFWHm4tmuk5Ih94UvzdMFjK", - "LY06a+bqKdMkEZcQB7PeGGRhrpunp+/FVIkEVAR2kyrMJCibLzLLvcmWbLvlQuWKO7H5MZ3ECUVmeZIQ", - "870VSYx1KEqrNochCrRmfK5GY37uBMFVWv0wVSUDyyRbsgTmfrqV6w+N+xWzGhwa23hEGxLXpKT8fP0q", - "E/i+/Ijc6Lu7mzY//adyKvvizL46uB88T0AkRELGxGqz9gK4WPv2yZVM8Go7n+UNyDJWlsHKMvdUi+Cd", - "iNlstWdF/VEoffBqejjYzlO9YcSoBnfy5nLBokVRNCqlOlqYe9tUkuVAhgnNEjqfuzrw7mVqCA27lvh6", - "b6NSYu5rhjkQo7QPBw7t0M3o2elV7+pR98HRupzLTvh6HMp79iWPxEM4RtpURjYCwtiTOx2AjGEYEcOI", - "T5DaHYp23we5fGK0EEngIyGBGXCasVH5AQo7u2U3P10awZCDA/iqBxAhLd9mlk8TFhWvsrlTsYs9l5ui", - "wmS4sRVxPwqq2FT0MrxbyS7GGC3a5QcWt8IA5dMKUKpaJLf1Q3DnLBJbjEPeFVl9LcEQHCFJXlZHLXeb", - "Ppuuyl2WxYbLCfPUyjDMdO+qtqPgp5lLqBCpbcu1UJoGqpKZHpFI02Je3vZYcuEqpLZ0yeyGm4521dYh", - "WCDNtIdKHJq2WQLfJ1GWTxZsvrB1RNVCJLG/LN3aBYm47N0/pd8nm8/g7cd4Z7/Nkozrz7OgwaYWGUhB", - "S1HISrBT+0foUc7RdMsSGkGrxNjNlYoJDuH5dpbzW0YTLTKRiPkq2OGSLiH4ngP1IQ+iAl7JkyKrc+Ja", - "6TztrEPe8wDdwePNAzuUxySiKqIxEHc1YVoRCYl92UV6mFE7We6KJzzExnzcivQwZLWZUKiRakdVkhKi", - "sIcoRBgfxvjwgVDuL5tEu0F9W8j1warmfYVWkNA/EUKPrP0YWfuBUfWDXxfYovU9y1hXfD5Yybr4Iv2K", - "WSPZQrL1RM70eBB3p+WsyxWoNozuVNQaveunYAZuXda6CtDfrLJ1IWU7FbdGK4JW5MlakX7lrUtUhitc", - "l8DrVeQaEYeIe7qIu2GZ60AZhrpWUmlE19MmdYe0dyyBjVBGKCOUb1FCexPI8s5gfH7YIN6oxzGzLurQ", - "nfFveSnAI5qp3C391u/FTuubEerGvBK6NG31NGKY0TzRg5czmigYbsVWUbmgcjk45XLDwuHFPf11mLa0", - "hr98OFp7BOT91CQvNfnRo3UfXN5lPbs5BTh4At9m+1veBtp+VDVPy/bvrxp7mA6sbZPsVdP7OGhBs1B4", - "WOe4KrHuLd29jvm6W1Hx9RK2x7U14ecXf+vT928HtYMtVAk/jJ7GPrYnhx1nn+/HOn897nL8jwY5nSbr", - "thGw25LfxxP2QuKLxPepEl9Z0V65C+2VtyS958dvts+PkfKeI+F9YMIrb0F3nwRqDo7sniPVfWAj5YpV", - "7RrnJQk1vy8guiAy59u1rnZhu5/cFHDlBlklsko/YGOm+u9xdJ3DyHtTtCPcEG4INx/cqvKqdQ2aXbKe", - "1aUgm2kftCAxVYupoDIeEgkqFdz+y/hMuJ527/EkYUtod/bOivsfRXwIC+Q8qWTFWxgw/jBLdqiHikKO", - "5hLN5RGZyyobQB926imTDDRaEDGzGZHcvcJa4X3RjuQV0YhoDKJxnbjebf3yBjLRVqN2QO1wRNrBjC1y", - "GbXY76CeqC69kao4rwZGnYE6A3XGMeqM9nM9VfmiNtVhyAaQaEH5/JaK5ICP/6AuQV2CuqTUHWWViz7R", - "glpR2Cj5BaxOlzTJgWSUybY4wXkxDkYKEIuIxSAWO7h/EI2CE5okndG6Qyf5iEPE4QHhsJ1PB8G4xaF3", - "gSaemkd0Ijpb0LlTHkh33oX22P+IiR0Rd4i7LdxNqr1XN9px1V1w8qy6/77KI7RWnawjXkVZ36EtPmts", - "tAbJqWZLuzWsgPVfSB3d2U5GX7a9DISUygqXQ3PHKZBcQUxoIvicXDK9IJU6aCnl1VU9M3TvrXnfZ558", - "LKN5eGU0CWsgLVhQswlHrKyJlTXvxbSsFXMLS3LVP1BlizyrHK3nfWQc6R7iDOleAJMTt+1okoh5Oyq3", - "7Uu5YykR8xF5S6OFrY63IkwRSjRLgUjK50AuFyChZSviJbW3miatVSNqk+UOrv0u5mi70HbdMU52RscN", - "MbEbFBABiIA7RkAZfusMBWg6J8+meXJh2Fr6PBwJKCJv+3H+NZ17HefPdE5c29DwNjO5KgTg9ZFryvZH", - "edOv6Dk/rZq+35nSjFvB8TrN/pgxalrUtHeVW+W1rQbvtOsokEtl7/o0pppuT+VXCba8W0r++enDe2I6", - "bSUZ03Tui26amxZVt3zV5eZ5QiWB75kEpZjgRMyswjZetSJ6QTWJKLe1u6bQqOdVBz9txbmWwcMlRDfV", - "vu15H4p/H07mIej6A0++Yn6vD8h1Jv8yYlck/jIXtZOY8izcfpDXtbgQku27Yj/1cgfyoKfFg2iSGJH5", - "wXz/Qt2mZiohShQ4E4q8CHnRneecM6rN7vgIqeuSIR2GsnZougXDquGI9uAR24Pj4FVlsHNXalXWhm5l", - "V2WMc2+Y7b/H4v6hVcwNkfU0mVYZ/e9BthqwQL6FfOvB+FaLDi8p1wFq8KPmX2gkkH416deVk4w+uRGL", - "4KxNc8iq6hDW0BjJtgEy26hqzAaIWdcuqrM3Nn5bRYM9+6Qqie7cJ1VtvsWUgg+XUtAITqEQVgFa8kBC", - "sevuuXsTooP+2H4T/yWLq6Um0tD/Aev+kGpg3wtdXQtWO64p3bl1RtfsjixpRyrF30AXptJt2yqtKquP", - "nwX0Y6+0iQeiJO/cNbytFmYaUuXBQYU8KiVd+XBhnW4xKz/i2tJxLazb3J0LTWYi5/EhiWnf5Nj+pc0w", - "weuTSPDuRDU0TjHnA0lQvXf/6Emyzl3WdkI85MlI675Iz0YIpIfMYjDhCQUT1hZ1euxz35UJhePXT5MM", - "YZz8KZy38kNs7RzkDRZQwxzuU9XhYAyjC8yX423Uu7v1OUokdMdE6ELyW3C6pym9SPCQ4N2N9VmCVMx9", - "NC+jk6BzyQnNGCm7esjbv6qmO7P25ej7WRCvXgfN6JQlzAro12v3ZuWyVCq5TAYvB6PTwfXX6/8XAAD/", - "//ZvAcAFcQIA", -} - -// GetSwagger returns the content of the embedded swagger specification file -// or error if failed to decode + "7L3rktu2uij4KhjNTNk+h1E7l3Vq0q79w8exs7xPYnu3nb1q12JKDZGQhNUkwACg1IorU/M082DzJFP4", + "AJCURJBUt7pb6safpC2AuH53fJevo4TnBWeEKTk6/zoqsMA5UUTAvyj7hNXiV0nU+1T/OyUyEbRQlLPR", + "+ej9T4jPkFoQlPO0zIgkahSNqG4qsFqMohHDORmdj3JJ1ISmo2gkyB8lFSQdnStRkmgkkwXJsR5arQvd", + "VSpB2Xz011+RnfwDT0n35IynpH1e3XLTeS96Ny26tixuuOX/KIlYv6OZImJ37jc8K3OGZtAcIUEKghWe", + "ZuQVkmRJBM5sm0QJz6eUEbSiaoFef/hpjN7iZIGWOCsJojJml4XgxTm5LsRlhOAfl2hKKJsjjPS/iFBr", + "t9OMSoWe/4tTRlLEGZGIsiQrU5JGCMuYzbhAXKRETNcvEGYpuoRxdVfEZ+cxQ+gbpMi1OkcJluQbyiRh", + "kiq6JCjHKlkgzNarBREEUQYzwjpfmQ8v/29B5uT68hwJMi8zLJAenUhJOUPPL95+h+SaKXz9ItoZ3Y1A", + "2TmOplFyeW7XVG2LpGYu6bqSP86X+kQYOV9eniPyR4mzCDGuzJ+u21yZbnNFzB+Zcv83H2q0woJKzmSE", + "9AGxMp/qm9Hnk2LVmDEv1Fp/+r+Zv84R42ZRkT4X8+c4Zq8ZKtkV4ytWXVDUvCx91bxUCKME4CRCXCDM", + "EGVLnNHUnV7MGsdH9XrkigiSGlD54eXLccxG0YhcF5lGLAu1AOJ/aOCsYdzA2qgJ0lSRXLbAduR+wELg", + "dRPWfxa8LKbrNmDPc/yNJJoi6WsCIOQzt19KJFIczfXnBh2JLDOFpmv0nIznY9MyXf8bLopILhO95hfj", + "UftObN/RIOz8heZU7a73i6aD+JrmZW7vWq+WMCXsUgVRpWBj9BLlBDOpbznTQ/kWBY0bS0rJDJeZGp3/", + "7WU0yinTc43OX1aHS5kicyKai/2VKNxCxAz6opwonGKFHdoJIgvOJBmjt0zTlVQfp511jH6TBM1wJokG", + "rJd6SzynKmbAAYjCaEZJlo7Rl0VjZD5D2NxdggUcBVX6OBTOGsck+ErGzEFwgeeUYQX4DT1faDqDViTL", + "9P9hpXwl7YmSFD1PeMnUiwia+GwmiYqZRjSD5vqQAajbjlmvdNjFf4SBd0/z8xU1IDijQqrqyi2VgVNI", + "SiG58N20WXH7VQ++6Y+GAN8UkSQXGnnG6JMgM3q9TVjQN0DE9MiEpZpNAMG3uGaJ/79phqv3FH2Di8KL", + "bbb3sEP/JHghdzf12rMNy5g0QBPN8OD0U5rozxgWa9+aCphm0Io+K6xk2zEzJXhmwBOWYSiswywLqo21", + "GNyIR1IPGI/QFVlHKOFMYcr0CevvJMlIom+tsc2USkVZoiznQgD80rczGL1zZ39pIcUgPuzrh5cv9f/0", + "SggDeMdFkdEEMPLsX1Jv92tjvP9DkNnofPS/n9Wi5JlplWefBJ9mJDezbB7Y/8QpuiB/lEQqzSB+ePnt", + "fcz6G8OlWnBB/ySpmfb7+5j2HRdTmqaEmTl/uI85P3CF3vGS2X3+eB9zvuFsltEEbvRv9wNH75kiguEM", + "fSZiSQR6KwQ3lNF+rMd+DVj3lv1RkpLsIu9HRhCGLpqIENPNEL5Pv31BZ6YNcKxGRNhRYkbYoU9zwlRj", + "SFFq/rMjFTkNZVeawGJOFOg26Lntpdmuo7Av2kYTbSNdEMlLkRBEU6CQwA6NXCgVZklj45r65DlGFa9o", + "m0Quk64VSyKWNCHouemn1+ykr7bRlrkhU137n64RMBVNS4sMJyDA2zMxsjVmiLAEF7LMgMVZlXCXhNfK", + "2D/d1f1e9ePTfxEDua8zItQvVKoLSxdBNd64eM1Y9P85Ix9no/N/NmTfLjiGkS/4alckjr6OcJpSvSac", + "fdoEMs/v28JAy062fvj9r8gIPD3L1HsH0XH70GDb3iPTG2th1SmWiynHIkVY99LC2xi9XRKxroUMKhEv", + "zCbPgfOBTiovEbCzmFWGCcsSJVotaLKwuo60zBIIgOG1cowuYbpLPbbeY6lIGrOZ4Dm61EuazHJ1afRV", + "+KdmzZdGfL3UECTHttXCtP53DQQxS3hOEAyH0S9v331B//7x/Qf4AguCWJllaLUghv+bjSuAarNYrhZE", + "oCvK0pjxGTInacTULRKjP9091r+XOWZIEJxqSR3lREo8JxEShKWgz8HK3D6t2ml3OW5DRWhNBAHEb1Ph", + "qs+7Wyd5+jd/D8KW/sZZ3jG2o1f+Hp0Tg4WEqnU74kAX87NvgLJIvUdD0/ZhG/S9lfbLsSPouosGGX2Z", + "Tunepb0OEC1JHfZRRbB36eEuGhfF3dC9oniUVM9sa5fmMdSQdVDCU3IfFK+NehRFK/ThopikPMeUeZsV", + "wfnEal+7KNHc7x4Y4ceitot8w/Pi7XXBhfoVTMy78IhLxWf0unUNOU8lUZOcpxOHLTeY0+r8m9P6tmen", + "9EwH7XrIDVtZF0juHMAuBo0q67tst0rpxVTmiGRBsxQ1PokGG+2iUVFOHUzLfcx9lYJJp9ub7/9y+N6w", + "UjhZkBSJ/TfXDQkXPjiYNW+7lxT7oGb7XHf3KXhW77PR3Zg597vF7bvoma3R/UazmaPzo4TrYHbV2cXL", + "oMW+CCBuAv5LLCie3gx9/9N+uy/kVd8NJkFLLCbGxtG6Kd2cZFhKb6v3pnRjlxSk28EmtQelrWis2e7u", + "BVYdpNHH1YLQyhCJmZIRcpZed6nwg30Js+L2GpWSRDGz5rgZFzlW6NPHz18Q3FtGtWh5RnO9CJCqW7lp", + "PehgEHjnPjEbfK9I3k/Eb8QbNIHqIaB7jnvhG9V3mxfdd3nRfZPVRbbdHdq4upgd0d3d5wmbzf7C53ci", + "pm/M8BgF9p0NtpgrRMmMab4GLiswIc4QBusSPK7Cv5zBqzKncQ2nGkJ1v3N47rIWtufJgiRXEZrRa03S", + "4Y8XEfQg11SBmoCeX4qSTaTCqpSX5+gl4ldRzL6FJ2h+FaHv4C+rXUwzYl7c9RgZn/cqGfbh32kZ6DBK", + "xmHU33bG3XTziJBxQhiPon5hC1wwfCYBfca17ba1WfM5b2PG5962vFJVWpvN1bYfWJuC330s9gt3Mq+M", + "3QmMogaQWXV6GkhINht0eHsZDWqk+gx7u2PSZCZ53NSp3mMrBGRYqpvRqWeyolQx4wxRtadhwkcyYtZp", + "im0QNT1B7TX2rEH8BpC7Q5Gfk6QO+yDlT1Re3Qki6oEfI/K5fbU9YFB5hSQhrIlYToatJABj+Rd4jahC", + "U5JxNocXt9WCsNh4bt0a12J2SCOg3tcEZxlPPFZxaNdb8mARdEjJsrN57m8De4K/uWvYjCxJ1rHsnKcb", + "7Vufe5VcaBW4a2pB5j7SAO2S/kk6VlZKknY0LwlLPbp7nzzl3ZSXckCT97P9jLVGW7oTmmOGfoxUp95Z", + "C90xKqtxWk04M7sxNMgQAMf/M00cuEDK6BWGRtQKL7xVTikj98PrZ5MMT0lmX09nk+RKlvklvIq6d1g0", + "XRt1RB/MFEv7kAoOc2RGGey0VYvvsm3ZqTxt4J7oaYMFe9p44WlQzjDX0tZlJ5vVVrIbmoz96NdhfXld", + "QwTcDAFQqH+jqulFISMkSFIKSZckW0fGnQ54HtUABU58JHXejmP0msHfa7TgWSoRofC+je34WgxVDdUF", + "s5htuGxUy7hP080Wkjam+b3/gN/q3ba8CGjpzw8zcG7tRGhWuf3jLLPUcY8t2qiBv37fVu+qoVu9Vz80", + "lMn2G4lqNwZzw1Qaodx2GaBQbh+0O6P6RAYceB0WsX3iXZh9I+z1WbE78LG5Pwj8cDPUpMcup55gwKYB", + "cHe3bDrdFBsM6LZYMmedLzXQKp37681J1+5RVdNWoNp9NncualRzPF6ZY2OLXmZRP6oqXmG8JOq8Yahv", + "eEVFqMhK4+NfcAknEbPnlxbLL19UJv6Mz2mCM6Q/xFp0+Rc3Xs9U6ZngmVOQJeWlNFSnjS8AvZrMbKyV", + "HyabRPb+5YdufnATRnEvkkfjWHeX4Ptd3+LkBjLL3aLyo0biCz1qp1/CjSlz97xdZAMoBGbIiYlG/zAu", + "C3xWhSlqamAcITee/LCKmVM44J0AOlbG8YfxpIIj7SIee/DOLYuutddDc1PuemcOZ0UlaXXZhEH390vs", + "xMTfJJ6TflTsEtC3Qh/qm63lSxPfoi+Owdb2xGcy289VqDas104CguhzSipllDaO3ngB265GaaESUYYu", + "q1u+PNiy1UIQCVpTy8IXJLlCdQ8IhItHyeIKnGHG+g9nzz/P+OqbBZ0v4tF4P88njxLUONGNVe6ShcFE", + "i4v8bkg9F/nDUnnKZrz9sSZZYDYnKMfwHMMQRjlP6cx6cLXh9R1xDHtGbUSbi9w8VdfWFwityCdrnGcR", + "SgVdEhfbVpRKanJVTnNq4ojJdWGs006846WCXhSeqeTYjFUPrtGpGh4VWEiSWroes1tapxxdN5GpAwi7", + "XkcXYdftXY7xW3vbPeDtnUYITyVhyijWVKGUE6NTQ/uoTYPXQ8x4tikUbq3Bz310q/Oe21wbn/4rQkkp", + "FdcXrsdHXKA5YUTQpJXpuM3ckuNA5PedEAMY+THKfNXGWlC4lEQY/8yxRhO6pBmZE3hsjUdf4pGVMaqW", + "b+YCM+DDJoYeszRm8eid6wmyGzVxquyhvNdv6mVe7bL9nZVnQ10U/z7FdwKif5/ixwigdlst4LngUqFp", + "KRFOcaFM1L97ScVaGCu4qN8FEJ4Tps7R5WKKJzQFKAazM5BYsBfQlDBFZ5QI9BwzRD+/+fwevf+PD5D1", + "Ar2jU0HQmwVmjGToH//49OFFZEbTa740gymBmdTzPtCzrNlcK4i6ld7KrbzruXC/p733bMabOLAVPVsq", + "iIWzMWjmaleCKgK6nDsCxDgSJOEi3Y2jddLToLUYcfdO8NIN/hiRs7m3FgzddmQ0gK91UrhRzmpPB3iE", + "JK3Ya4QuQN/7wKqbRGvaREZgQ5Ov6q8hs9Fu6Ca4zgm+0ssHeZfN25A552yCi2LHf6cZ+8MmeIlp1tPH", + "6Aupv92kiCCiZ5yUyqueLtaAKvifhE2w8vYzPXqaOweQPSuZl0Qq7m9fTHsGoH1HzyFDVt/hywUWpK8P", + "LDjjU5xNjObT3bVvuGXiDWyB9jVLeobosgHp9mVS+JzKoDkneVdrRzibbvau/sDhr+YTLidHFDD7/m5U", + "mPePUn95742Wff8J4TQVREqUEmVS3jR87RzJNg9DjKgVF1ebbnbjmN29b0ubb12aejTyDM8nKSkESbZw", + "c8A7CmVq1o5xOPH8Lq/a8YyoyZTMPXG+0Co4ThMslbdHwvPcpnBpbScs9bbNsSIrvPa2e4XXLms6NBLV", + "uWkLJd72QlDun7rw+TTqRoiMbsRFHtZZz0tO95PZK/TcjZnWQogmgZPCZdcaHgQJ2aa87ouQmOqW5Mgl", + "l7zJ6jKXnG93Hl6lb2tZA1c4a/GN2UhQt5EOczdXXdQMXTMe6yR9hWZcxAwbI4vNvmZ61tnvTFTtGP2D", + "qoV5BNruAdODv5xu1secyE1/Oi3ZGvI0xPZ2Y57l4x2Pgz/dVVjdIw2m84fQ1R6pGZ8jstxfG7xZxh+T", + "etJYIahElxmfQ5Yfk1vS+DBe/p/Pr8j6hbxEXLh/pJcms9TCGMAFgX9V1ihIUkvZ3ObP5bOYwdCQMShC", + "GP37548fbAofvSaKM/onSbVqjJEhVmOjZ4Ixy6ipIGWCV2zMIPOr7Skb7nb64Gz4OuNGE+XCqeGvzKk1", + "lN+YtWu/qFZ+q0RFsspUpPR0WireJ7ZGb78jRAZOxxci445ukDSuO5Mc02wirQjS7+QD3zAl1oPdgiyg", + "eJc7Vzi72nMF2xEKmyOWkoinqjRV8ep3Qm2r0R8jza02Z/642wM0fzyBY/SwMRdN2RpkCW4iA3lazA4Z", + "bt3IeXTjtwGbqKinOedp42W8d7L+hEsbffbTZzbQulXm2O+CwHJd5dedrt1djQfzQLuVDteBAemgul24", + "Og9C3gcNkE+ACMhbUYGoCoupf6v8nKtfnsmYKYJzeR8xWN1EY9v7sJI37U7BE+7algTQSq4tDCGvSNrv", + "lNiaHLYxeBqhly4tgeArc671wbk5zS/jUXQbxNuLvN0dOTsAIYhGADyTRu6vAbm7jGVhExD19cIo0nj1", + "72T9bb1VM/uWzWvY7M0EYjMbB9ZAnv7Z24jEB2PdG0b7BlE8O2I7ofM9UN8VaWospi0enSQZFiR1lvAx", + "ugQT72WELglzGmZl173cNRXF7NJ+aztba+plG+nwm4+7TcddZmOfybjLXOw1FXeYibdMxJtWXq992G8b", + "3rILN/nYEKPwfpzeQsFnMtfneHhYtwPvB/J7gnBjjtY0qfbVR4CPrHEKMh9GKCUZmUMsouLAXndTEQ4X", + "1rreGiSZd7yR6FYfuOo2Z68nrMz1iYCJNhlFo3TNcE6Txul0XjZPyd+xSFdY3I1I15zgMYpz2/tr80Kz", + "zaiacIgf2jOJsNScsyjl4jxml4uVcyMzvLUebYZzmq3Rc83nyDXOi0yLcwk1xsac5Jfgh7aaFFgtrBua", + "RYF7ic3fcJdpNRDqr+xzK/SLmU0q0EgstXl6dV0q/UGro9uqI+XkYjXpc/PUXQRdegxm9jR9bd7ntJtn", + "LbP5VAba3u7YXLcnS+Hp3VGXx0pVPNSk8gxrpKiT8MJ3D4ahCEmOsJ4+Zq60FmfZ2ubshbo6JEWynHqS", + "KhjrvR89vJnDNSn05vGHVq9ANqVcTpZESB+mTzOckkmCp5QRj1CZlVIR4UNQ2yzHrl97Gr0PW5kFn0lk", + "P4h2yKAb0ngMDkqfV71/eeRixkiiJqpdo0iKcpJw4UMF3ZzSrtaZIH94R/bnRdKtagH5U/1jd2QnIizJ", + "uCwF6W6VGW+/2dkfqYf8Lz0/F5xnnqZlmvgYAp/KCRTV8L9Q2V4rLDoyvWVYqsmUe3YDrVoDam+lUhFG", + "xMSlaml7QkomXuci3TgtaZbqf/s6JJvlLrYaeekSmLS2zzLO/XMLnFz5GznPvY1/0sLjwKT3zjBLiFfa", + "zjErZzhRpfCIAjnJJ1PMrny+jrp5rUhHs4ZOr6ekD3NAYvBRRGjscKBttPs8aG/sSsS4qgIN26UvLidY", + "JAtfW8JZ4lkUl5MrIpjnSBoSTFvbABy0vbpxkMuJIBnB0tssjf7pazbSk6+1g9oVfEXEZCoIviLi2/4u", + "33V0sfzu2/4uXaMUgiufL/JGD7ekjp6yLIpsPWHTdlTwRFBpfTiZ/MmZr1FQ3A4uknH+J5komnnai06x", + "ocM9GswysHR/c5/VBjrpI9kk1gNc9tSfe5qBolHXPldapmZq7aGQbYLyx6nkGeRYT8hnohRld+Pj1DLP", + "Y1QHPNtsM23xRlckTV8j/GuaBi8qzJVEg4rQzmmw8nM2+rcomeldmy+AFaHnl5pAGktEPFqs4tELW/P5", + "42dkyeJWJy7j0YtDuUp3Blqj35gk1cZEowQqlmjD32mMYIkgkFxCcfJN50ejVpkp4BDtOUmk+KutM9Er", + "49LmmbOBMjJm8WhJhYpH+nhipyPEIxPtw5UpoUrSfRyghnCwjS6djzvtXSfTtbd3hx+ubvYzXwsNTYvl", + "YjXS7K7FUGn69/DgZo/eXe70bN9kG5J/wskVnpOf6Gz2AWqTb5OuG8pJW7jvRml883v3ajz2gcL0QJai", + "m8i6LHOhDaZEvLWzmSomNr7MVhVUSKOwMjXr1cJk2hu+4+Jq7pftdKMXRnSjl6XpRj+P8p5lNeHmCI1l", + "NubtOO87YV527MfIsBpb6wDRLdCs7OGVDdxaxmV7wviY3YJ9NIxbMauzyEo61wLrkqZEXFonWJMWzvxW", + "VUCgc2CPV2RtSmFY9hKzyq9Bd8Faa9SNpUvFvY8t3FTzcCagg5bAOCpjci/NsIBScYNBI3YSGknngwca", + "HBKvO3dxom4iFo2awDdgwg5uJYFBHObZdovltJWRag34sUDoKY9G07o4WpMlyYoCLKhUXEC+xtef3lfx", + "/GpB8vFeFdRgWE+WpI2pmxWiAPWjKpWcLQc9OP3WttTQlwCrOiy33GHpruzZt5JgW7x8514UuW7N07wo", + "c8y+qWr7kusiwzZ5nixIQmc0MTqCltuTpBQCdAxziZA/Sc+3EQ7k4c+wgrY1X9yhg/bF43XPvhjqoiru", + "w0H1Hmov/uU/BMgkuHsM/1hghUqptcLqFFqyKbSWwztEEdYO+NilU56Zb65o9E7dXcqyyl644GD7r5Io", + "mlgjKG65QRkPAihD1u2iRjpO7UZVKPrn7gBBVz3zLsmYm+MRk7PmFlvImquLuuMiLR40TKIP2I+8gOoN", + "RE5XX/M+wF4+AbiXtwT8CPEVQ1xsFFZohAuIOljAGD2FixXYKtWxX+DAYdEoWdgi8bvcqMBqUWvKbjfW", + "er1RTIIzYlPXYhSXL19+T9DU/ZHEo8hahGdcwMHoY6uqLbf6o8OqJhnxrKwROu84pq0fCx9G6NveuRqA", + "aNIktdfP+LK9VXcMNYcm1fj777OeeuILrKCp3mfdMUIv99lcZ573jaTWu1PXUGoxgGmFosRZU7IbHCFS", + "oVN7jIjYihBx3du31UflbyAbe+NmxFZkRdIfJbMtVm+OrTU+mlClaUd9qB2BGTcOCxFHFBQihoeEnFKZ", + "888Ei2Txsyt1t3s+pqt0WfauKEvrlAP6HPT3uzoSEcJsfnPEz0TVkAljJbzMUnjnmhI7mudQKwFgK8Ej", + "c6V/Ck1UYbmNAojAdfTqNcXRM54jqyBFyGlDEcJFERkz6oSwZYRqR74Izf5IWYSsodI6Geuer5DRGSJk", + "FQT4Y2KG0n/tjATNdZI984PiBc/4fO3y7Lv8CXZwuyr9eZ3vzPy9OdRWYLzZXW2TtbleWJVC8RVQMr1a", + "/Z9JynPgPY3Ddbl2bYFT/ZP9KE1FFLMcy6sIUaZmUduZuiRJjSNzERWvkC2hGMWsqngYoapAof3TVnds", + "Dmp3Z8fUvV4hhedmKP2H6ab/IteQqsd2VXhuFg/5GiI0o0Iq2xvc4cyfpSRC/xUz85n+t/lOE4qoTlHc", + "clIgCZnOVcbrKGYwev0DcjcGWbu5sNMbpHbFkY2LLIwVs4bJQF98I7zQdq8MEnalDe5R/0vjUxSzTc5R", + "FWNufD6rv53tTFUx1Vcx29woqvJ42z9twm77HRfW5lehcbusvaFP+DV6jcnNV2INIaNK0dfTWDAfGWfh", + "OqTKVLLUBAbPR9EIUl1EI1Ps00jgRKpRVFt56lIDo2axMpNsvPVZOueiLRMt1BJp0NOKBgI9RVOy5hCY", + "y2XtkNCghFPOM4LZjqIAR+HO1U7+u5fUH8ja3+QbfUZrrybz2dzWnWiCduzHqAA2ttaRKrfh++94w8m4", + "//f40XtD5Qz79VaZxaXiUmGPn9wWd/b26YocNe1sRuc9zZ1CHHTrqOmg21PBeEeOI9OlYNYVpatddnXw", + "elpYAcfbNsvI9SQpysmCzheTqkCL/+KqDzK+Gtw/x9eT7T209qNsUD+FxdyXhw86+V2ldfMC+z9dcKn8", + "BuYO2/MkJ0pwixLeTt032e9rrXtBYrFO2IZnZ0k564DMXndZ3acbxUxzL4440dnbYYWXxHsjB6os/Zu8", + "o2KPeuDHyL70vj4JMpP+pP1fILk7FyRFhSAzAk/I5slf4qV5cPz08fMXdKbFN3n2Vf9vQtO/znR3E0oK", + "saY20R8jmjvp3YtCmDJuxgOTMPVKqzjG8mWT5OUEM4niEeMxa0xvVxSPIhSD2Oi8dZzrJvymNVmNItOM", + "xCOEM3rV6pLjYGIPIXif8+2qw2KFAjg5KxFcFljKFRcuO4MgcyqVAHIxuSJrk6QBTtF5QZHUOClZqfQb", + "vdFKJHh+abLibZCdyyhmlzTf/hFdZjy5mhjB+vIF0gLD2l6Qvb9ntkzMGZSA0RfLloSZvKYul01KMmx8", + "rP4oucLVUra9e51f7wNlZIZzaY9BgxPrzs3XcqpD+03ggNpj2ypVeC9pi+Y9q92+60GdOtZJ84546Xzi", + "VHd/xJu/tYbAdo+sBWdk4s3IARDnlTxNa8qTKyImFrOoh1ebvlzMJ3Nnktu1zjaR0yM2CKPjW6zWKNzO", + "6fxH1sYi/sHF1Szjqzthd27wx8jymntrIctWJbLxF7YvAk2lzvbQqGgHLw4zLnJj5sTVNzEzte3G6BJM", + "MAuCU1eiSNU8tTEU1MBxM1GlSXRtr6rywW6asCA1BII6/PpbUrxCl0Zig4kuC8JSyuaXUCIlI5A15dr0", + "RHiF9cdmRCwlnTNCNBNIMi5Jetl4mdjSU2N2u0AQjydvvavI/sPYrezOq4Jyl+1pKHS7Hs5IxVXa2rpK", + "C1U9tVmMouePYLBmQn/pvLrwXn/Z5AZQeN7UdI88/dvw4Qa7727U5rtxbsgNwPGTegu/AxPiboD3sMy/", + "tc1236A/jQdyaCHChh/wJtg0Gmwul9H56OX45fjbXr9K92mr76gkSSmoWn/WxM6m2MKSJq9Lk8UEiCCY", + "I/Wv9VwLpcASOCVYEOF6m3+94yLHanQ++vd/fBlFjSGgdXuMv5rpnaiCjfGCMLlMGrm7cUFHjeMZfTt+", + "Of4e4ngKwnTj+ej78cvxS41vWC1gI2fGYAJ/z9veyzVlrwxoGpfNo4X5ChUczFb2rd6mqPijJCUZo18x", + "w3MtUEtCYoazzH31ytaQNuI2WMEkqcesQshMaBguCj342mTe3nqHNNTDFKWnnL1PR+ejn4l6bTelN2op", + "oAS228bD6i5nlP2HppufoJCB5rDD+v8CVQyG9/9oShsM/8Cw1sHdP0Pd6j3WI1Iipus9vjA1kvf4AMzi", + "eorfQRIDOQmA7ruXL4HkG80TpJf6be3sX9Lgs5EzhkghlRAGSLP13PC/NDb8zczYNlC1sjPdqYn7AD0N", + "rP/n73rvTcz+5+96bwrPNaQ1Mor8DkHasgW1fuUpna3hObGBOObl1miSz2j6DAJlNL/ELNVcb22Lqxt+", + "Dg7kxkRnR3lV25WfGZL7bEOjAwoNfhjowlBAO8oHnpK31yTRmvsbnhfwd/W4B7NW2Eczat1i9Dx2/jqd", + "1CZCfuKygZFWsvufPF3vdfFtzoJbUiPMgRqniCCUrYMTbWWZISv7FImeQ1VkfZDVeVWn+KKXnbTW4t/s", + "ZOsE3woXWiZoA/gfhgC87gR9vx3S91vT9/shfb83fX8Y0veHh0LQsgU/3zIDSiagzrKntiCbplXm029f", + "kGOqUCfaWt6mPDUGFeebEZnKp1CdBvzBQAV+ZavSkCyVqNA6K1MW2Zu4fh6zmH3jXAwMRQCL+XlNTpDT", + "Zdy779bbVwT92BxxFjNkupqSFRrsn3/zTcYTnL2AdTrfLiJ5KRIi0ZwuCdN6mKCp7ito+mKsh2nSFFSR", + "lEFkxK5rrHdmdoNwxhnZ2RPRokHW2IgVQxpeFS62BlWyiySEIZzRJXHiihZY0bd/QzllpdIX9Rnn5jGO", + "CrD5y/HGIdu1NCWg8ZD96lV4tmxJZsxeJwkp9B4s6JxD8kL9mZb7IvMv804WoZkg5E9i7Xx4ZWJA7T5j", + "ZjxUap8W/Smk+TKjQJlJ82dxNbd/YJUszJ+mnlHMkgVJdD+5liaUNEIywUwmknoWAHsBzmG9au1WYvbc", + "OA5EzTTC1n/ghdEPAcOMJiurKH+bwQPi/GNWOzVhJldacqwcmgBN3dEBgv78tsbCs680/QtQUYOyLS2D", + "kYu6Qq8NDuJshdeyGvy7ly8jzwwSURZrZoxh8RqjXRGbAkyds1KS1HEghsDx65XDcJTS2YwIg3jZOmYW", + "iSAnAhFzEKcVN0EiDaA3LhAW/1rZbHkALltbqLoELTOPpY8gBQ6yZ21/tmXR+v0hWOSX7dsF3Kyo9CtL", + "VEwdMMzcg4iDjJjtgAaqIMOQzFkpcSYrQNBXd4JM+YeXPw7p++ODMPC/otEGthtenhHV8pD2E/zeYClt", + "OiyyOuwOdbdKbcz2FoxBoLejU4kyPp+TNGZA/pCpIYyaZn8TGE9VledkE9vNNgxG7eq5wwRjqhshF6tL", + "yj2C3zdRMNpFp0rsva02d8Oq4n5J924Q5QEk0lZjzE9UFhleV168NgMCGL+rSON+sI5Z0zaDbmCauZlB", + "5uHgNAqmn0OZfo7IknPUSiXwJEgRBWUBvQZWh9MmsRj0lUhRrYloniDR8xTLxZRjkU5cK55m5IWWXE2d", + "+5hZ9wr3viLr0v8mrghUFiqdG4aL+UpwlhHxCuWWHMRMYztZErFWi+pxZheb9VLfwq6ChfXxo9nDoY4c", + "KMgB6jyfltkVvD6+MMIWOHHYxjo+J8uaaYnSmJE/SgxSWyKoIoJi9JymEdJYZ333q0gOF90CbU7DjtD/", + "9//8vy8ADc1SU42ZgHE5XhsmahqqED+zuU1mywhJjUYB6CUti65NCR1SoDmrQ9lWN3bX+l4HPaSmE5sp", + "i5vFpd3x9TvQDEucu0fFysOrkUFO3UtOhUdDcg31xecW2ht8rGJgEEVKBUSgPoNuzzbTlIGhdTO7jjO1", + "CMJMgiHwPwBwm+Um/Br+kdJEdfGv8Dp42rwLLvHEXvzegGOLFspsbJtjXt5ns8NS9imWZAjddtWed3wv", + "oNUX4+Bw0N94t0zlptxj01/NzRAe8B6WtdRC4D4mPUAmn/hlGZF1lbJlyqwUFrNNMQz5pLBWO555xYjZ", + "je14erJe8whIsjRtcNIxTV8EQ96jeYbuNhA4Radh+duVqbzyzkNCVzC/PVrZ6tgdO1rlsN82pa9nsoFT", + "W48+XWwgZk4e0kRekI2SrdZYcFYZDyrJyuROVe6xaEXVwo6kFRgq0RJnNDW5p9wzopOLdHOS4bxo5yaV", + "zPjgvOR4xNUTlEiD4HkiLBuE1KIYaqes7wQlWkDdMFm+pWANVM7v074hP8NF8SxmO16g9mEP/Mq2PELd", + "uzMuilcuEpDoWSFgRC0IQwvM0syE//309pe3X94i2MfZV1wUE5r+1SGq6u0eCsNtgNgWbSoKOJ6huch0", + "f018Rdrq73mS9sHgHHIvNkpIbgFmRWzAeld2Nr8HS+HdSrN7Rx7cqfhbFKdpWGzhMe0i4h3Q8LaCtDaF", + "mrcZCrXxoj0orLvK9JbdTi/iPix2PWADkbrHTdWP3Y2vKYXcTKzyCy69WlFTkgD//FoUadGLzCrv1c7W", + "BX/v2YwPUdiDvHArM1xRNKwFHpHh4QFtX5Pb7w9KGE/QhvTGmPrb1LoO8LDc90gI0Umz/8DrH4PlpOL1", + "Zzif0O3k1K2U+AIyVSB9xYjONjIoCmOI3c5VTWW/kGAI9+v8/UVjCScvL+wkSg0Pbl0wWKUM9JsMNuud", + "DYWrDzDwyUkFwXQR/OAPjmSN4gc9uNYqXNVf2+IEHpT71JwmYF7AvIB5Tcw7+wrY029mUTiBeOltvLNV", + "r/exvzRQ8igwcnNKgKvNSQXPPBO6wztNL6vGRaAUbpikQW25hTXgtfKiieL72OUDihwhimB1uihyWhb/", + "M0j32peOTnGB5wRq3VgkM5+hEkJDXPj9QN3sP8yUQUQMImIQERvGsxsoZ03TW6dydtGcJmBewLyAeU3M", + "21c528G7GyhnR2X3fsqS58VmMqGgnx1SP9vFlP30s4Alx4klQUW7N0blaucNyhm+/1PZZzd8EAuDWPhU", + "xcLJ9iPZYezz3WEdWy9mB/MPmvRGbWyh744zUMWqzgdwPLN7y/d63YYNUagm+D1EiwSjfYtQ6I22DHgT", + "8CaIiTXj2jYgHtB20c29tkyKAQsDFgaTxgDuFfAm4E3gXqMzqEIw8OXZ9m0zYLiWEDEc8uLeBZSWagFu", + "6kBSWhnDBVTDJVUtHP0JYcoehY8TlGrxwdDhu40L0kvyF9htkumqZxt1vhdqHI3KckjWQOhlSzT+PoCC", + "u2o/Rxm9C/A4HEA1dFnYTKraP2c0L7hQfhh9D+222FWmETxyfxAlq/JAElKbVGWDTKkDhsi1/nqMXrt6", + "LDGrss1O10gDjQkEKmUziZIgmVHSXfFZKLqD05SkJk8KIys7oIyZbjNlrlxt+GcSpWSGy0xZaQPLDdPB", + "RiUQJ4xFJqmz8YZwJbjMBqpKR+a0SLqVe+oNz4udzFORKSlly3E1n0DgbNZ13l17hlo4qk4QxjXT6Y1L", + "pPgYvY6ZOxqUZNycDMo4L8wpQj0jk/jQfapxi0jIps2hwv+Csrk5RI0FMYOaSopkmUSrBVZohaU5aTgl", + "+AlnguDULtifz6quKGWA5mAUqoY3IAFDKhi9c5+8hQt8r0jeUpl7VAPs4JFNxUU96K/u47aRxc3HvfCN", + "+nAJcqod7NDdISsMqVIbckGD9mZ83iPGQu2HulCbBddnCIq+aUJ8bXLisFT/jUTJKspV1X8xCVNRghmS", + "hJzbCmV1zV5qaaNcmEyrnFUFCC0tNSQxMvUmYgayiqm2ZetRGJKTc6m0qkeYsin9p2tHh00PWNP4vxnC", + "6N4dx/8N4rBNqcJq6TZVlimOofmE9OQIr6nOL/o4e94iL4gG3US5whptJ0ZlzeGqbF3P54RNakI0Nrqs", + "FtKh8HaVkA/qudePmdABZI7wevlkyx1vgOjQt8+7IY/HQPLOvmZ87jzm9i6fZWigRtwhBKGPHrxPHfaL", + "kqHneqWTjM/9KTbN0k82w8cRgeLRP+83wHZTTuzJdKQWpCHHa7hJNScEkTuFKuEW5KY8XUcIy5i51I6t", + "U559zXlq+EhHusf6Zn+tF3uXVbyraaxdFxAkJHF8OvnOKwm1ofbvI0k2kGTGRcxqcbKPsG9AeLDfPiFR", + "qrr5JyZG9eWT3GE4lmXof0RgWOaiZkMaG6NNXAWVrGSpTWy8a7Hy2tae6xZn/TI/raha8FLFjDNT/lDh", + "K8Iqcx9GP7z8cYgJzWiNid6jKdARM1PGo98EdQdMsHGkR5jo6kgw41HluGwXx4xN2Ku8GCNeJ2OscdD5", + "XFOB9CiEpZhZYzqYbjbM67X5wdT1LSXZg1WadY3uWLmo5rPTPf7Sen5AacjtQxKk1uBi4YJquMGCMFMt", + "L1nQLK3fRqIdO1nMTHBFrncb9b94yMhNadotA8kou5LjmPXT58aDTRu7qPbjinDY7PZ1Oaa91Jk+Xb5V", + "IWlV4qt7CaWXHlnppYYcNEgVGU4/Hxr6jsmKtLes8UisQpHXkQNE2w0KbnzeKJsDGbdlJPV//IJvzG5G", + "WZGtZtdJVj3i8VEQ1SCdB5/BO8XasgVpPxckoTizJSIl0lJSE7Euk4wzcokSXlAiEVUISxSP4vLly+8T", + "DWbwF5lAt3i0oWUbt4+GiK9pgB17y2cGpDpB2K4+jip1PGbD9fFBenUbfSgfNXkwt6z/IqzMAUT0vTW8", + "wHw+yObD4HgcHI97tbzhqbG/kCxDqwWBSmI+4bQ9R3aT+w+WXvdLl31amlSKVXsK7TtRpY4U8hLMUqhF", + "ORmQGrv2dvEqTA4YoTbzlFRpG5Di5/X3NZ9z/kXWsagJtorgXINyA8yrSZ9tOGY678sInC2rKdf7QPob", + "dxCDMnkfm9YWHqRO7EFKQ9njlOmPntANS29iivLaFCc3IXeRlvtBCHfuiFwYoV5meEl0q5buCUtwIcsM", + "K1IZZM83Z9+mlTGrvTAXeAiBdIIBzrk1LDSjeKOYHYBuDk3rcg+kc3PCf8Bbif7KuOa3HLj0uGHCTbU5", + "YTaEhUCpHzeltnAdiPU9EuthT6W9VLlhRGl5Ja3sKTG79Stp9Uh60vrR0T/SPgLQtj/3Cx/uibXhvewX", + "P563vVXVahEXuvfbJRHrKU/XL4YDtv0j6EOBy97P06D5I3Db+3T/2/T9y3k6MS53bFOneIVwq0feHbh8", + "NHz39n+bPBKadbg3iFLxGb1uSbaCrB4CFD4efYlH6AzFo3fxSKuXUnFB0jH6h7UXQ47OuQmzu7aXZQGA", + "MxMbiGaYZqUgYxvl2oSHY34efcxU4xG8b9if4bc93dqGvEv6iYsxNG+5PdzSn8z8cXRmDjPhkNmCA9uj", + "dWAbpC3sK/0/IVA/Sm+5/ZhbEHOrI/nNeM/Bs6OWWF3ZKCNPoVmG502EOS4Pu6fJZoK8HOTlIC83fwZH", + "v8nQkBCbMtTEfDQCZSHjbpM69UvVxizuJ3UmxGQ4nesRqI/DV37LTrJ1jH3Tbt1VkLIfWyrePju84pve", + "/Fg6ZKwxzuikN7GSOYx77SqW5oSpmO2mdAO73CuTSc8mi+NMjy5XREj9u4YPlBMpcRUu61D4BsGyAYOP", + "EoMD375nvn1gH0qNyRsOReC+0+FFOVyzD16O4VUveDk+Ou+C7apS3XSoxUNw0374ClJMs29sgh1NYiTi", + "LDPpQDgj1lcGCwJ5eEg+JQLx2XA6tFVaJ5CjQI7ujhzBJCF73QFpzMA6xhck50viL2K3ZTkd9uLny5F9", + "QzOs1zzRIFFHp96YOimPuxBssEfs5lDEVxqbbJL6FqzaRYPb2/u8UkGOXXleIxvUjohUOB/Ece19CP0Z", + "V2hKUI7TjaCvW7+aBGQNpodHI81vl9rrluZ38zTduzS/VWosSPNBmg/S/OnQmH2leU9lz6OW5o8onUGQ", + "5oM03yLN72LVk5XmA7IGaf7xSPPVj2IfVx7R+UTY7dgTs9sH4wxzDPDz2yN1DLgYOJ0IrjyPtKr2Ho48", + "5xBDvsSCYi0no39xExsXM3JNkhIMb4QtqeAsJ0y1ZeOwfx/Yx/h1w8On6RI0zNPnBgw5YHPA5qPlsHeS", + "2WfHCWcrqw9VkmQzxF22CcgZE3Wl92k68riF3MaXJ2TeCQa+kHknKCmHIKGlFhN6CyxCeedSDqGf59sV", + "TRY8s+nNY9Zwjx5M7X6DFT7KTKQ7mcnbikG3Vdizy6NMkTng8d5pzQdUZA4Syo3Qa3KTjD+3KI8Xs436", + "eHW1ZSe6oAWVigua4AwtJ1C6tDHVkpLVOcwh+AoVWi8xrbsZyYmqFJWmptO0X+r2jUStiuBcjtHrxhi2", + "6pcLrdNqCdSLN5nV9SpgYoz+JIJrfNaDkrxQ1VZNIeg9ahp5M4QEgeJJJBmSxxD/eEQkqopb6LVG7oQU", + "6k+BsrhatDDW2Vf9P5N41SNz3KgyrQtbOGjtj+FVavv4ajSy227nuc36AK5jKBDwpMMIwc5Y4dCnj5+/", + "HASDfEUtA/4E/HkigXmT7ViYXt7mcU7fCujdo+q6z1U+QlOuFjbrns2yN+Xpej9euBU6cxiUrt6rz3vf", + "u2ts3qvMexOJm8p3NXPA6CfIEXdxbzeUPmaGP94L3vk4aMC6gHWnb5Pa9izv90Jpd/W8BW/0OJ4ehjdu", + "OaIHLA1YesKeKju4dxveeAC88/HGgHUB606fNza9SPa3h9Y+HrVJ1I149lUuk8MbRRv+H0dr1zH+HP6M", + "jK/AT6QqVdnmKjI2v4JDTpKQQjdhiVYkyyD9ojnbfsuR7ReQOhhem8hq+OdBUNXHHwOiBkQNFt5bcmrR", + "cIrpqSHQKPJlBdupiXWmKboilT+1FnO92utu1MYQ5nzhFnkoTG9D8Yt2cTYgy9PI/V8H/t/ETahCDPAR", + "ipl1Eup1omlAdvCdeUK+M/ben5jLTG8BrU32Yv8F0lUE2LcuCCLX+tCpanjDoZJlREo0p0vCophtYK7u", + "VrLUZqBvjwGyKJ2SGS4zZc1CzyEwwYX7md+cdx1n5AWktmeNVcNg2KzeBBLJCDz8OCTAh9XFrKb3CAuC", + "SqiqkCLKpCI4bQjPfWyzP2q5PUBpu2Kn7kCZjJlejiDTkmaqXw4/OE9u3narLO06mDu/aT2C5khmiq8j", + "wspcw6oDrVFkNnGtSpw1JOZjKTxwFNRjP4Hg9CTigWVz/SLDVt1cCPlvq5wbs5sUy3X4V9XKvdNatRcP", + "W6n2aGBiYLC5rbkm3ItC5ettcs7DzZuiEoJk5vU7Ar81aLGKf8zqGFQZbbzp6167CaqiOqY2ahZghnww", + "ta0mo+xKHqIQnLh9GbiBEbAhIPWJ12NrDS/36WRDaedDQt0xlUbbU5x4JAm9BpQ5A4kdNQR2yAAoDpeK", + "S9yuutmxUM8g/gfx/0kYz6NRUbaQjM8FSSjOEE5AlLOhdg63L5OMM3KJEl5oGkKVBsd4FJcvX36faHCH", + "v8gEusWjhrSoocyZMxKq1hsCHsiPgoAwGNnYxBpsa9lTD1QJg4cyjgyqv9RKwMpHSr/M3TfJCdxnO/lo", + "vsvZD8O7XHiX69Q4z3A+oU1XU69l4gvJMrSyZTd9QrKWM5oqpHuCdmRroAz9On+/R1rB09HjXBKB3Twp", + "d6HIHSG0JZilVEvCkz3LcHVnAsvxGk1JMwfQeVcJLrRacLmZjFsRnGvgbQC2qKLlN6LjnVWEcVVPuB4O", + "22/cEQwq73VM2mJ4DwylvYIraj9pu1GKs30J3G6SMy4ayc26cpudb869TR1jZsgjLgq0wP0k0bF+kzBN", + "T9p0X49idmtKOTR52h0Ty5A4LdDmkDjtRMnzsHfXHjrcsKJsP7lSJRtPrkNJXPXOerIKzpG/8Z441Nbv", + "rWdfZwMeiW3ZDw2v1acb7wsRWi1osiBLIhBViMq2jGMLzNIM/Axv85y78xYRs5tUBbEA9M5t56iEgGpV", + "vdPNwiPyowpX+ZlCeZ1d2/gW8kmih6LNmuBNdwxpcmzqa9RYxiMkSJHhhFpRuhBkSXkJUvjxvA0GZAzI", + "eJwM86BmxcPX9r/Yo7J/MP0F9TKY/k6B6Bymor+44wqgF/tX8w8kKJCgUPvzKOjKAav4P6SroUe736Mk", + "+L2qFKHaZ6j22VG7Xxyu1qe480qfEWJc6AbjgLwtimgZJGa79oxbmgoCZgeHupNnxIcp8n9PAv4+Bf6D", + "gB8E/CDgHwVdOWBh/yMU8I/EnTcI+EHA36ecfxDwewX8gNlBwD99Rlz9BAFwEzHc16Z+RKz4bxVEp1GO", + "QZ6eQTXFow7y0cjx0ILY1azjmO2RnQf1JOfxMfNhEXafzJLFfWL9G5P/YuCUG5cdmPvjYu4OCGz12kHI", + "uOvXFrMufBwjk7YWavvXHkDcVhyPkFpB7louTEBszCx/hwReK7bhRgqxc7NSknRYii3wpxuAxe1sO+Bw", + "YONPOfD1DqJ0dvyFtiJ0DFFA3PmRQxxI1BWq0/Q5csu4udtRiKMJRsgQRxM0pduQzRJK+/topsuttVpg", + "pUmU3DfL1rmhmI1i55CQdUMKkWjBs9R4SEd+t+omOY6Z4kOp5G+ww0eXc2BA7h+z8ztTO04a7qscOf3y", + "QtV149nPIzM8b0OGOssAF7p3Zf57MRSI/7NabngBDMz3jnOGOWALTPh+Epo7AmMzmi+xgAR3riRc9dKw", + "WpCNXxrh/FqJsEnFd7KJo+5k4pvWk5jdNiywtnPEbM+3h6OgcgdL9qXvMcmwlC3Jl/Qx6SZ3gA4EIqRI", + "lrnwMis2oQVfabYhCIbAZLTEWUnGo2g3/6GDndbkiLoRPm1fEDRFCCPzhT5ZzNbo3z9//ODaTH5ELZVR", + "nNE/IVXikSQ6fNxE68SNM5UIdfZVA+HQ1Njus+PKQ+0g7ajMLm5RvbOZ8w+PI48t+XUlRPQrKfsqHU8G", + "0I8w3/a+bC3I18NzdO/DXga6A93S+eZpspYgbAdhOwjbd5Bd3AH6OUp4sdYwBi5OFFwaUqkmTkx4XqP2", + "i0FpgiKf15LkpUjIdqVDN/1GNkFDP01Ocr2uqMfIkBKpKIPZophB3iOUl1KB/+QCkiRuSEGwHJwbs8rQ", + "NOOBAh8wtzkv1qNopO+2JcN5NGpA4C5Av6+22nL/Dr58edI3xw5Z04N9osU+Uees9hsibA3zDZdQDO+T", + "4OfhihfDSGdf9f+2C5jfrpixyyxzGBS16+usnDK06nHUV4xlCzPd3AEZn44GZpwpNz0pG9hjKpjeGnfa", + "S44GzAmY8zTY2Ha6ol5u5skl0kgqOrgwvy+nSYSmXC3sg6Z9x5zydL0P79vKbHQYRK4ChM57A4xugNpb", + "mNv4PKpnDnj8BDngLs4BL9zAuAEVvQ+Bb+38MmBbwLYTd2udbOf16Nfr2oPub8QJPcH/h+CEWylAAm4G", + "3DxhXXAH527GCQ+Ab+2cMGBbwLZT54TNaLh9rZt1rFpt4HTjnX2Vy+SwJs5GFNthi0QfzB4T2cg0fzXp", + "VxDxVpXHbAt6G5tfIYolSUihm7BEK5JlUG/anGu/Ncj2C8j81M2oTTQ1/PIASNrOEQOKBhQN9tpD8eab", + "hp413MzksOjLCJElEeuYbbhjIJurqq1U1HKiVzyppllSsjpvUJ6MSiVj5tJdNCrNKxOcwiUshWiCVaV8", + "UE10k5EVzqfrmMHvkO0BnD8gAYaNpt8sUFlX4LHV2Tb0CMh61zSxKYJzOUavqzVUSXUwZTA+L1XtLUIl", + "7Iyktio/X8UMFoHRn0RwTYv0tCQv1Lr+SiOfHOpMKzuCW0JU3ROIqpPH4TR3bOFvXNiAtIb3VkOmGRhX", + "Em0EeaApoWxekZkmKZlYRbshTqArUvmY7WcpaKL0XQhGlmtTpsgc4LpfDNrwgw0eq8Fj9ejkIKmwKuWA", + "+C+NjxmWCiULklwhUZoEfNZR+xvGU/KNS8WjygISZjYx/pKmlzHbRu5dX/+31yQZGukaMz3tbYLIPpvt", + "H4pgtGlQ79NaXGToOUh05tTHNH1Re7JXdOWvoKncBEOPJQisUhd2sQXk8A6EceqwybgCAN7MRHVuJfq6", + "gjzdV/XQI2/qHb0Sc4UiQUx+QmLy9v0/MTG5lUuefTX/HxgxvTfHbMv9sA87RIfhhhdlbzGZXp7WEg1R", + "nV1II/k4GJ2Ldt4fzoexnKOCw2MKRj4u2nz0L7IplVdyUIYL3RM9n5bZlZaR8heGlj7TP09o+gxME1Rq", + "ySnFiot106PBhCSbguRGm1FYzImCQV/ZkKmaKIOBdoFZmplnDfO0GzOz2rOvds6Ot9ufYFuH0lzsfK1Y", + "foVoSpiiM0rEbuTt1nOLGyi8t5y+FpNaENsh1Q72gkpwJypBJeHvrUTcJdvRlz6M1RyzVRtoPGXwf6AY", + "bcblO6CtOMt4ov+lOQtWxuDzP35osf9E9gMh8NoT5AQd9GqEPgTh75OSZdcQYB3wN3d9mpElydrN4tDu", + "NWxDq8BdY0v6J9nnqGwOvX5fALerrSO+D14VeNAAKa2We4bLa+An58XmWlbq0yV2BZ0W5aEGoPtTYUMi", + "rptJL4QpQYm05k5ZkITOaAKg4pNpHgxGQjLfwwtPxyELHb16bH15BhFc09evk76zY93le5qZAwmScJEi", + "mkIab7MwlOEpyXpV1KCdPjleMKsAc4fu1zAbtNnTJcjmFk9TPa3oKpgbLSlLyYwyCuZCSKs1Jahk9I+S", + "+ByiDk17Z5MZJVkLAX7DszIHG/9sosD1UtXLhhmIRIq35eibTXjRNmBeYEElZ8hsi2vJyuWt+rdRNPrl", + "/f96O4pGcfny5fek+uPf3F9J9Yf+6f2H1vxWdrEt7lT77sHjlvWf+mekOEpgP2bIxBxW21BbXMmtL6pO", + "3p5XPeXvD+y9tQ+SHQe7OnJHLMuWzr6aPwYrvg5QrfO1KcST68Vq+Ku8s2WnmNan7FhBq1Z30PM5YRM7", + "+ti4bs4mIHN53tqqbYUM148tw7UFwcZZe2WrWwPaQaErqNqPV7I7zYq6PKWzBkrVkp8RCAWRZaYomzdl", + "QgqpkKmpHQOFZ2KWaHGScnaOrhhfMWSEM80knFgVIXJNJYxlBJMIMW6r09jZV1QtjPs+ZGttLubSEvtL", + "Pbs+rlJPXhXmbnTtFFGPm+8cWHRuER+NkaKl4rlmQyRFNtTph5cvX1nfminJeo+8S9y+Q1G6SzwexHGD", + "9PokQg4aMulwAVcS1WtrNFLuXZsbJVGtFkf9u00AHWyOQUxuszm2qWG12dG0BsvjE/KjqW7+tK2VHuLc", + "MEUekjTPmnGWm+v60MhKX1NlxRHIwwSodVuz8RpplZv0ZBLAc2e2fywIiMubw1EJoZhYNWPjn3/RU797", + "0TBmfhlFo3etMtVA3uOycET1DhBmtVhfzd7KkY5A/hoM90EEuzMRzNkbbeD2fhJZq9VR/ybIjAjCEiL7", + "JLZhGqBJO9OqBBJV6YGOLnRqgg9eJzwYIe/QCAml9QbYIU8E8oKB8hQNlHvwtdO3UfZg3IYMeDLE/uBi", + "ao9c2ScTtjGHIJ+dVjZQr8x1Rq4LLpQ36dhbaN5AOMoQNglejF+88TNQkHKrytFFc/jORJaJTl5opngK", + "stggqLfHcTx6eDf8NNw2u9NQJAuapQ6MTGRuU0n0w4fXMS6ITEFkOhDSPZrH3UHIevZ11q9v2+yy9jnW", + "ZoH2Y+yWar3PE+uD4+zh332Dlv8IEy1bVIA8y35E2FA6Aho8lOdDxudbXgevP/w0ivR/0YePWtf5eAH/", + "gX+1exdwzbXaYkvvQiUKT6ZHyCmtn0C3ZFv33UwgbjMO2og/ku4n77a+yAaRN4i8wUq4LwqffQXlc6jM", + "yzbRuLZ83EwIHmB7/IQFYappYzkeOeBNU28/xNLcXQQB+ZEIyG9rbNkyFO4vKgdkORSyBDE61D45Je8P", + "U/K9W9o2CYlzrJIFZfPBFmRX9T0I0yGd8cNK3xoSH73g3Swz6Mdl12t/dG4UHgsYHTD6YTHaAuOjR+pS", + "4jnxYrRzhVstiNhSAiQqJUnR81qn3vAPllFVviyymZvVQhC54FkqX3TSgd9gScFvoHEajwoEJ4NSQnW/", + "Uw6J2zp8xpID5Yuynlp3GA42q6B5FpIlh2fNfUJqjhlrGmaLLcmTz6GipQtER//ilGl+pBZUNk5CLQgq", + "BFlSXkrEGWmEztzC/rFlx+LSxNBvBAW5XO4tATSNdLOBLgS6cCe8ticw+oLkfLkp4DXkuvaMCx52e8io", + "PGMl9SLFtlV2EzXaEQLESsKUf9QdO/SQYbfwbGuOaGsnAe/CK4p5RWHN5Cj78OejR7PbMWsbQ7vBrwlT", + "Yn0fHDvZfu0xrLvYIgytHDxQl/AccwzPMVzkE16qolQTk+BJnn21fzh/iVaLz+cFX7kScLozkkqUiSoF", + "sb79XORIltOcSukRDH4m6h0X+UeY/cIM02fOsd0QgHOLjaZe+hALTf0S+fupl1U4bo5XtimgaYqwBR9N", + "0jI+RxllkPAUYYYMVLZCkwO6Vi5YHhlUHYLzZnzeXn9789CKgjBTgNVgNE11Bxmhf/4zW2YRmuUqQilW", + "+PcIjcfj3yOULTP0EkoTaNocoW/hbyIEBy5VjdM+O63q3sEF2RvTI6wWNFnolUD17wahaBMBbEvrFBY+", + "9O7SFIau1hS5OLSUJ2WuuaXehiFFYGPmIr+fdBNBNj4sRxqSnAv6nRtvPSXWdejhM1siD+QkjDIqlYXS", + "fIw+45zEzN6+zRnhqt4hM/fZV2CKnUXv3sEib47dnJGPMzgpnKYgU+LsUwPjDWXZAqvo64gqYg5nn8/c", + "D1BmaPTX7wEBTjKPlyOzcoxeu6rZSBIiTVFtaItMEk1Zd94ozB2zujI3FbYo9xg6TjaTesJPa5xnWpuR", + "7WV7rfwWEoc9tcRhXORPrA53Ty4ywLRIcxKNdwuqhR4wXVRjPJPo08fPXyyLOYcK+YZvVUxqHDPAOi1z", + "bpR3jWBUYwC6ImuJsHDIbbLnSvS8wtfIjqIpcmTQeMazlIjxeGwLyeJSLbioani7dL3IJPESBEmiIt1s", + "8u+CaLdd4V9/nOOUdFQBh3H1zmOWkhnWUhwQnM3y4ghIyK+WnFUVxr32rcB4T5fxnoAtpCH9DUtHBkwX", + "ZE+teQCOmMtyycgsamREbtfVb4f8zc8MRmm1x6Fit1Da6w4DyOxRc+3On5jl5HGLjmCnc3CKJfr5rWNC", + "GsiUoJDrW3HgSDQ9RyQvFDhysVqxTzmRMWNcmQSPoGdLpP+9wRSA6uMsay/NZsXF+4fQ4IMZBNKnIpDW", + "CdI0qwBxr11kfLWt9e1Y02K2a06LNN6DSQ+qPVRSp1ZJGVk11EYq7YsVSRFltST5TP++pGDFNYLy+tYC", + "4QMxvZtJoHsIkPecF/fBsehJvsJ5Xkc+l9OcKovI51WRFVNuAyuM8BxT1jALIcqK0qXALZnG3JgZW7lE", + "z9NpBPw+QmaSCOWYZhFacXE1y/jKqoZTnq5RjtcIZ5KjKTHK5DeEJTwlqXk7QHO6JEyjvyYOQDIMhQD5", + "wr6BN3Rgco3zAsRfUD6ZXBEQHxqPhzGrXg8jM7WjMSAL4xRXyeUq+WXn1ZKmf43R65gxMseKLuF1IiWS", + "zhlWRJ8L0vgrGM4axBFOzhU23BZmYmakmQiVLCNSIuzsbh0PTydFjDZfmfTteh56mMn1p6l2BXDkuiCJ", + "MnYPzJChWlHD5G5+kchoL1Q0gcXcAXhCCLKcrGa+N6bKrUMqUug7pWwj07iD4HF46jnJp55a4T7D+YRO", + "Ghqz1/ngC8kyraJUGfANnhqho/p8Q20GKP0aA4zHo3MEsIC4iFnjxxnOJPmrQ3l5nb+/aKwvKNtHLia3", + "QVlKZ7Ozr8kg55ZkgdmcGEvndA3uCkZ2jSxRQ3o0m24eTYlaEcJQQlNjPjU2W9CljU1VojlVWqiFEpkL", + "knfA2k90NnsQZXlzip8pZHjVwoh57rfeGO4kPHkLbptJ4bU9vEpZaBS01eerhQE39R9a0aznhg9HdxmQ", + "FdDor7OmqbM/R5Z5akS+94QtFRC6KCOAeixMw2Qyi0qfmmsN9qdgfzqs5vzQWvOJiXlNynH2FShD33vL", + "b44M1OTBRnoOf1KMWd/LCnqNwMGQgU/dldVVpa2EyUALQjmRErfbo+pnmAbBOQYWrs/IFm0SHOTWlrnc", + "RdxraHNQp+7WHvxpG20gzHM40hg5thtpGsr4jdDGmXED0gSkeXDm1Hywv5FY2+oQc8fy7UVz0UG+DfJt", + "kG+PhIQMlG+ruOqm+RK+rIusG257ZILug1pDA88Ogm7l+ICviJNsvY8ARyfyBvQJ6HME/MqY2AfIu1XX", + "jbi/phMRsCuqzEOHdfAxUVp5odYxg7fhTe/CG7sSXlQLDw9xJ/iCUAHT0Ne4LWBDWG28yG0+8H6NR5ym", + "8ShCsbuWePTXXwPA6ck8ugUgPgAQ8yyb4uSqhuF2+eSC1JHQ23AM91vDceU3ibX2z8iqahvHbKAAs28E", + "QSWQ2O0EHAiCycPg1mT7YdmnM3/GOekI3vY9M0UVHkycm4ZrM67Sxr3R+jFOebr2Ret1xYZvvTiHcLWA", + "LfehBTucaMSaPihGVCGbAR8CPtwL99h+v7kp9/AYce+He2y95wRsCdjy8Nzj/jGi4h4BHwI+3BP3GGwK", + "3dBFq6BIyH1mI1JkV9KcDttleEwPj+mPz2Y2aZh73Z/9GUa3bD4Rmq7tA9V0jfL0b0NQrD/7ow0xMAPn", + "6d98WSCrVYcaUAGlA0pPgOkNY5UVh5yuawYZ1Vkb6zifBVmjFRHE5HtViqQx0926UP0zLCRw0oB2Twbt", + "zr7C/waz0Br9cB0z7UcpD0ZtjV8Jvf7HILfK4FMakDcg7y7ynqVlXtwYgxu55+qfND91/0ILgq1ZRmGa", + "NfTUXPah/096ZQ9GAkJK/jsGRwEnmZ4taJoSNskJKyeEKUGHRD7o3sj2RmaE2lUZGiGRPGQmtuFG1lFB", + "xkwSgnCW2fCJVza3aSmJkIizbI10h834ijWakoyzOVLcB7Z2P3+HxfxKWPnWbibIhXfNWk6LUzwIuhlQ", + "HpRU1OCL94noZzPSobL+tCXe+dm6UduSQ61FG3hGvB/yjJx5SxQ9aJaz92zGTyPD2VEln6/c3V3OeEfM", + "UYIZGkLPTQrAfQh6BeeBej8hxQBWNYzmH1saeC5QWZgs6n4a/olLdWAKvrGYr7ukuo3Cv91AaERT9FyS", + "DNK12T1QJpXWHfjMpHKHsui7VTKd1+nuFM++PAMhEDdcU2G2CD1798wQiRWV5BFxlz2A90mymFoQGhgY", + "uSkTgWdzgmWCU4LMJ6D65iSfEiEXtIgQLgppfRdEmRFJlDzLeWr/3ArsosQkzGx6xm0FicGV7qajbWgz", + "mgPaxWBmtZ0WHqgHY5x9s4UMLcwQMi7meakg7eWzt1qJmvJ0/cyeQoIhF/fUnUHaIyv26fAu7oswRWeU", + "CPQcl2oxMSSsDgd7cUTxYEHEO6SI9xOVRYYt6KKauewp5hnF/kZi3hGCaDBBn5adYC/ee4oRzi61O0Dz", + "M9nA0y4x81iJ/30IvncsnAbh8/SFzzMtL/abu3WvmrO1JBruZpUuFewtTdxww6+LQgZ2GdjlvZjVjwRJ", + "PU9U/nSRC5pqrbF6paojYO1jlNaxNDaa5P8LnqU72l7MGuoe1C5IXHnMjM/ntjwBdkmiGde4Zu5C9yHG", + "ealHNxvwWvV4+HV1f+sW8aa+qiuyRoqjEm6x1chTr/2fzUF/vwcOvPV4wmZ8sCgQOPHAMrfDHpcb2Nzk", + "vXf0vHwy2BoYcXjfPhKV9e9HzYUrFTnwYC8PDhz4KenC9TvJAAewqu9u5q4qv3SzwOgmw40Z4L3hurKH", + "7f5aryvw28Bvn5Diy3g6xBsTuh2JfeoDLDngacDTJ4SnYjDfFPfGNS8Czwy4+ARxURKxpMkQtul63oBz", + "2iwnB7UufXYLDwgbEPYJISzgTj+2GhQzvn4u/3SL/bfdTclwzkEYClamAku54iJ12eDnVCqDspMrsnZV", + "9KGuPiNLIhC5LrhsNzQ5/P4N9hmQOyD3o0VuOjDESSusiBbo+bTMriB61Fagf0bTZ2B8pBLlmKVYcbFu", + "Zg8zCOl81fWvCos5UYgWr0xFXj2Htf6qBWFogVmamXTKLtsfLWzBeO/j7Ps7jrB6v4nj+jwmVCP4i15z", + "K02DmfVRZuXzsz9aSJQSRUAr5MzYexpsz7E86o++0kPwmbUUrRZcglOT4X2ai21Lve187H0IyLo75uHC", + "q46L27wvjpvfACHfh+l4nx0/8JS0Z9OfkkbgSKOoEIyo/6BF0yjT8U4Zs5u6C73vdeXt5CktwuI9x2wc", + "nKEEJrEdwFELVs0gDognqgFD60hTgggFPgFgXOZE0EQzCZsEz8I0TlNBpPQygz0hcjnRy2NErbi4khow", + "9Vz1PAcB06DNnJY28/4xBG1oXpTxeY8Vgyz1Epw2U32vGUQbfv2iB+xNXmleC5Diehg3RY5VsqBsjtSC", + "SjQDwUIShZ7PCZtU/5TWoKDhdKKxrWIUf+jrb1R00R0ADwPePRorAp+fZpg9rgHd8DbjsaThUQtSMy4S", + "83b2zFZgfBZZw8AMl5mKWUaWJNNdn2kh5FkEkhnUp2uikFaKUioTLFK//5hF0cPYCTI+n6Q0US3ZqyJo", + "nOWqNc5Jt8GmWluNHJi2tsll0t60ZXNws//+wDFOIbyplwWdfdWX1ZUWspYWN1iQAfyG5OjhSX0s6Zdq", + "qKbsl/G5XxMxKw5iXmA3JyDnOf2l/8UqJUmGBUmR+wTyl2uYN5Zpp14hSPGAcKl/Vfp8SQoGipjleI0E", + "wWCgyMfockrmlF1G6JKw9BIY1+VUcJwmWKpL4Fn6DEo9AERMXNqpL43dXP8zx/Lq0qPSfXB7C0a+J2Xk", + "s/f+xLKy+gTNnwzeQvVNOJetnDD2tFqywtToBqbFqU179v7T8gc3lsN6MCJW+PhqAGrHrMLtqcknk2KF", + "p1jqiRXBebP61aWTd+VmPWVIHEBzLNbWhWWMXhuSxAXCFU1CONNkZ13TMPCMmZWSpLbMOfrh5Y8+ubhB", + "Rw4jGyc8z+1nO0LsHCuywi3xDHDsbkOUSWqttfYm2mL7jUDSJkWbi9qd5JMgM3qNMsLmINLk+JrmZT46", + "//67aJRTZv7xMtrJcAtjwjraF74FL5HJqHqN8yIj6Nsfvxt/+z/+r/G3L8cvPXm5eNtaKddIg3DO2Rzx", + "JREZLgrK5hWLau7gxx/7dlAs2x43//OX1x820kY2vtiG092vP4o5ZlRiU2mpo6S/9xq3lJe6n7vEh1Zj", + "joLc7mcU/3FI3x8fXCg7+8rAVPXXmSRzTTGkvyZzTeZtX1Nl2A513qSGAt5szLNpExSNB5ER03CW8QTb", + "lGT2QyIHsg5N7yNUsoxIaXiGIdea7GKUm+5RI9OZ84Cyq3226beosQyMIzEzSwd2lFHSQgaB1UA748rR", + "BIRtSEDjaKiK2fMfXv5oXTW2+YnF1ClJeE5kK8bawXq4xmd3c722T5ufduss2nVM5kyYDxB0J8l8Aux9", + "FwjfUSEV2uBUdjf2sNqoux6PsBbK+wu+2WDmRz0ayAzQjhVNRtsk6e+2Fn8F31sTgAriMEGfNmGaefyz", + "Md6a4ZwmDRrsIdv1odUbPhLCbSH0lOj3cKX6+Gm9C4oa9uK/62NmLaLdjmYx03SxxdFMfz3U1SxmZrVn", + "X+2cf6HnWwks/zvCZUoVWOD+e1sY8wu/T4CLtToMlWoYijfP8wM8Ku+4FsDbEbzo2qejHjHMDh+c156W", + "8xqzQLprbGqPFAyWpkdtaeIpOf303paxrCvy50jhxLxxtMi2ByXVxrmsEtuckFWUUku8RZllLfJVpKdo", + "NW5gKYmaELb0t3oNI1PK5WRJhPRlYUyyUioifE+Q9Q20tzJGEjVRvL25KCcJF+ZQdo0NujmlXa0zQf7w", + "jpzz1POmqlvVQhCcdoy9JCz1bIuwJOOyFKS7VWa83eQ1+yNtP+zF0vNzwXnmaVqmSXvLasKncoIzItRE", + "A35XrxUWzN8pw1JNptyzG2hNeJ63t1KpCCNiUnCh2k8748lEaySe1/FkMi1plup/+zokQDt8jbx0CVNa", + "22cZ5/65BU6u/I2c597GP2k7uuZY751hlhCnBrb0YeUMJ6oUpH1pOcknU8yuPAAMzWtFOpo1dPqavZgD", + "RNJHaaBxJvifpAndU84zgtlWhwlWe7s7OGrtaaxlbtk+PZcTLJJF6+dcThLOEs+quJxcEcE8h8LlxLss", + "Lodgoe3VjYVcTgTJCJbe5g6SVfAVEZOpIPiKiG/7u3zX0SXBU8qI+ra/S9coheCKJKq/h1tSR09ZFkW2", + "nrBpOzx7Uv6C3DH5kzNfo6C4/cYl4/xPMlE087QXnTxVKqxK2doEBnZYur95y/7e3kkfySbFbXSwgsdu", + "w5+tPxvBqR0pu/a5wkJgptYeMvfQKZe1UHfBV8ETqd1Gc7bAIl3hITWiP715b+zQJOdijdyHlWW3SnAD", + "cRs2zDdCGH6kImZ4Dl57gmiYRdS6Bl6aSKnLhlcTSnhO6nSS/+KUkdRNgKcZ8blG6B5/dxsKWuuT01rd", + "3Q+1+h55OVqLoVPc48iEs8xix7s3gKL085vP79GCS4WmpUQ4xYUyge0enNFTBHwJEed3CMaVeX3IswBD", + "HwvCPv/nG2PG8RSVEiQDPzybh3jcYYLve6j02s9/++39T9tG9LanS6vSnFqFpWAI3wz/sRmtTd0RWZBE", + "65tw+T7ieYyQFTyvT4t4D7e4n2RdpN82bPId0QvOCn+01Do8DISHgfAwEB4GwsPAnT0MBON/MP4H438w", + "/j8Z4//xR1Nu2m/OgNT1mSSt4cZ09ajOr11rUKCDAn0rRAdIeizBy9volk/oNkdoRbwLokrBkIZtRM2j", + "nNVYTZDKbrgHlYA8Yy+C5u8vGhM/QhtqyGS2HzAmmKVUywoT80XnozGeS4SVwskCQ8QTr9wyGVdoTZRt", + "tZn39I/kOsnKlLR4aFqQfOMW8AXPA+sIrOPe8tWcGqIuSHI1TEizXX0I51oDpgVMC5jWgmk8LzKKWUIa", + "3HFAnb6fiULVB81ifebxUY/vd3N6U01aMcSuEny9UPAJq4Ue9306Cnj1yPAKaD2ftQJbA+NaCLqWyGa8", + "ZGkD2bbSYDBFBMMZFOohAhEhuLh/dBP7IZu4JapdBEQLiDYE0cRjQLPOrLmAWFVfpPvuiVXtOXQDIj1h", + "RHrTAlDOx/zUZcSBkmFDHqyMJJUBZQhaBXHwiSJXdfFD2VUFX49ELKy3cfY1N2nRe5yO9f4RrvdvYk+8", + "uFa7Fbeg2z1gm+7/qyRK99+FpJZbqxaHZJkkRMpZmWVrlBJz8d23zUXjYB766n0uhq/Vzh12UUvnaHgk", + "93czt8IbPK1/1wUbjg6EqLh2ujJIyRS349pBs3ySPPvihhz7UeiXouLWYh9uLW7Mqy/uldJf7MOpL27F", + "p8WpcGlxIx79gPf2kBz6IvDnQXSkdrr0P3k2TFVWUkQZ1r8vSHKFRMmQGWVPG9ZnM3Vg2k+JaW9f/x5W", + "LQtkzXDDFvvWibDylMo+TwPoYnI3Dwqq/AmGDD4HAUdviaMakB6p38GwzC3Wx8eTvMWHf/4kKgEFAwre", + "fWKWU0PF/hQtBg2l4gLPyfDULO2ZWQISBiTcDwn/PsWPFPeolndnOCHDMNBV1Gh85kG9980eAQEDAgbn", + "1xbsK4ah3ftPdT0SL8IVAdMCpoVq9T5ck0QsaS+fc4nTbG9EmVSYJUQibiqnWAOMzajpQ8bPbrKAkQEj", + "A+/rwsezr6ZGe385722cdHbgm2DmkSLm5iI+uw031mEOq1qGXCYdq7DV7wN1CNTh1KgDZJDxl7b8DO1Q", + "soaZvhslxYAoGOF5HLP3M5SWhhQgKlEh+JKmJI2Q/bJkimaI8RX673XH52Q8H6N49O0iHkUoHn2XxqMX", + "u4PxnCpFoLSlHc09RY1j9sX+afJ5m2aqJMlmY/SbJEK6KspI0xtXMxOztL0crBnU+9RvzuSWz6gHS9Tn", + "DqmFnrvjM0Rn56S/f5k3jxx9zCn4OrgTHrdWYtvxFggl1k4/YcJeaRKa3oI+9h/yHgS2G9iuF9/K0uQq", + "7ZTDgaPpnmP0kWX23w2GJc1bqeFmsiqYuyKpN1WOxqyQIOfp0Xs+lTwjMiHgyUpmgkjIP1mUrRmaoB1k", + "oap+CuTbNBDHJZqVWYb0fUuUae5gy902p0GSKEXZXI5jtlG5/ONU7lQtbxW3SvWxMZ5d1ejYpI1H5LW4", + "ASXu+oYVQmi7+a2K9UPv3QzavPrPbimHkpnbahN/bNkBEq4yfG9R4lCP+MmVYWildm2c1wPLoZDN6cql", + "LVd6YsWIf+Upna0PTLs/camOnnJHo91U2Ft8DStb2W21oMnClq3KsUoWemxISekm0sLRLMPzuSnXbw5T", + "kTGKR//1X//1X9/8+us3P/0Uj7Tg3PwFLRbneX4uZTx6pS+B5IVaO0tNkhEszMnrBY59e9hI1H2wLWCk", + "xwUguNM9PAwHvROsDnz0puLl2dfBxbbuQ8bsU457aU2LQnzPuvCJaDinKPY5y4wHGAfKfkcAY8EM+kTE", + "zZOsxHWfoumxEPxDCMdBrD0SsTYIsY9XiC0IwwUduzuxcsIO3/+80oAnRkfwNnYEFmp3mkU5zWhij7LA", + "yRWe93mKakxzPY1LWpaR1Dmj+eq5r6iCB4yYWS8UYSvAU4EknWsygK7IeoyA4ZMUTe37mibhkZsQ/oUw", + "S2OGRbKgikC5M905JTNcZntWh49Zf3n4T+5UgoHwSVWGt/f+SIrCO4w9S+ls1o/guhcRBBzAKWugeYX5", + "U6JWhDCD8OdNqhAzW/trizxIjYAG6SGhBhbWZVWiaWmyz3AGVelNpzyKGWcECb5CBTHP3GiBl5pUUIvo", + "5vNqNC1h6OHndOmWFqEiK2XMauIkSsaMbOI6OpfcSEseQKkuCUtwcQl94E9ZQtFwRzBghVyS6lP0vJ5A", + "E6kU4ZkiwlK4ypv+Wcwuc84my1x3unxhPQnqbzFL6zHtYeGiqEnqM4nmGvylJoFkx19O/+aOI0Ily4hs", + "kGOqpS7roDCO2TuygiVihtSK2xVAnx9evowQuU5IoTYOJLJinloQhgRUDtJrjpmRyTIqVQ8Z/UnDX4+M", + "/1pvIcffSKK7KZKaR20+MzBAU4kUd9t0Iv8fmjLseD1osr2H57F/5soJO5VoBVdvWUffQowv8p7r+Ic+", + "c/tl5CYw3t4WOJ5twKW7OyYVwWnNWhdcQla4toXB923Lqkpj3gd9BYB4OFn4QYixJK7eaCsV/gzNcNs5", + "pgxdUZYCMTD6S534RZFrFWlVCjxDqFRc0ARnqJrvmYyZmezcUcOa1lVEKUKNW5SRrcHn4u4ik4YlAo/D", + "KGaakOh/EZzLyJUKk1EjDWxUJZiL0Ax4u0ltyFK98lyO0TsuEMHJImZ6b5H1VTGbs8ilBT1NzxhXC025", + "jP/TWhNuLdQhDYOYMlkfRMwSLMk3lEnCJFV0SbJ1hAyRxClSC8HLuTlWPeszifiKGfzWS6N6iZA+LWZ6", + "cMGzMXrtNohwJrnRazW/WkN3VuZTIsYI5BErYYLnDVaIazEoQpxpkZcIZDZqaGnOBbnUajFaaTpqduj2", + "D3OgKVlzlqLLTEuDl3ohegAYWu+TaW451dRAXy5JkSAFF0oiCr4/enGXkMLnEqbkpUIzTDPH9mBGOUav", + "Y6aPDskFF8qxgu9QssACJ/reKhrPuGE7HupuQLaPrn+xV6WJplm5Boixhz79cbsgkjdbhNxgUTVzBJJG", + "rTgYBKnwo0aPKGa4KCIXAm7QAbAhAqYamYOpUKGBCRUiRDGrECECJDDn2LZtWOd+3OLv+r7NTWkRrYK2", + "vzX2F6HvXiKsUM6l8p04ANvG1DllNC/z0fm30U793DvlDgagnhxfqEM1+57fHKD6X9MasZiHMWfaqKpz", + "f7gWeKNqWOp7W7ZDBQ+tp+WhJWuQbGEhvtDhYGd5zHYWe+8n5q31RhCsTBweFEGvCTJ6Pl278FQbqTqh", + "LZVJP3GpDk6ik6yUighLpncLzC+TCS4Kf1upuFTYUx5e99DqsV1Xa3sqGMeJ8la4hy4FRCr1tMuuDt5K", + "9bqdsKW3bZaR60lSlJMFnS8maiGIXPCseVqVfLP1QcZXg/vn+HqyvYfWfpT19hP8T+I/zAX2NnXAQE6U", + "4BZWvJ26L2Ej6rTNeGC6FRlOSCfEwHuApJwR/3pN/ONE0Szz9lG84Bmfr70dVnhJvOdsJOCvD/F22Ct4", + "OPkqAZqT1kTnaed0bk2k0O+1tp3pROv+CZYJTgkyXyOjThnDmk22O+4Wsvs034fIaBBiuB5GyG2mZ24k", + "LpYVpPhE32MEouCYdlqOaXtJ0yfpjPbbtrzdkIA7ZOyjpdCHsswEuf6JyPVBeD9F4f3IJPaj9+vbke7P", + "wJO2N29oJdab3n5p67XrEGSuIHOFnCitGJdP6KThYeTFvQt4e0QasBE1TktWsDFOR7tZvcAt3DxgdeFo", + "/v6iMX1QsgMbOKvK5E/2SpKFNexBmqzKTs+4QutGhTQwBekfyXWSlSlpMdrXoPnGLWNIZq3ARQIXebJc", + "BIrkDZbbbO8OxHMdAsYFjAsY14pxdXXLmls2yvTvWeuyrkvtmOhm2ul+y3Zdw7Bim7/WywmoHFA5oPIe", + "qCz2RWRxZ2h8cdxIvFXkdAYqamScvjsOZSO0oj6X1vCODC/Jhs+sdbgdnc9wJkm0G1URiEsgLsdGXDLe", + "oUv/TDaoie7rXrfNmL6ggC2q8QsPqnJAyLtHyDctsNqInTt9bD2ELG+yxt9cBDh6Ab6L93ecRuD9gdQ8", + "Ld5fI8PZ11wS1e9LqTEG4RqLTF6NLnFgw1uyhYicqljwCavFr5Ko9+mog+ak5sSq7CN3S2N28eG71pxe", + "9u7M4k7TNeGHlz8O6fvjUXmwvVY7+NN8mPLkSnuquGP48/1w5z0xx4kOAXPum2Xd1gJ2W+H38Zi9guAb", + "BN+nKviKSuwV+4i94pZC78Xps+2LUxR5L4LA+8ACr7iFuPsksObohN2LIOo+MJMyxb73tfOiDOvfFyS5", + "QqJku7XC95F2P5slhJebIFUGqbIdYSFH3lAfR9PZj3k/2faAbgHdboVuGpAeLcpV+SvrOr77JE6rEvxt", + "ZIBQHKVYLqYcizRCgsicM/g/ZTNueoL/8SSjS9Kt8L2345+EjSgUGX5SBZN2cEDrxDSTu3Kir6h8APLA", + "Mh8jy3QA/WjZZpUZYIikWtEHo4Vq8kBwskB8ZhIgw1h+6vDBtgdBNmBl0Bu92LgpwO7HuGvE3ItvfzDN", + "gWcH6hCow6lQBz33/8/e9TW5bRvxr7Kjl9hTWf4TZ8Y5v9TTNhm3ae2x4+ah9NxB4orEmAQUAJSs8fi7", + "d7AASJ5E6o9PutNZeEl8EgWC4O5vf7tY7MpKTTbY716cqH/6TVDxrr5xxIyIGREz7iNmbD7jU7dS3gQd", + "lmwgTHImshsCyQkfBYpYErEkYknAjtAwY5doQQMUFC3/hMvHc1ZUCDPG1aY4wTt/nxgpiLoYdbFXF7dw", + "/15t9G01t0XrTp3kRz2MenhCeriZT/cq4xqH3kc14wn6qJ1ROzdo5141Id3ZF7ZDLmQs8hj1Lurdmt5d", + "1jlY35R5tb135et6/EO1StjYwLKJeE2kSoGn1F2ZWRttUAlm+JxSxLxa/wWa6M56Yfrw3UVPSCk0yxza", + "EcfUoT0FVkiRuTbBNRxs6O61rRFn39hr877NmvmxI+fpdeRsuoFv6s3ZVsfYpPOMmnTulxV1IjbpWmO4", + "fhWor+/p2AUPag/t4S7KEXli5IkxC3GLbl66vKXLQmabtXPdQIWUp0JmI/gHm+TUcW8JXAMDw0sExUSG", + "sMhR4YZcxgWjocbFxhYUjc1zp+B+k1k0fmfgg92tnuytHd+oE/upQtSAqAFH1oAQv9saSzAsgwfjqvhk", + "WVv5sD+U4EN3h4keGJZ1et6/swzcd0PL3+zk6hhCp5PdULf/hUE/Rtf7vPoEf+bacEGC0+l1dwedI9JG", + "pD1WoZa/UYd5h66jnsIsB8fTlBm2PpVfFFKvuBL++f7Nf8BetFaxzLCsKzxqB/UtvLpa1WVVwRTg55lC", + "rbkUIKcE2Na71mByZmDCBDUCG2OrOVgTPaX2dRtu3t+PdBX26crbAP5DbEqcAtafeCUX+3lzwm5rJTEr", + "dr6KmP3RZhITDtMdRvO27U70yfax2E+zXxJ50HnxIFYUVmQe2ffv4ba0U+mjRD2HSiMvirzo6AXsLLRR", + "ykgfXAeGdBpg7bTpBgyrUcdoD75je3A/eFUIdu5LrUKj6Y3sKsQ4D6azuydp3L5q+blFzTpPphWi/zuQ", + "rZZaRL4V+dad8a0NGB4o1wki+L3mX9FIRPrVpl9fnGTsUmTRB2epXiKvW02QobGSTQEy+lI3OttDzLZl", + "U73+O8Vv62hwR75ULdFb86Xq7N1Ym/DuahNawfGAsOyhJXckFPtm0d2aEJ30y+428R9mab3VBC3877Hu", + "dwkDh97o2rZhteee0tGtc3TNjmRJt9Ri/BWNN5UubStYVd6cX+vBx53qLp4ISB7dNbwpCnODpe7Qg1rz", + "mFJs2aUX5HTLaXiJ17aOG2Fd5+5CGpjKSqSnJKa7Vtnu3trsJ3i7VCI8nqj23cfP+UQqXR/cPzpL1rnP", + "3k4fDzkbaT0U6VkJgewgszGYcEbBhGubOjvkue/LhPrj1+dJhmKc/BzO53er2LXzkN+wgdrP4d7XF5yM", + "YXSB+XC/leZ5Nz5PGQndfSJ0ffLrOd15Sm8keJHgHcf6VJoU6MsuZ1/o2hH8mwmWoXKbQh80Kv8BZeJr", + "REpdoGtfgjQ5qkTQXyBFsaQLrJ64j3TOrAiAFEGBuAKpMia4JpFiBWSWTOhhImZFpe0lpcZijrprf/lX", + "NB/oiWIKxLGp3d5VMo7JBe1Lv6/nd6wmDF3EkRsNM8Xn9gsSe0gG9uvLpHry5McJT+n/mAxG8M5ZEFKI", + "thYmwg7AC8xwBK8EYMl4YY2UHYcMFSsUsnQJXNjPrF+mcEpFh2gODJ4/+XkEf3CTy8okgsGMab2QKnVZ", + "DpOJrIRHBQ3jik7gCGlA80wAF31pH0EvD2PN6LE6N2CmXGnTtwUzHBRs07fhUbuYChTItIEXMMmZYhND", + "YPjeSIUpVZ6CBY6fzZaQM52PulJAZrkUeLmQ6lPnvcML2n4ayT38XR9F2l3n4nGkXS3xY43F9HFbCnvA", + "g0qSkkLW2hkIKM8Epo+cdltgySVkfO6RYlIphcJYgzuC33MEgYtE1GOUlfYn6by0P33WEnegY3XW7Kd8", + "OkXlfM6VYV8mghuLKrpbNYYWQnBmMIXxEsbS5FAvhXZzcgVXgetEFDLLMHXwKCtz7YlbIGgfFVhlchTG", + "S/MQhIQGCzeg0nsspm/Dkh8KoPyKXLbf5ZrKC1xc7gA5116ChZaSi99QZFaonj7bliS2NpOV+8aksW8C", + "lDsEiS/ECXZpQUZ60Sz+XuQ9EcTe4SbkPRGevcPu5H2bb2+vaRXkuiC9v7RTGvF0WM/PM59FjgK4ASuq", + "jAv74IlIBn9NBpRvmQws4iYDqidG/KYBEUxpIDfVDm/ev4VY3Os7DjLvQ3LuYfytxSOIN/tCpJYk+6hW", + "0CM59a6K9SqWKywDSrZMxKQezOLAQlBBVjLYSk554ROoPU3JueUHfMKKxvxb8JELizyshT0/WAel29lp", + "7Ds8kCqA28MhYKERnj/5cZSINxa47O8+4VITExLAVCAZ6UtfS8B+ZBQvS8s2mIFSkuF9QY/lTe+QULNk", + "S0uRsJyZpeMrboVq7gRzVvAUWJoq1LoZ7aenz66PZr0mcrzGS2g/MTx4/uTnhxfgeFQgdXax3evRlHCe", + "CIGfDXi6ot392/AVfMoVUgWOU4UcF/vmsUh1eH9baJX91lRK6BpoN1Gr7xrLPx7cmS3Z58DrfuogdqvO", + "bevyp89eDLc4u1uu/hrdybMOAjes8vFM4bQ/KPwLmkneqKa9GBWKCeoLmHPNxwVaSK9KoYf+HzClGKAe", + "QsHnCKVMMREo2LjAFKYFy4aQ8zRF4aNeKIziqIcwGo0SkYgAOUw42AUnog4Q6pnkTDufr56Q90EJtxPB", + "Ci1XfpJK1ATDFM6yIMLd3+FB/NmeCSuKbqTzpPUtLdl3j3ZH1H1awXsUv33P5nibWtBrY89E9A5haMPG", + "J0tT7hzUt63v3TRWUnyJvjaA4oBnGIJbc1RjZnjZivc2KcdV1XXg782M/VkhaBTptVcCOMklpsAbeLok", + "IL50vCwROEdhiP0xmBQchSt+xTMhFdLegVwIqOiwhlv/zYEhWo27jiK/FlN5P0z+nZjmOSrN3Xp2GmNF", + "lhHYjEO4tMNC/bf+6mjvMdz9MMBdLwebsTEvOCmoW5GFVJ+m1k3c0joox9o1uqC/6h+CNkz5+DM5V9W4", + "5HV5OebcVLcXlojwK5CVmVVmBK/0qv/66u3rIWmnWtY3IT+La+PbFollF0bClb0VEfSrYSLcX1NZpKiu", + "yNV0nyxZWVw5BzWXus40oWkqtMbGd/f1z5uI8IBTJcse0vJHvYxxq/zk2kOs5Rn9C3HmQikoUi6yljA/", + "8HWhLWudFFJj+hAUFsw0J9Mde/1BJ8IgK4fXPoNpVRQu1mMljsRIFtbShYiukOJRHWcJAd0LuLJjXXmR", + "XNB/KWzENMWGKNLgbZm7qwsGJaKlOcnglbuaplou6cpk8BKuDEelw+gT2iqv9dVe5Bl969daligFUuin", + "jjxdu9dbv3Y0NrCJXdtk0GIqf9qX0FCVMPqgzU1QVCUdvUdWWgtrx2oZ0Vuhy0F3d3WXd7eHt2/jaBw1", + "D9hTqWJwMRg9Hnz9+PX/AQAA//8=", +} + +// decodeSpec returns the embedded OpenAPI spec as raw JSON bytes, +// after base64-decoding and flate-decompressing the embedded blob. func decodeSpec() ([]byte, error) { - zipped, err := base64.StdEncoding.DecodeString(strings.Join(swaggerSpec, "")) + encoded := strings.Join(swaggerSpec, "") + compressed, err := base64.StdEncoding.DecodeString(encoded) if err != nil { return nil, fmt.Errorf("error base64 decoding spec: %w", err) } - zr, err := gzip.NewReader(bytes.NewReader(zipped)) - if err != nil { - return nil, fmt.Errorf("error decompressing spec: %w", err) - } + zr := flate.NewReader(bytes.NewReader(compressed)) var buf bytes.Buffer - _, err = buf.ReadFrom(zr) - if err != nil { - return nil, fmt.Errorf("error decompressing spec: %w", err) + if _, err := buf.ReadFrom(zr); err != nil { + return nil, fmt.Errorf("read flate: %w", err) + } + if err := zr.Close(); err != nil { + return nil, fmt.Errorf("close flate reader: %w", err) } return buf.Bytes(), nil @@ -8970,7 +14469,7 @@ func decodeSpec() ([]byte, error) { var rawSpec = decodeSpecCached() -// a naive cached of a decoded swagger spec +// a naive cache of the decoded OpenAPI spec func decodeSpecCached() func() ([]byte, error) { data, err := decodeSpec() return func() ([]byte, error) { @@ -8988,12 +14487,12 @@ func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error) { return res } -// GetSwagger returns the Swagger specification corresponding to the generated code -// in this file. The external references of Swagger specification are resolved. -// The logic of resolving external references is tightly connected to "import-mapping" feature. -// Externally referenced files must be embedded in the corresponding golang packages. -// Urls can be supported but this task was out of the scope. -func GetSwagger() (swagger *openapi3.T, err error) { +// GetSpec returns the OpenAPI specification corresponding to the generated +// code in this file. External references in the spec are resolved through +// PathToRawSpec; externally-referenced files must be embedded in their +// corresponding Go packages (via the import-mapping feature). URL-based +// external refs are not supported. +func GetSpec() (swagger *openapi3.T, err error) { resolvePath := PathToRawSpec("") loader := openapi3.NewLoader() @@ -9019,3 +14518,22 @@ func GetSwagger() (swagger *openapi3.T, err error) { } return } + +// GetSpecJSON returns the raw JSON bytes of the embedded OpenAPI +// specification: decompressed but not unmarshaled. External references +// are not resolved here; the bytes are the spec exactly as embedded by +// codegen. The result is cached at package init time, so repeated calls +// are cheap. +func GetSpecJSON() ([]byte, error) { + return rawSpec() +} + +// GetSwagger returns the OpenAPI specification corresponding to the +// generated code in this file. +// +// Deprecated: GetSwagger predates kin-openapi renaming openapi3.Swagger +// to openapi3.T. Use [GetSpec] instead. This wrapper is retained for +// backwards compatibility. +func GetSwagger() (*openapi3.T, error) { + return GetSpec() +} diff --git a/server/codegen_type_gen.go b/server/codegen_type_gen.go index 42c248c9..9f427304 100644 --- a/server/codegen_type_gen.go +++ b/server/codegen_type_gen.go @@ -1,6 +1,6 @@ // Package server provides primitives to interact with the openapi HTTP API. // -// Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.5.1 DO NOT EDIT. +// Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.7.1 DO NOT EDIT. package server import ( @@ -10,906 +10,1917 @@ import ( ) const ( - BasicAuthScopes = "basicAuth.Scopes" - BearerAuthScopes = "bearerAuth.Scopes" + BasicAuthScopes basicAuthContextKey = "basicAuth.Scopes" + BearerAuthScopes bearerAuthContextKey = "bearerAuth.Scopes" ) -// Defines values for PostFiltersJSONBodyFOp. +// Defines values for NetworkSegmentRowSegType. const ( - Equal PostFiltersJSONBodyFOp = "=" - GreaterThan PostFiltersJSONBodyFOp = ">" - GreaterThanEqual PostFiltersJSONBodyFOp = ">=" - IN PostFiltersJSONBodyFOp = "IN" - LIKE PostFiltersJSONBodyFOp = "LIKE" - LessThan PostFiltersJSONBodyFOp = "<" - LessThanEqual PostFiltersJSONBodyFOp = "<=" + NetworkSegmentRowSegTypeDynamic NetworkSegmentRowSegType = "dynamic" + NetworkSegmentRowSegTypeStatic NetworkSegmentRowSegType = "static" ) -// Defines values for PostNodesJSONBodyActionType. +// Valid indicates whether the value is a known member of the NetworkSegmentRowSegType enum. +func (e NetworkSegmentRowSegType) Valid() bool { + switch e { + case NetworkSegmentRowSegTypeDynamic: + return true + case NetworkSegmentRowSegTypeStatic: + return true + default: + return false + } +} + +// Defines values for ObsolescenceSettingRowObsType. const ( - PostNodesJSONBodyActionTypePull PostNodesJSONBodyActionType = "pull" - PostNodesJSONBodyActionTypePush PostNodesJSONBodyActionType = "push" + Hw ObsolescenceSettingRowObsType = "hw" + Os ObsolescenceSettingRowObsType = "os" ) -// Defines values for PostNodeJSONBodyActionType. +// Valid indicates whether the value is a known member of the ObsolescenceSettingRowObsType enum. +func (e ObsolescenceSettingRowObsType) Valid() bool { + switch e { + case Hw: + return true + case Os: + return true + default: + return false + } +} + +// Defines values for SearchGroupKind. const ( - PostNodeJSONBodyActionTypePull PostNodeJSONBodyActionType = "pull" - PostNodeJSONBodyActionTypePush PostNodeJSONBodyActionType = "push" + App SearchGroupKind = "app" + Disk SearchGroupKind = "disk" + Filterset SearchGroupKind = "filterset" + Form SearchGroupKind = "form" + Group SearchGroupKind = "group" + Instance SearchGroupKind = "instance" + Moduleset SearchGroupKind = "moduleset" + Network SearchGroupKind = "network" + Node SearchGroupKind = "node" + Request SearchGroupKind = "request" + Ruleset SearchGroupKind = "ruleset" + Service SearchGroupKind = "service" + Tag SearchGroupKind = "tag" + User SearchGroupKind = "user" ) -// ListMeta defines model for ListMeta. -type ListMeta struct { - AvailableProps *[]string `json:"available_props,omitempty"` - Count *int `json:"count,omitempty"` - Distinct *map[string]int `json:"distinct,omitempty"` - IncludedProps *[]string `json:"included_props,omitempty"` - Limit *int `json:"limit,omitempty"` - Offset *int `json:"offset,omitempty"` - Total *int `json:"total,omitempty"` +// Valid indicates whether the value is a known member of the SearchGroupKind enum. +func (e SearchGroupKind) Valid() bool { + switch e { + case App: + return true + case Disk: + return true + case Filterset: + return true + case Form: + return true + case Group: + return true + case Instance: + return true + case Moduleset: + return true + case Network: + return true + case Node: + return true + case Request: + return true + case Ruleset: + return true + case Service: + return true + case Tag: + return true + case User: + return true + default: + return false + } } -// ListResponse defines model for ListResponse. -type ListResponse struct { - Data ListResponse_Data `json:"data"` - Meta *ListMeta `json:"meta,omitempty"` -} +// Defines values for PutComplianceModulesetJSONBodyAction. +const ( + PutComplianceModulesetJSONBodyActionClone PutComplianceModulesetJSONBodyAction = "clone" +) -// ListResponseData0 defines model for . -type ListResponseData0 = []map[string]interface{} +// Valid indicates whether the value is a known member of the PutComplianceModulesetJSONBodyAction enum. +func (e PutComplianceModulesetJSONBodyAction) Valid() bool { + switch e { + case PutComplianceModulesetJSONBodyActionClone: + return true + default: + return false + } +} -// ListResponseData1 defines model for . -type ListResponseData1 map[string]map[string]int +// Defines values for PostComplianceRulesetsJSONBodyRulesetType. +const ( + PostComplianceRulesetsJSONBodyRulesetTypeContextual PostComplianceRulesetsJSONBodyRulesetType = "contextual" + PostComplianceRulesetsJSONBodyRulesetTypeExplicit PostComplianceRulesetsJSONBodyRulesetType = "explicit" +) -// ListResponse_Data defines model for ListResponse.Data. -type ListResponse_Data struct { - union json.RawMessage +// Valid indicates whether the value is a known member of the PostComplianceRulesetsJSONBodyRulesetType enum. +func (e PostComplianceRulesetsJSONBodyRulesetType) Valid() bool { + switch e { + case PostComplianceRulesetsJSONBodyRulesetTypeContextual: + return true + case PostComplianceRulesetsJSONBodyRulesetTypeExplicit: + return true + default: + return false + } } -// Problem defines model for Problem. -type Problem struct { - // Text A human-readable explanation specific to this occurrence of the - // problem. - Text string `json:"text"` -} +// Defines values for PostComplianceRulesetJSONBodyRulesetType. +const ( + PostComplianceRulesetJSONBodyRulesetTypeContextual PostComplianceRulesetJSONBodyRulesetType = "contextual" + PostComplianceRulesetJSONBodyRulesetTypeExplicit PostComplianceRulesetJSONBodyRulesetType = "explicit" +) -// Version defines model for version. -type Version struct { - Version string `json:"version"` +// Valid indicates whether the value is a known member of the PostComplianceRulesetJSONBodyRulesetType enum. +func (e PostComplianceRulesetJSONBodyRulesetType) Valid() bool { + switch e { + case PostComplianceRulesetJSONBodyRulesetTypeContextual: + return true + case PostComplianceRulesetJSONBodyRulesetTypeExplicit: + return true + default: + return false + } } -// InPathMsetId defines model for inPathMsetId. -type InPathMsetId = string +// Defines values for PutComplianceRulesetJSONBodyAction. +const ( + PutComplianceRulesetJSONBodyActionClone PutComplianceRulesetJSONBodyAction = "clone" +) -// InPathNodeId defines model for inPathNodeId. -type InPathNodeId = string +// Valid indicates whether the value is a known member of the PutComplianceRulesetJSONBodyAction enum. +func (e PutComplianceRulesetJSONBodyAction) Valid() bool { + switch e { + case PutComplianceRulesetJSONBodyActionClone: + return true + default: + return false + } +} -// InPathRsetId defines model for inPathRsetId. -type InPathRsetId = string +// Defines values for PutComplianceRulesetVariableJSONBodyAction. +const ( + Copy PutComplianceRulesetVariableJSONBodyAction = "copy" + Move PutComplianceRulesetVariableJSONBodyAction = "move" +) -// InQueryGroupby defines model for inQueryGroupby. -type InQueryGroupby = string +// Valid indicates whether the value is a known member of the PutComplianceRulesetVariableJSONBodyAction enum. +func (e PutComplianceRulesetVariableJSONBodyAction) Valid() bool { + switch e { + case Copy: + return true + case Move: + return true + default: + return false + } +} -// InQueryLimit defines model for inQueryLimit. -type InQueryLimit = int +// Defines values for PostFiltersJSONBodyFOp. +const ( + PostFiltersJSONBodyFOpEqual PostFiltersJSONBodyFOp = "=" + PostFiltersJSONBodyFOpGreaterThan PostFiltersJSONBodyFOp = ">" + PostFiltersJSONBodyFOpGreaterThanEqual PostFiltersJSONBodyFOp = ">=" + PostFiltersJSONBodyFOpIN PostFiltersJSONBodyFOp = "IN" + PostFiltersJSONBodyFOpLIKE PostFiltersJSONBodyFOp = "LIKE" + PostFiltersJSONBodyFOpLessThan PostFiltersJSONBodyFOp = "<" + PostFiltersJSONBodyFOpLessThanEqual PostFiltersJSONBodyFOp = "<=" +) -// InQueryMeta defines model for inQueryMeta. -type InQueryMeta = string +// Valid indicates whether the value is a known member of the PostFiltersJSONBodyFOp enum. +func (e PostFiltersJSONBodyFOp) Valid() bool { + switch e { + case PostFiltersJSONBodyFOpEqual: + return true + case PostFiltersJSONBodyFOpGreaterThan: + return true + case PostFiltersJSONBodyFOpGreaterThanEqual: + return true + case PostFiltersJSONBodyFOpIN: + return true + case PostFiltersJSONBodyFOpLIKE: + return true + case PostFiltersJSONBodyFOpLessThan: + return true + case PostFiltersJSONBodyFOpLessThanEqual: + return true + default: + return false + } +} -// InQueryOffset defines model for inQueryOffset. -type InQueryOffset = int +// Defines values for PostFilterJSONBodyFOp. +const ( + PostFilterJSONBodyFOpEqual PostFilterJSONBodyFOp = "=" + PostFilterJSONBodyFOpGreaterThan PostFilterJSONBodyFOp = ">" + PostFilterJSONBodyFOpGreaterThanEqual PostFilterJSONBodyFOp = ">=" + PostFilterJSONBodyFOpIN PostFilterJSONBodyFOp = "IN" + PostFilterJSONBodyFOpLIKE PostFilterJSONBodyFOp = "LIKE" + PostFilterJSONBodyFOpLessThan PostFilterJSONBodyFOp = "<" + PostFilterJSONBodyFOpLessThanEqual PostFilterJSONBodyFOp = "<=" +) -// InQueryOrderby defines model for inQueryOrderby. -type InQueryOrderby = string +// Valid indicates whether the value is a known member of the PostFilterJSONBodyFOp enum. +func (e PostFilterJSONBodyFOp) Valid() bool { + switch e { + case PostFilterJSONBodyFOpEqual: + return true + case PostFilterJSONBodyFOpGreaterThan: + return true + case PostFilterJSONBodyFOpGreaterThanEqual: + return true + case PostFilterJSONBodyFOpIN: + return true + case PostFilterJSONBodyFOpLIKE: + return true + case PostFilterJSONBodyFOpLessThan: + return true + case PostFilterJSONBodyFOpLessThanEqual: + return true + default: + return false + } +} -// InQueryProps defines model for inQueryProps. -type InQueryProps = string +// Defines values for PostFiltersetsJSONBodyFsetStats. +const ( + PostFiltersetsJSONBodyFsetStatsF PostFiltersetsJSONBodyFsetStats = "F" + PostFiltersetsJSONBodyFsetStatsT PostFiltersetsJSONBodyFsetStats = "T" +) -// InQueryStats defines model for inQueryStats. -type InQueryStats = string +// Valid indicates whether the value is a known member of the PostFiltersetsJSONBodyFsetStats enum. +func (e PostFiltersetsJSONBodyFsetStats) Valid() bool { + switch e { + case PostFiltersetsJSONBodyFsetStatsF: + return true + case PostFiltersetsJSONBodyFsetStatsT: + return true + default: + return false + } +} -// N400 defines model for 400. -type N400 = Problem +// Defines values for PostFiltersetJSONBodyFsetStats. +const ( + PostFiltersetJSONBodyFsetStatsF PostFiltersetJSONBodyFsetStats = "F" + PostFiltersetJSONBodyFsetStatsT PostFiltersetJSONBodyFsetStats = "T" +) -// N401 defines model for 401. -type N401 = Problem +// Valid indicates whether the value is a known member of the PostFiltersetJSONBodyFsetStats enum. +func (e PostFiltersetJSONBodyFsetStats) Valid() bool { + switch e { + case PostFiltersetJSONBodyFsetStatsF: + return true + case PostFiltersetJSONBodyFsetStatsT: + return true + default: + return false + } +} -// N403 defines model for 403. -type N403 = Problem +// Defines values for PostFiltersetFilterJSONBodyFLogOp. +const ( + PostFiltersetFilterJSONBodyFLogOpAND PostFiltersetFilterJSONBodyFLogOp = "AND" + PostFiltersetFilterJSONBodyFLogOpANDNOT PostFiltersetFilterJSONBodyFLogOp = "AND NOT" + PostFiltersetFilterJSONBodyFLogOpOR PostFiltersetFilterJSONBodyFLogOp = "OR" + PostFiltersetFilterJSONBodyFLogOpORNOT PostFiltersetFilterJSONBodyFLogOp = "OR NOT" +) -// N404 defines model for 404. -type N404 = Problem +// Valid indicates whether the value is a known member of the PostFiltersetFilterJSONBodyFLogOp enum. +func (e PostFiltersetFilterJSONBodyFLogOp) Valid() bool { + switch e { + case PostFiltersetFilterJSONBodyFLogOpAND: + return true + case PostFiltersetFilterJSONBodyFLogOpANDNOT: + return true + case PostFiltersetFilterJSONBodyFLogOpOR: + return true + case PostFiltersetFilterJSONBodyFLogOpORNOT: + return true + default: + return false + } +} -// N409 defines model for 409. -type N409 = Problem +// Defines values for PostFiltersetFiltersetJSONBodyFLogOp. +const ( + PostFiltersetFiltersetJSONBodyFLogOpAND PostFiltersetFiltersetJSONBodyFLogOp = "AND" + PostFiltersetFiltersetJSONBodyFLogOpANDNOT PostFiltersetFiltersetJSONBodyFLogOp = "AND NOT" + PostFiltersetFiltersetJSONBodyFLogOpOR PostFiltersetFiltersetJSONBodyFLogOp = "OR" + PostFiltersetFiltersetJSONBodyFLogOpORNOT PostFiltersetFiltersetJSONBodyFLogOp = "OR NOT" +) -// N500 defines model for 500. -type N500 = Problem +// Valid indicates whether the value is a known member of the PostFiltersetFiltersetJSONBodyFLogOp enum. +func (e PostFiltersetFiltersetJSONBodyFLogOp) Valid() bool { + switch e { + case PostFiltersetFiltersetJSONBodyFLogOpAND: + return true + case PostFiltersetFiltersetJSONBodyFLogOpANDNOT: + return true + case PostFiltersetFiltersetJSONBodyFLogOpOR: + return true + case PostFiltersetFiltersetJSONBodyFLogOpORNOT: + return true + default: + return false + } +} -// GetActionsParams defines parameters for GetActions. -type GetActionsParams struct { - // Props A list of properties to include in each data dictionnary. - Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` +// Defines values for PostFiltersetsFiltersJSONBodyFLogOp. +const ( + PostFiltersetsFiltersJSONBodyFLogOpAND PostFiltersetsFiltersJSONBodyFLogOp = "AND" + PostFiltersetsFiltersJSONBodyFLogOpANDNOT PostFiltersetsFiltersJSONBodyFLogOp = "AND NOT" + PostFiltersetsFiltersJSONBodyFLogOpOR PostFiltersetsFiltersJSONBodyFLogOp = "OR" + PostFiltersetsFiltersJSONBodyFLogOpORNOT PostFiltersetsFiltersJSONBodyFLogOp = "OR NOT" +) - // Limit The maximum number of entries to return. 0 means no limit. - Limit *InQueryLimit `form:"limit,omitempty" json:"limit,omitempty"` +// Valid indicates whether the value is a known member of the PostFiltersetsFiltersJSONBodyFLogOp enum. +func (e PostFiltersetsFiltersJSONBodyFLogOp) Valid() bool { + switch e { + case PostFiltersetsFiltersJSONBodyFLogOpAND: + return true + case PostFiltersetsFiltersJSONBodyFLogOpANDNOT: + return true + case PostFiltersetsFiltersJSONBodyFLogOpOR: + return true + case PostFiltersetsFiltersJSONBodyFLogOpORNOT: + return true + default: + return false + } +} - // Offset Skip the first entries of the data cursor. - Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` +// Defines values for PostFiltersetsFiltersetsJSONBodyFLogOp. +const ( + PostFiltersetsFiltersetsJSONBodyFLogOpAND PostFiltersetsFiltersetsJSONBodyFLogOp = "AND" + PostFiltersetsFiltersetsJSONBodyFLogOpANDNOT PostFiltersetsFiltersetsJSONBodyFLogOp = "AND NOT" + PostFiltersetsFiltersetsJSONBodyFLogOpOR PostFiltersetsFiltersetsJSONBodyFLogOp = "OR" + PostFiltersetsFiltersetsJSONBodyFLogOpORNOT PostFiltersetsFiltersetsJSONBodyFLogOp = "OR NOT" +) - // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit the meta field. - Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` +// Valid indicates whether the value is a known member of the PostFiltersetsFiltersetsJSONBodyFLogOp enum. +func (e PostFiltersetsFiltersetsJSONBodyFLogOp) Valid() bool { + switch e { + case PostFiltersetsFiltersetsJSONBodyFLogOpAND: + return true + case PostFiltersetsFiltersetsJSONBodyFLogOpANDNOT: + return true + case PostFiltersetsFiltersetsJSONBodyFLogOpOR: + return true + case PostFiltersetsFiltersetsJSONBodyFLogOpORNOT: + return true + default: + return false + } +} - // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. - Stats *InQueryStats `form:"stats,omitempty" json:"stats,omitempty"` +// Defines values for PostNetworkSegmentsJSONBodySegType. +const ( + PostNetworkSegmentsJSONBodySegTypeDynamic PostNetworkSegmentsJSONBodySegType = "dynamic" + PostNetworkSegmentsJSONBodySegTypeStatic PostNetworkSegmentsJSONBodySegType = "static" +) - // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). - Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` +// Valid indicates whether the value is a known member of the PostNetworkSegmentsJSONBodySegType enum. +func (e PostNetworkSegmentsJSONBodySegType) Valid() bool { + switch e { + case PostNetworkSegmentsJSONBodySegTypeDynamic: + return true + case PostNetworkSegmentsJSONBodySegTypeStatic: + return true + default: + return false + } +} - // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). - Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` +// Defines values for PostNodesJSONBodyActionType. +const ( + PostNodesJSONBodyActionTypePull PostNodesJSONBodyActionType = "pull" + PostNodesJSONBodyActionTypePush PostNodesJSONBodyActionType = "push" +) + +// Valid indicates whether the value is a known member of the PostNodesJSONBodyActionType enum. +func (e PostNodesJSONBodyActionType) Valid() bool { + switch e { + case PostNodesJSONBodyActionTypePull: + return true + case PostNodesJSONBodyActionTypePush: + return true + default: + return false + } } -// PostActionsJSONBody defines parameters for PostActions. -type PostActionsJSONBody struct { - // Id Action queue entry id - Id string `json:"id"` +// Defines values for PostNodeJSONBodyActionType. +const ( + PostNodeJSONBodyActionTypePull PostNodeJSONBodyActionType = "pull" + PostNodeJSONBodyActionTypePush PostNodeJSONBodyActionType = "push" +) - // Status New status (the only updatable property) - Status *string `json:"status,omitempty"` +// Valid indicates whether the value is a known member of the PostNodeJSONBodyActionType enum. +func (e PostNodeJSONBodyActionType) Valid() bool { + switch e { + case PostNodeJSONBodyActionTypePull: + return true + case PostNodeJSONBodyActionTypePush: + return true + default: + return false + } } -// GetActionParams defines parameters for GetAction. -type GetActionParams struct { - // Props A list of properties to include in each data dictionnary. - Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` +// Defines values for GetWorkflowsParamsAssigned. +const ( + Team GetWorkflowsParamsAssigned = "team" + Tiers GetWorkflowsParamsAssigned = "tiers" +) - // Limit The maximum number of entries to return. 0 means no limit. - Limit *InQueryLimit `form:"limit,omitempty" json:"limit,omitempty"` +// Valid indicates whether the value is a known member of the GetWorkflowsParamsAssigned enum. +func (e GetWorkflowsParamsAssigned) Valid() bool { + switch e { + case Team: + return true + case Tiers: + return true + default: + return false + } +} - // Offset Skip the first entries of the data cursor. - Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` +// ActionEnqueue One action to enqueue with PUT /actions. +type ActionEnqueue struct { + // Action Agent action to run + Action string `json:"action"` - // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit the meta field. - Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` + // NodeId Target node (node_id or nodename) + NodeId *string `json:"node_id,omitempty"` - // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. - Stats *InQueryStats `form:"stats,omitempty" json:"stats,omitempty"` + // Rid Resource ids to limit an instance action to, comma separated + Rid *string `json:"rid,omitempty"` - // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). - Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` + // SvcId Target service (svc_id or svcname) + SvcId *string `json:"svc_id,omitempty"` - // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). - Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` + // Vmname Target node by name, in place of node_id, for an encapsulated node + Vmname *string `json:"vmname,omitempty"` } -// GetAlertEventParams defines parameters for GetAlertEvent. -type GetAlertEventParams struct { - // Props A list of properties to include in each data dictionnary. - Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` +// AlertListResponse defines model for AlertListResponse. +type AlertListResponse struct { + Data AlertListResponse_Data `json:"data"` + Meta *ListMeta `json:"meta,omitempty"` +} - // Limit The maximum number of entries to return. 0 means no limit. - Limit *InQueryLimit `form:"limit,omitempty" json:"limit,omitempty"` +// AlertListResponseData0 defines model for . +type AlertListResponseData0 = []AlertRow - // Offset Skip the first entries of the data cursor. - Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` +// AlertListResponseData1 defines model for . +type AlertListResponseData1 map[string]map[string]int - // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit the meta field. - Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` +// AlertListResponse_Data defines model for AlertListResponse.Data. +type AlertListResponse_Data struct { + union json.RawMessage +} - // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. - Stats *InQueryStats `form:"stats,omitempty" json:"stats,omitempty"` +// AlertRow A dashboard alert row. Every property is optional: the `props` query +// parameter selects which columns the server returns. `alert` is computed +// from `dash_fmt` and `dash_dict`. The `nodes.` and `services.` properties +// come from a LEFT JOIN and are null when the alert targets the other kind +// of object. +type AlertRow struct { + // Alert Human readable message, rendered from dash_fmt and dash_dict. + Alert *string `json:"alert,omitempty"` + DashCreated *string `json:"dash_created,omitempty"` + DashDict *string `json:"dash_dict,omitempty"` + DashDictMd5 *string `json:"dash_dict_md5,omitempty"` + DashEnv *string `json:"dash_env,omitempty"` + DashFmt *string `json:"dash_fmt,omitempty"` + DashInstance *string `json:"dash_instance,omitempty"` + DashMd5 *string `json:"dash_md5,omitempty"` + DashSeverity *int `json:"dash_severity,omitempty"` + DashType *string `json:"dash_type,omitempty"` + DashUpdated *string `json:"dash_updated,omitempty"` + Id *int `json:"id,omitempty"` + NodeId *string `json:"node_id,omitempty"` + NodesNodename *string `json:"nodes.nodename,omitempty"` + ServicesSvcname *string `json:"services.svcname,omitempty"` + SvcId *string `json:"svc_id,omitempty"` +} + +// AppListResponse defines model for AppListResponse. +type AppListResponse struct { + Data AppListResponse_Data `json:"data"` + Meta *ListMeta `json:"meta,omitempty"` +} + +// AppListResponseData0 defines model for . +type AppListResponseData0 = []AppRow + +// AppListResponseData1 defines model for . +type AppListResponseData1 map[string]map[string]int + +// AppListResponse_Data defines model for AppListResponse.Data. +type AppListResponse_Data struct { + union json.RawMessage +} - // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). - Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` +// AppRow An application code. Every property is optional: the `props` query +// parameter selects which columns the server returns. +type AppRow struct { + App *string `json:"app,omitempty"` + AppDomain *string `json:"app_domain,omitempty"` + AppTeamOps *string `json:"app_team_ops,omitempty"` + Description *string `json:"description,omitempty"` + Id *int `json:"id,omitempty"` + Updated *string `json:"updated,omitempty"` +} - // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). - Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` +// CompExportModule defines model for CompExportModule. +type CompExportModule struct { + Autofix *string `json:"autofix,omitempty"` + ModsetModName *string `json:"modset_mod_name,omitempty"` } -// DeleteAlertsJSONBody defines parameters for DeleteAlerts. -type DeleteAlertsJSONBody struct { - DashInstance *string `json:"dash_instance,omitempty"` - DashSeverity *int `json:"dash_severity,omitempty"` - DashType *string `json:"dash_type,omitempty"` - Id *string `json:"id,omitempty"` - NodeId *string `json:"node_id,omitempty"` - SvcId *string `json:"svc_id,omitempty"` +// CompExportModuleset defines model for CompExportModuleset. +type CompExportModuleset struct { + Id *int `json:"id,omitempty"` + ModsetName *string `json:"modset_name,omitempty"` + Modules *[]CompExportModule `json:"modules,omitempty"` + + // Modulesets The names of the child modulesets + Modulesets *[]string `json:"modulesets,omitempty"` + Publications *[]string `json:"publications,omitempty"` + Responsibles *[]string `json:"responsibles,omitempty"` + + // Rulesets The names of the attached rulesets + Rulesets *[]string `json:"rulesets,omitempty"` } -// GetAlertsParams defines parameters for GetAlerts. -type GetAlertsParams struct { - // Props A list of properties to include in each data dictionnary. - Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` +// CompExportRuleset defines model for CompExportRuleset. +type CompExportRuleset struct { + FsetName *string `json:"fset_name,omitempty"` + Id *int `json:"id,omitempty"` - // Limit The maximum number of entries to return. 0 means no limit. - Limit *InQueryLimit `form:"limit,omitempty" json:"limit,omitempty"` + // Publications The roles of the publication groups + Publications *[]string `json:"publications,omitempty"` - // Offset Skip the first entries of the data cursor. - Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` + // Responsibles The roles of the responsible groups + Responsibles *[]string `json:"responsibles,omitempty"` + RulesetName *string `json:"ruleset_name,omitempty"` + RulesetPublic *string `json:"ruleset_public,omitempty"` + RulesetType *string `json:"ruleset_type,omitempty"` - // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit the meta field. - Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` + // Rulesets The names of the child rulesets + Rulesets *[]string `json:"rulesets,omitempty"` + Variables *[]CompExportVariable `json:"variables,omitempty"` +} - // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. - Stats *InQueryStats `form:"stats,omitempty" json:"stats,omitempty"` +// CompExportVariable defines model for CompExportVariable. +type CompExportVariable struct { + Id *int `json:"id,omitempty"` + VarAuthor *string `json:"var_author,omitempty"` + VarClass *string `json:"var_class,omitempty"` + VarName *string `json:"var_name,omitempty"` + VarUpdated *string `json:"var_updated,omitempty"` + VarValue *string `json:"var_value,omitempty"` +} - // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). - Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` +// CompModulesetExport Modulesets with their descendants, and the rulesets and filtersets they use, +// in the format POST /compliance/import reads. +type CompModulesetExport struct { + Filtersets *[]FiltersetExportItem `json:"filtersets,omitempty"` + Modulesets *[]CompExportModuleset `json:"modulesets,omitempty"` + Rulesets *[]CompExportRuleset `json:"rulesets,omitempty"` +} - // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). - Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` +// CompRulesetExport Rulesets with their descendants and the filtersets they use, in the format +// POST /compliance/import reads. +type CompRulesetExport struct { + Filtersets *[]FiltersetExportItem `json:"filtersets,omitempty"` + Rulesets *[]CompExportRuleset `json:"rulesets,omitempty"` } -// PostAlertsJSONBody defines parameters for PostAlerts. -type PostAlertsJSONBody struct { - BaseSeverity *int `json:"base_severity,omitempty"` - DashDict *map[string]interface{} `json:"dash_dict,omitempty"` - DashEnv *string `json:"dash_env,omitempty"` - DashFmt *string `json:"dash_fmt,omitempty"` - DashInstance *string `json:"dash_instance,omitempty"` - DashSeverity *int `json:"dash_severity,omitempty"` - DashType string `json:"dash_type"` - NodeId *string `json:"node_id,omitempty"` - SvcId *string `json:"svc_id,omitempty"` +// ComplianceLogListResponse defines model for ComplianceLogListResponse. +type ComplianceLogListResponse struct { + Data ComplianceLogListResponse_Data `json:"data"` + Meta *ListMeta `json:"meta,omitempty"` } -// GetAlertParams defines parameters for GetAlert. -type GetAlertParams struct { - // Props A list of properties to include in each data dictionnary. - Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` +// ComplianceLogListResponseData0 defines model for . +type ComplianceLogListResponseData0 = []ComplianceLogRow - // Limit The maximum number of entries to return. 0 means no limit. - Limit *InQueryLimit `form:"limit,omitempty" json:"limit,omitempty"` +// ComplianceLogListResponseData1 defines model for . +type ComplianceLogListResponseData1 map[string]map[string]int - // Offset Skip the first entries of the data cursor. - Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` - - // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit the meta field. - Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` +// ComplianceLogListResponse_Data defines model for ComplianceLogListResponse.Data. +type ComplianceLogListResponse_Data struct { + union json.RawMessage +} - // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. - Stats *InQueryStats `form:"stats,omitempty" json:"stats,omitempty"` +// ComplianceLogRow A run of a compliance module on a node, or on a service instance on that +// node: its action (check, fixable, fix), its exit code (`run_status`: 0 ok, +// 1 not ok, 2 not applicable) and its log. Every property is optional: the +// `props` query parameter selects which columns the server returns. +type ComplianceLogRow struct { + Id *int `json:"id,omitempty"` + NodeId *string `json:"node_id,omitempty"` - // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). - Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` + // NodesNodename The name of the node, joined. + NodesNodename *string `json:"nodes.nodename,omitempty"` + RsetMd5 *string `json:"rset_md5,omitempty"` + RunAction *string `json:"run_action,omitempty"` + RunDate *string `json:"run_date,omitempty"` + RunLog *string `json:"run_log,omitempty"` + RunModule *string `json:"run_module,omitempty"` + RunStatus *int `json:"run_status,omitempty"` - // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). - Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` + // ServicesSvcname The name of the service, joined; null for a run on the node itself. + ServicesSvcname *string `json:"services.svcname,omitempty"` + SvcId *string `json:"svc_id,omitempty"` } -// PostAlertJSONBody defines parameters for PostAlert. -type PostAlertJSONBody struct { - BaseSeverity *int `json:"base_severity,omitempty"` - DashDict *map[string]interface{} `json:"dash_dict,omitempty"` - DashFmt *string `json:"dash_fmt,omitempty"` - DashInstance *string `json:"dash_instance,omitempty"` - DashSeverity *int `json:"dash_severity,omitempty"` - DashType *string `json:"dash_type,omitempty"` - NodeId *string `json:"node_id,omitempty"` - SvcId *string `json:"svc_id,omitempty"` +// ComplianceStatusListResponse defines model for ComplianceStatusListResponse. +type ComplianceStatusListResponse struct { + Data ComplianceStatusListResponse_Data `json:"data"` + Meta *ListMeta `json:"meta,omitempty"` } -// DeleteAppsJSONBody defines parameters for DeleteApps. -type DeleteAppsJSONBody struct { - // App App code - App *string `json:"app,omitempty"` +// ComplianceStatusListResponseData0 defines model for . +type ComplianceStatusListResponseData0 = []ComplianceStatusRow - // Id App record id - Id *string `json:"id,omitempty"` -} +// ComplianceStatusListResponseData1 defines model for . +type ComplianceStatusListResponseData1 map[string]map[string]int -// GetAppsParams defines parameters for GetApps. -type GetAppsParams struct { - // Props A list of properties to include in each data dictionnary. - Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` +// ComplianceStatusListResponse_Data defines model for ComplianceStatusListResponse.Data. +type ComplianceStatusListResponse_Data struct { + union json.RawMessage +} - // Limit The maximum number of entries to return. 0 means no limit. - Limit *InQueryLimit `form:"limit,omitempty" json:"limit,omitempty"` +// ComplianceStatusRow The last run of a compliance module on a node, or on a service's instance +// on it. Every property is optional: the `props` query parameter selects which +// columns the server returns. `run_status` is the module's exit code: 0 ok, +// 1 not ok, 2 not applicable. +type ComplianceStatusRow struct { + Id *int `json:"id,omitempty"` + NodeId *string `json:"node_id,omitempty"` + RsetMd5 *string `json:"rset_md5,omitempty"` + RunAction *string `json:"run_action,omitempty"` + RunDate *string `json:"run_date,omitempty"` + RunLog *string `json:"run_log,omitempty"` + RunModule *string `json:"run_module,omitempty"` + RunStatus *int `json:"run_status,omitempty"` + SvcId *string `json:"svc_id,omitempty"` +} - // Offset Skip the first entries of the data cursor. - Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` +// DiskListResponse defines model for DiskListResponse. +type DiskListResponse struct { + Data DiskListResponse_Data `json:"data"` + Meta *ListMeta `json:"meta,omitempty"` +} - // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit the meta field. - Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` +// DiskListResponseData0 defines model for . +type DiskListResponseData0 = []DiskRow - // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. - Stats *InQueryStats `form:"stats,omitempty" json:"stats,omitempty"` +// DiskListResponseData1 defines model for . +type DiskListResponseData1 map[string]map[string]int - // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). - Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` +// DiskListResponse_Data defines model for DiskListResponse.Data. +type DiskListResponse_Data struct { + union json.RawMessage +} - // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). - Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` +// DiskRow A disk seen on a node, with the service and array it belongs to when +// known. Every property is optional: the `props` query parameter selects +// which columns the server returns. +type DiskRow struct { + App *string `json:"app,omitempty"` + DiskAlloc *int `json:"disk_alloc,omitempty"` + DiskArrayid *string `json:"disk_arrayid,omitempty"` + DiskDevid *string `json:"disk_devid,omitempty"` + DiskDg *string `json:"disk_dg,omitempty"` + DiskGroup *string `json:"disk_group,omitempty"` + DiskId *string `json:"disk_id,omitempty"` + DiskLevel *int `json:"disk_level,omitempty"` + DiskModel *string `json:"disk_model,omitempty"` + DiskName *string `json:"disk_name,omitempty"` + DiskRaid *string `json:"disk_raid,omitempty"` + DiskRegion *string `json:"disk_region,omitempty"` + DiskSize *int `json:"disk_size,omitempty"` + DiskUsed *int `json:"disk_used,omitempty"` + DiskVendor *string `json:"disk_vendor,omitempty"` + NodeId *string `json:"node_id,omitempty"` + Nodename *string `json:"nodename,omitempty"` + SvcId *string `json:"svc_id,omitempty"` + Svcname *string `json:"svcname,omitempty"` + Updated *string `json:"updated,omitempty"` +} + +// FilterListResponse defines model for FilterListResponse. +type FilterListResponse struct { + Data FilterListResponse_Data `json:"data"` + Meta *ListMeta `json:"meta,omitempty"` +} + +// FilterListResponseData0 defines model for . +type FilterListResponseData0 = []FilterRow + +// FilterListResponseData1 defines model for . +type FilterListResponseData1 map[string]map[string]int + +// FilterListResponse_Data defines model for FilterListResponse.Data. +type FilterListResponse_Data struct { + union json.RawMessage } -// PostAppsJSONBody defines parameters for PostApps. -type PostAppsJSONBody struct { - App string `json:"app"` - AppDomain *string `json:"app_domain,omitempty"` - AppTeamOps *string `json:"app_team_ops,omitempty"` - Description *string `json:"description,omitempty"` +// FilterRow A filter: one condition on a column of a collector table, which filtersets +// combine. Every property is optional: the `props` query parameter selects which +// columns the server returns. `f_label` and `f_cksum` are computed by the +// database from the definition. +type FilterRow struct { + FAuthor *string `json:"f_author,omitempty"` + FCksum *string `json:"f_cksum,omitempty"` + FField *string `json:"f_field,omitempty"` + FLabel *string `json:"f_label,omitempty"` + FOp *string `json:"f_op,omitempty"` + FTable *string `json:"f_table,omitempty"` + FUpdated *string `json:"f_updated,omitempty"` + FValue *string `json:"f_value,omitempty"` + Id *int `json:"id,omitempty"` } -// GetAppParams defines parameters for GetApp. -type GetAppParams struct { - // Props A list of properties to include in each data dictionnary. - Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` +// FiltersetExport A filterset and every filterset it encapsulates, recursively, each with its +// ordered entries. An entry holds either a filter or the name of an +// encapsulated filterset. +type FiltersetExport struct { + Filtersets []FiltersetExportItem `json:"filtersets"` } -// PostAppJSONBody defines parameters for PostApp. -type PostAppJSONBody struct { - App *string `json:"app,omitempty"` - AppDomain *string `json:"app_domain,omitempty"` - AppTeamOps *string `json:"app_team_ops,omitempty"` - Description *string `json:"description,omitempty"` +// FiltersetExportEntry defines model for FiltersetExportEntry. +type FiltersetExportEntry struct { + FLogOp string `json:"f_log_op"` + FOrder int `json:"f_order"` + Filter *FiltersetExportFilter `json:"filter,omitempty"` + + // Filterset Name of the encapsulated filterset, when the entry is not a filter. + Filterset *string `json:"filterset,omitempty"` } -// GetAppNodesParams defines parameters for GetAppNodes. -type GetAppNodesParams struct { - // Props A list of properties to include in each data dictionnary. - Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` +// FiltersetExportFilter defines model for FiltersetExportFilter. +type FiltersetExportFilter struct { + FField string `json:"f_field"` + FOp string `json:"f_op"` + FTable string `json:"f_table"` + FValue string `json:"f_value"` + Id int `json:"id"` +} - // Limit The maximum number of entries to return. 0 means no limit. - Limit *InQueryLimit `form:"limit,omitempty" json:"limit,omitempty"` +// FiltersetExportItem defines model for FiltersetExportItem. +type FiltersetExportItem struct { + Filters []FiltersetExportEntry `json:"filters"` + FsetName string `json:"fset_name"` + FsetStats *string `json:"fset_stats,omitempty"` + Id int `json:"id"` +} - // Offset Skip the first entries of the data cursor. - Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` +// FiltersetFilterListResponse defines model for FiltersetFilterListResponse. +type FiltersetFilterListResponse struct { + Data FiltersetFilterListResponse_Data `json:"data"` + Meta *ListMeta `json:"meta,omitempty"` +} - // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit the meta field. - Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` +// FiltersetFilterListResponseData0 defines model for . +type FiltersetFilterListResponseData0 = []FiltersetFilterRow - // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. - Stats *InQueryStats `form:"stats,omitempty" json:"stats,omitempty"` +// FiltersetFilterListResponseData1 defines model for . +type FiltersetFilterListResponseData1 map[string]map[string]int - // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). - Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` +// FiltersetFilterListResponse_Data defines model for FiltersetFilterListResponse.Data. +type FiltersetFilterListResponse_Data struct { + union json.RawMessage +} - // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). - Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` +// FiltersetFilterRow A filter attached to a filterset: the filter properties, plus its position +// (`f_order`) and the logical operator joining it to the previous entry. +type FiltersetFilterRow struct { + EncapFsetId *int `json:"encap_fset_id,omitempty"` + FAuthor *string `json:"f_author,omitempty"` + FCksum *string `json:"f_cksum,omitempty"` + FField *string `json:"f_field,omitempty"` + FLabel *string `json:"f_label,omitempty"` + FLogOp *string `json:"f_log_op,omitempty"` + FOp *string `json:"f_op,omitempty"` + FOrder *int `json:"f_order,omitempty"` + FTable *string `json:"f_table,omitempty"` + FUpdated *string `json:"f_updated,omitempty"` + FValue *string `json:"f_value,omitempty"` + FsetId *int `json:"fset_id,omitempty"` + Id *int `json:"id,omitempty"` + JoinId *int `json:"join_id,omitempty"` } -// GetAppPublicationsParams defines parameters for GetAppPublications. -type GetAppPublicationsParams struct { - // Props A list of properties to include in each data dictionnary. - Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` +// FiltersetListResponse defines model for FiltersetListResponse. +type FiltersetListResponse struct { + Data FiltersetListResponse_Data `json:"data"` + Meta *ListMeta `json:"meta,omitempty"` +} - // Limit The maximum number of entries to return. 0 means no limit. - Limit *InQueryLimit `form:"limit,omitempty" json:"limit,omitempty"` +// FiltersetListResponseData0 defines model for . +type FiltersetListResponseData0 = []FiltersetRow - // Offset Skip the first entries of the data cursor. - Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` +// FiltersetListResponseData1 defines model for . +type FiltersetListResponseData1 map[string]map[string]int - // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit the meta field. - Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` +// FiltersetListResponse_Data defines model for FiltersetListResponse.Data. +type FiltersetListResponse_Data struct { + union json.RawMessage +} - // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. - Stats *InQueryStats `form:"stats,omitempty" json:"stats,omitempty"` +// FiltersetRef defines model for FiltersetRef. +type FiltersetRef struct { + FsetName *string `json:"fset_name,omitempty"` + Id int `json:"id"` +} - // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). - Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` +// FiltersetRow A filterset: an ordered combination of filters and other filtersets that +// selects nodes and services. Every property is optional: the `props` query +// parameter selects which columns the server returns. +type FiltersetRow struct { + FsetAuthor *string `json:"fset_author,omitempty"` + FsetName *string `json:"fset_name,omitempty"` - // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). - Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` + // FsetStats T for a stats filterset, F otherwise. + FsetStats *string `json:"fset_stats,omitempty"` + FsetUpdated *string `json:"fset_updated,omitempty"` + Id *int `json:"id,omitempty"` } -// GetAppQuotasParams defines parameters for GetAppQuotas. -type GetAppQuotasParams struct { - // Props A list of properties to include in each data dictionnary. - Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` +// FiltersetUsageResponse defines model for FiltersetUsageResponse. +type FiltersetUsageResponse struct { + Data struct { + // Filtersets Filtersets encapsulating this one. + Filtersets []FiltersetRef `json:"filtersets"` - // Limit The maximum number of entries to return. 0 means no limit. - Limit *InQueryLimit `form:"limit,omitempty" json:"limit,omitempty"` + // Rulesets Compliance rulesets restricted by this filterset. The ruleset name is in `fset_name`. + Rulesets []FiltersetRef `json:"rulesets"` - // Offset Skip the first entries of the data cursor. - Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` + // Thresholds Check thresholds, as "chk_type.chk_instance:low-high". + Thresholds []string `json:"thresholds"` + } `json:"data"` +} - // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit the meta field. - Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` +// FormListResponse defines model for FormListResponse. +type FormListResponse struct { + Data FormListResponse_Data `json:"data"` - // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. - Stats *InQueryStats `form:"stats,omitempty" json:"stats,omitempty"` + // Info The change made, on a modification + Info *string `json:"info,omitempty"` + Meta *ListMeta `json:"meta,omitempty"` +} - // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). - Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` +// FormListResponseData0 defines model for . +type FormListResponseData0 = []FormRow - // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). - Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` +// FormListResponseData1 defines model for . +type FormListResponseData1 map[string]map[string]int + +// FormListResponse_Data defines model for FormListResponse.Data. +type FormListResponse_Data struct { + union json.RawMessage } -// GetAppResponsiblesParams defines parameters for GetAppResponsibles. -type GetAppResponsiblesParams struct { - // Props A list of properties to include in each data dictionnary. - Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` +// FormRow A form: its definition, form_yaml, drives the inputs a submission expects +// and the outputs it runs. form_definition is form_yaml parsed. Every +// property is optional: the `props` query parameter selects which columns +// the server returns. +type FormRow struct { + FormAuthor *string `json:"form_author,omitempty"` + FormCreated *string `json:"form_created,omitempty"` - // Limit The maximum number of entries to return. 0 means no limit. - Limit *InQueryLimit `form:"limit,omitempty" json:"limit,omitempty"` + // FormDefinition form_yaml parsed, absent when it does not parse + FormDefinition interface{} `json:"form_definition,omitempty"` + FormFolder *string `json:"form_folder,omitempty"` + FormName *string `json:"form_name,omitempty"` - // Offset Skip the first entries of the data cursor. - Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` + // FormType obj, custo, folder or generic + FormType *string `json:"form_type,omitempty"` + FormYaml *string `json:"form_yaml,omitempty"` + Id *int `json:"id,omitempty"` +} - // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit the meta field. - Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` +// GroupListResponse defines model for GroupListResponse. +type GroupListResponse struct { + Data GroupListResponse_Data `json:"data"` + Meta *ListMeta `json:"meta,omitempty"` +} - // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. - Stats *InQueryStats `form:"stats,omitempty" json:"stats,omitempty"` +// GroupListResponseData0 defines model for . +type GroupListResponseData0 = []GroupRow - // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). - Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` +// GroupListResponseData1 defines model for . +type GroupListResponseData1 map[string]map[string]int - // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). - Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` +// GroupListResponse_Data defines model for GroupListResponse.Data. +type GroupListResponse_Data struct { + union json.RawMessage } -// GetAppServicesParams defines parameters for GetAppServices. -type GetAppServicesParams struct { - // Props A list of properties to include in each data dictionnary. - Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` - - // Limit The maximum number of entries to return. 0 means no limit. - Limit *InQueryLimit `form:"limit,omitempty" json:"limit,omitempty"` +// GroupRow A user group. `privilege` is "T" for a privilege-granting group and +// "F" for an ordinary one. Every property is optional: the `props` query +// parameter selects which columns the server returns. +type GroupRow struct { + Description *string `json:"description,omitempty"` + Id *int `json:"id,omitempty"` + Privilege *string `json:"privilege,omitempty"` + Role *string `json:"role,omitempty"` +} - // Offset Skip the first entries of the data cursor. - Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` +// HbaListResponse defines model for HbaListResponse. +type HbaListResponse struct { + Data HbaListResponse_Data `json:"data"` + Meta *ListMeta `json:"meta,omitempty"` +} - // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit the meta field. - Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` +// HbaListResponseData0 defines model for . +type HbaListResponseData0 = []HbaRow - // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. - Stats *InQueryStats `form:"stats,omitempty" json:"stats,omitempty"` +// HbaListResponseData1 defines model for . +type HbaListResponseData1 map[string]map[string]int - // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). - Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` +// HbaListResponse_Data defines model for HbaListResponse.Data. +type HbaListResponse_Data struct { + union json.RawMessage +} - // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). - Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` +// HbaRow A host bus adapter of a node, as reported by the agent: `hba_id` is its +// initiator identifier (an iSCSI IQN or a Fibre Channel WWPN), `hba_type` its +// transport. Every property is optional: the `props` query parameter selects +// which columns the server returns. +type HbaRow struct { + HbaId *string `json:"hba_id,omitempty"` + HbaType *string `json:"hba_type,omitempty"` + Id *int `json:"id,omitempty"` + NodeId *string `json:"node_id,omitempty"` + Updated *string `json:"updated,omitempty"` } -// DeleteAppsPublicationsJSONBody defines parameters for DeleteAppsPublications. -type DeleteAppsPublicationsJSONBody struct { - // AppId App record id or app code - AppId string `json:"app_id"` +// InfoResponse Outcome message of a write that returns no record. +type InfoResponse struct { + Info *string `json:"info,omitempty"` +} - // GroupId Group record id or group role - GroupId string `json:"group_id"` +// InstanceListResponse defines model for InstanceListResponse. +type InstanceListResponse struct { + Data InstanceListResponse_Data `json:"data"` + Meta *ListMeta `json:"meta,omitempty"` } -// PostAppsPublicationsJSONBody defines parameters for PostAppsPublications. -type PostAppsPublicationsJSONBody struct { - // AppId App record id or app code - AppId string `json:"app_id"` +// InstanceListResponseData0 defines model for . +type InstanceListResponseData0 = []InstanceRow - // GroupId Group record id or group role - GroupId string `json:"group_id"` +// InstanceListResponseData1 defines model for . +type InstanceListResponseData1 map[string]map[string]int + +// InstanceListResponse_Data defines model for InstanceListResponse.Data. +type InstanceListResponse_Data struct { + union json.RawMessage } -// DeleteAppsResponsiblesJSONBody defines parameters for DeleteAppsResponsibles. -type DeleteAppsResponsiblesJSONBody struct { - // AppId App record id or app code - AppId string `json:"app_id"` +// InstanceRow A service instance: the state of one service on one node, as reported by +// the agent. Every property is optional: the `props` query parameter selects +// which columns the server returns. The `nodes.` and `services.` properties +// come from joined tables; `nodes.` ones are null when the node row is missing. +type InstanceRow struct { + MonAppstatus *string `json:"mon_appstatus,omitempty"` + MonAvailstatus *string `json:"mon_availstatus,omitempty"` + MonChanged *string `json:"mon_changed,omitempty"` + MonContainerstatus *string `json:"mon_containerstatus,omitempty"` + MonDiskstatus *string `json:"mon_diskstatus,omitempty"` + MonEncapFrozenAt *string `json:"mon_encap_frozen_at,omitempty"` + MonFrozen *string `json:"mon_frozen,omitempty"` + MonFrozenAt *string `json:"mon_frozen_at,omitempty"` + MonFsstatus *string `json:"mon_fsstatus,omitempty"` + MonGuestos *string `json:"mon_guestos,omitempty"` + MonHbstatus *string `json:"mon_hbstatus,omitempty"` + MonIpstatus *string `json:"mon_ipstatus,omitempty"` + MonOverallstatus *string `json:"mon_overallstatus,omitempty"` + MonSharestatus *string `json:"mon_sharestatus,omitempty"` + MonSmonGlobalExpect *string `json:"mon_smon_global_expect,omitempty"` + MonSmonStatus *string `json:"mon_smon_status,omitempty"` + MonSvctype *string `json:"mon_svctype,omitempty"` + MonSyncstatus *string `json:"mon_syncstatus,omitempty"` + MonUpdated *string `json:"mon_updated,omitempty"` + MonVcpus *int `json:"mon_vcpus,omitempty"` + MonVmem *int `json:"mon_vmem,omitempty"` + MonVmname *string `json:"mon_vmname,omitempty"` + MonVmtype *string `json:"mon_vmtype,omitempty"` + NodeId *string `json:"node_id,omitempty"` + NodesNodename *string `json:"nodes.nodename,omitempty"` + NodesOsName *string `json:"nodes.os_name,omitempty"` + ServicesSvcname *string `json:"services.svcname,omitempty"` + SvcId *string `json:"svc_id,omitempty"` +} + +// IpListResponse defines model for IpListResponse. +type IpListResponse struct { + Data IpListResponse_Data `json:"data"` + Meta *ListMeta `json:"meta,omitempty"` +} + +// IpListResponseData0 defines model for . +type IpListResponseData0 = []IpRow + +// IpListResponseData1 defines model for . +type IpListResponseData1 map[string]map[string]int + +// IpListResponse_Data defines model for IpListResponse.Data. +type IpListResponse_Data struct { + union json.RawMessage +} - // GroupId Group record id or group role - GroupId string `json:"group_id"` +// IpRow An IP address detected on a node, joined to the network it belongs to. +// Every property is optional: the `props` query parameter selects which +// columns the server returns. +type IpRow struct { + Addr *string `json:"addr,omitempty"` + FlagDeprecated *int `json:"flag_deprecated,omitempty"` + Id *int `json:"id,omitempty"` + Intf *string `json:"intf,omitempty"` + Mac *string `json:"mac,omitempty"` + Mask *string `json:"mask,omitempty"` + NetBegin *string `json:"net_begin,omitempty"` + NetBroadcast *string `json:"net_broadcast,omitempty"` + NetComment *string `json:"net_comment,omitempty"` + NetEnd *string `json:"net_end,omitempty"` + NetGateway *string `json:"net_gateway,omitempty"` + NetId *int `json:"net_id,omitempty"` + NetName *string `json:"net_name,omitempty"` + NetNetmask *string `json:"net_netmask,omitempty"` + NetNetwork *string `json:"net_network,omitempty"` + NetPrio *int `json:"net_prio,omitempty"` + NetPvid *string `json:"net_pvid,omitempty"` + NetTeamResponsible *string `json:"net_team_responsible,omitempty"` + NodeId *string `json:"node_id,omitempty"` + Nodename *string `json:"nodename,omitempty"` + Type *string `json:"type,omitempty"` + Updated *string `json:"updated,omitempty"` } -// PostAppsResponsiblesJSONBody defines parameters for PostAppsResponsibles. -type PostAppsResponsiblesJSONBody struct { - // AppId App record id or app code - AppId string `json:"app_id"` +// ListMeta defines model for ListMeta. +type ListMeta struct { + AvailableProps *[]string `json:"available_props,omitempty"` + Count *int `json:"count,omitempty"` + Distinct *map[string]int `json:"distinct,omitempty"` + IncludedProps *[]string `json:"included_props,omitempty"` + Limit *int `json:"limit,omitempty"` + Offset *int `json:"offset,omitempty"` - // GroupId Group record id or group role - GroupId string `json:"group_id"` + // Total Number of rows of the list without pagination, the filters applied; for + // a grouped list, the number of groups. With stats, the number of rows the + // statistics are computed from. + Total *int `json:"total,omitempty"` } -// GetArraysParams defines parameters for GetArrays. -type GetArraysParams struct { - // Props A list of properties to include in each data dictionnary. - Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` +// ListResponse defines model for ListResponse. +type ListResponse struct { + Data ListResponse_Data `json:"data"` + Meta *ListMeta `json:"meta,omitempty"` +} - // Limit The maximum number of entries to return. 0 means no limit. - Limit *InQueryLimit `form:"limit,omitempty" json:"limit,omitempty"` +// ListResponseData0 defines model for . +type ListResponseData0 = []map[string]interface{} - // Offset Skip the first entries of the data cursor. - Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` +// ListResponseData1 defines model for . +type ListResponseData1 map[string]map[string]int - // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit the meta field. - Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` +// ListResponse_Data defines model for ListResponse.Data. +type ListResponse_Data struct { + union json.RawMessage +} - // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. - Stats *InQueryStats `form:"stats,omitempty" json:"stats,omitempty"` +// LogListResponse defines model for LogListResponse. +type LogListResponse struct { + Data LogListResponse_Data `json:"data"` + Meta *ListMeta `json:"meta,omitempty"` +} - // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). - Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` +// LogListResponseData0 defines model for . +type LogListResponseData0 = []LogRow - // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). - Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` +// LogListResponseData1 defines model for . +type LogListResponseData1 map[string]map[string]int + +// LogListResponse_Data defines model for LogListResponse.Data. +type LogListResponse_Data struct { + union json.RawMessage } -// PostAuthNodeJSONBody defines parameters for PostAuthNode. -type PostAuthNodeJSONBody struct { - App *string `json:"app,omitempty"` - Nodename string `json:"nodename"` +// LogRow A collector log event. Every property is optional: the `props` query +// parameter selects which columns the server returns. The message is `log_fmt` +// with each `%(key)s` or `%(key)d` placeholder replaced by the matching value of +// `log_dict`, a JSON object serialized as a string. `node_id` and `svc_id` are +// empty strings when the event names no node or service; the `nodes.` and +// `services.` properties come from LEFT JOINs and are then null. +type LogRow struct { + Id *int `json:"id,omitempty"` + LogAction *string `json:"log_action,omitempty"` + LogDate *string `json:"log_date,omitempty"` + LogDict *string `json:"log_dict,omitempty"` + LogEmailSent *int `json:"log_email_sent,omitempty"` + LogEntryId *int `json:"log_entry_id,omitempty"` + LogFmt *string `json:"log_fmt,omitempty"` + LogGtalkSent *int `json:"log_gtalk_sent,omitempty"` + LogLevel *string `json:"log_level,omitempty"` + LogUser *string `json:"log_user,omitempty"` + NodeId *string `json:"node_id,omitempty"` + NodesNodename *string `json:"nodes.nodename,omitempty"` + NodesOsName *string `json:"nodes.os_name,omitempty"` + ServicesSvcname *string `json:"services.svcname,omitempty"` + SvcId *string `json:"svc_id,omitempty"` +} + +// ModulesetListResponse defines model for ModulesetListResponse. +type ModulesetListResponse struct { + Data ModulesetListResponse_Data `json:"data"` + Meta *ListMeta `json:"meta,omitempty"` +} + +// ModulesetListResponseData0 defines model for . +type ModulesetListResponseData0 = []ModulesetRow + +// ModulesetListResponseData1 defines model for . +type ModulesetListResponseData1 map[string]map[string]int + +// ModulesetListResponse_Data defines model for ModulesetListResponse.Data. +type ModulesetListResponse_Data struct { + union json.RawMessage } -// DeleteDisksJSONBody defines parameters for DeleteDisks. -type DeleteDisksJSONBody struct { - // DiskId Disk identifier - DiskId string `json:"disk_id"` +// ModulesetModuleListResponse defines model for ModulesetModuleListResponse. +type ModulesetModuleListResponse struct { + Data ModulesetModuleListResponse_Data `json:"data"` + Meta *ListMeta `json:"meta,omitempty"` } -// GetDisksParams defines parameters for GetDisks. -type GetDisksParams struct { - // Props A list of properties to include in each data dictionnary. - Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` +// ModulesetModuleListResponseData0 defines model for . +type ModulesetModuleListResponseData0 = []ModulesetModuleRow - // Limit The maximum number of entries to return. 0 means no limit. - Limit *InQueryLimit `form:"limit,omitempty" json:"limit,omitempty"` +// ModulesetModuleListResponseData1 defines model for . +type ModulesetModuleListResponseData1 map[string]map[string]int - // Offset Skip the first entries of the data cursor. - Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` - - // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit the meta field. - Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` +// ModulesetModuleListResponse_Data defines model for ModulesetModuleListResponse.Data. +type ModulesetModuleListResponse_Data struct { + union json.RawMessage +} - // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. - Stats *InQueryStats `form:"stats,omitempty" json:"stats,omitempty"` +// ModulesetModuleRow A module of a compliance moduleset. Every property is optional: the `props` +// query parameter selects which columns the server returns. +type ModulesetModuleRow struct { + Autofix *string `json:"autofix,omitempty"` + Id *int `json:"id,omitempty"` + ModsetId *int `json:"modset_id,omitempty"` + ModsetModAuthor *string `json:"modset_mod_author,omitempty"` + ModsetModName *string `json:"modset_mod_name,omitempty"` + ModsetModUpdated *string `json:"modset_mod_updated,omitempty"` +} - // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). - Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` +// ModulesetRow A compliance moduleset. Every property is optional, as selected by `props`. +type ModulesetRow struct { + Id *int `json:"id,omitempty"` + ModsetAuthor *string `json:"modset_author,omitempty"` + ModsetName *string `json:"modset_name,omitempty"` + ModsetUpdated *string `json:"modset_updated,omitempty"` +} - // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). - Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` +// ModulesetsModuleListResponse defines model for ModulesetsModuleListResponse. +type ModulesetsModuleListResponse struct { + Data ModulesetsModuleListResponse_Data `json:"data"` + Meta *ListMeta `json:"meta,omitempty"` } -// PostDisksJSONBody defines parameters for PostDisks. -type PostDisksJSONBody struct { - DiskAlloc *int64 `json:"disk_alloc,omitempty"` - DiskArrayid string `json:"disk_arrayid"` - DiskController *string `json:"disk_controller,omitempty"` - DiskDevid *string `json:"disk_devid,omitempty"` - DiskGroup *string `json:"disk_group,omitempty"` - DiskId string `json:"disk_id"` - DiskLevel *int `json:"disk_level,omitempty"` - DiskName *string `json:"disk_name,omitempty"` - DiskRaid *string `json:"disk_raid,omitempty"` - DiskSize *int64 `json:"disk_size,omitempty"` - DiskUpdated *string `json:"disk_updated,omitempty"` +// ModulesetsModuleListResponseData0 defines model for . +type ModulesetsModuleListResponseData0 = []ModulesetsModuleRow + +// ModulesetsModuleListResponseData1 defines model for . +type ModulesetsModuleListResponseData1 map[string]map[string]int + +// ModulesetsModuleListResponse_Data defines model for ModulesetsModuleListResponse.Data. +type ModulesetsModuleListResponse_Data struct { + union json.RawMessage } -// GetDiskParams defines parameters for GetDisk. -type GetDiskParams struct { - // Props A list of properties to include in each data dictionnary. - Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` +// ModulesetsModuleRow A module of a compliance moduleset, with its moduleset and the moduleset's +// teams. Every property is optional: the `props` query parameter selects which +// columns the server returns. +type ModulesetsModuleRow struct { + // Autofix T when the module is fixed without being asked, F otherwise. + Autofix *string `json:"autofix,omitempty"` - // Limit The maximum number of entries to return. 0 means no limit. - Limit *InQueryLimit `form:"limit,omitempty" json:"limit,omitempty"` + // Id The module id, 0 on the row of a moduleset without module. + Id *int `json:"id,omitempty"` + ModsetAuthor *string `json:"modset_author,omitempty"` + ModsetId *int `json:"modset_id,omitempty"` + ModsetModAuthor *string `json:"modset_mod_author,omitempty"` + ModsetModName *string `json:"modset_mod_name,omitempty"` + ModsetModUpdated *string `json:"modset_mod_updated,omitempty"` + ModsetName *string `json:"modset_name,omitempty"` + ModsetUpdated *string `json:"modset_updated,omitempty"` - // Offset Skip the first entries of the data cursor. - Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` + // TeamsPublication The roles of the groups the moduleset is published to, comma separated. + TeamsPublication *string `json:"teams_publication,omitempty"` - // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit the meta field. - Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` + // TeamsResponsible The roles of the groups responsible for the moduleset, comma separated. + TeamsResponsible *string `json:"teams_responsible,omitempty"` +} - // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. - Stats *InQueryStats `form:"stats,omitempty" json:"stats,omitempty"` +// NetworkListResponse defines model for NetworkListResponse. +type NetworkListResponse struct { + Data []NetworkRow `json:"data"` + Info *string `json:"info,omitempty"` + Meta *ListMeta `json:"meta,omitempty"` +} - // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). - Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` +// NetworkRow A declared network. `begin`, `end` and `broadcast` are computed from +// `network` and `netmask`. +type NetworkRow struct { + Begin *string `json:"begin,omitempty"` + Broadcast *string `json:"broadcast,omitempty"` + Comment *string `json:"comment,omitempty"` + End *string `json:"end,omitempty"` + Gateway *string `json:"gateway,omitempty"` + Id *int `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + Netmask *int `json:"netmask,omitempty"` + Network *string `json:"network,omitempty"` + Prio *int `json:"prio,omitempty"` + Pvid *int `json:"pvid,omitempty"` + TeamResponsible *string `json:"team_responsible,omitempty"` + Updated *string `json:"updated,omitempty"` +} - // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). - Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` +// NetworkSegmentListResponse defines model for NetworkSegmentListResponse. +type NetworkSegmentListResponse struct { + Data []NetworkSegmentRow `json:"data"` + Info *string `json:"info,omitempty"` } -// DeleteFiltersJSONBody defines parameters for DeleteFilters. -type DeleteFiltersJSONBody struct { - // Id Filter record id, or filter label - Id string `json:"id"` +// NetworkSegmentRow An address range of a network, delegated to its responsible groups. +type NetworkSegmentRow struct { + Id *int `json:"id,omitempty"` + NetId *int `json:"net_id,omitempty"` + SegBegin *string `json:"seg_begin,omitempty"` + SegEnd *string `json:"seg_end,omitempty"` + SegType *NetworkSegmentRowSegType `json:"seg_type,omitempty"` } -// GetFiltersParams defines parameters for GetFilters. -type GetFiltersParams struct { - // Props A list of properties to include in each data dictionnary. - Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` +// NetworkSegmentRowSegType defines model for NetworkSegmentRow.SegType. +type NetworkSegmentRowSegType string - // Limit The maximum number of entries to return. 0 means no limit. - Limit *InQueryLimit `form:"limit,omitempty" json:"limit,omitempty"` +// NodeHardwareListResponse defines model for NodeHardwareListResponse. +type NodeHardwareListResponse struct { + Data NodeHardwareListResponse_Data `json:"data"` + Meta *ListMeta `json:"meta,omitempty"` +} - // Offset Skip the first entries of the data cursor. - Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` +// NodeHardwareListResponseData0 defines model for . +type NodeHardwareListResponseData0 = []NodeHardwareRow - // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit the meta field. - Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` +// NodeHardwareListResponseData1 defines model for . +type NodeHardwareListResponseData1 map[string]map[string]int - // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. - Stats *InQueryStats `form:"stats,omitempty" json:"stats,omitempty"` +// NodeHardwareListResponse_Data defines model for NodeHardwareListResponse.Data. +type NodeHardwareListResponse_Data struct { + union json.RawMessage +} - // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). - Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` +// NodeHardwareRow A hardware component of a node, as reported by the agent's asset push: +// `hw_type` is the component family (for example `pci` or `mem`), `hw_path` its +// address. Every property is optional: the `props` query parameter selects which +// columns the server returns. The `nodes.` properties come from the joined nodes +// table, null for a component of an unknown node. +type NodeHardwareRow struct { + HwClass *string `json:"hw_class,omitempty"` + HwDescription *string `json:"hw_description,omitempty"` + HwDriver *string `json:"hw_driver,omitempty"` + HwPath *string `json:"hw_path,omitempty"` + HwType *string `json:"hw_type,omitempty"` + Id *int `json:"id,omitempty"` + NodeId *string `json:"node_id,omitempty"` + NodesApp *string `json:"nodes.app,omitempty"` + NodesNodename *string `json:"nodes.nodename,omitempty"` + NodesOsName *string `json:"nodes.os_name,omitempty"` + Updated *string `json:"updated,omitempty"` +} - // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). - Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` +// NodeListResponse defines model for NodeListResponse. +type NodeListResponse struct { + Data NodeListResponse_Data `json:"data"` + Meta *ListMeta `json:"meta,omitempty"` } -// PostFiltersJSONBody defines parameters for PostFilters. -type PostFiltersJSONBody struct { - // FField Column of f_table the filter applies to - FField string `json:"f_field"` +// NodeListResponseData0 defines model for . +type NodeListResponseData0 = []NodeRow - // FOp Comparison operator - FOp PostFiltersJSONBodyFOp `json:"f_op"` +// NodeListResponseData1 defines model for . +type NodeListResponseData1 map[string]map[string]int - // FTable Table the filter applies to - FTable string `json:"f_table"` +// NodeListResponse_Data defines model for NodeListResponse.Data. +type NodeListResponse_Data struct { + union json.RawMessage +} - // FValue Value to compare the column to - FValue string `json:"f_value"` +// NodeRow A node row of the nodes list. Every property is optional: the `props` +// query parameter selects which columns the server returns, so a row +// carries only the requested subset. +type NodeRow struct { + ActionType *string `json:"action_type,omitempty"` + App *string `json:"app,omitempty"` + AssetEnv *string `json:"asset_env,omitempty"` + Assetname *string `json:"assetname,omitempty"` + BiosVersion *string `json:"bios_version,omitempty"` + BladeCabinet *string `json:"blade_cabinet,omitempty"` + ClusterId *string `json:"cluster_id,omitempty"` + + // ClustersClusterName Name of the node's cluster, from the joined clusters table. + ClustersClusterName *string `json:"clusters.cluster_name,omitempty"` + Collector *string `json:"collector,omitempty"` + ConnectTo *string `json:"connect_to,omitempty"` + CpuCores *int `json:"cpu_cores,omitempty"` + CpuDies *int `json:"cpu_dies,omitempty"` + CpuFreq *string `json:"cpu_freq,omitempty"` + CpuModel *string `json:"cpu_model,omitempty"` + CpuThreads *int `json:"cpu_threads,omitempty"` + CpuVendor *string `json:"cpu_vendor,omitempty"` + Enclosure *string `json:"enclosure,omitempty"` + Enclosureslot *string `json:"enclosureslot,omitempty"` + Fqdn *string `json:"fqdn,omitempty"` + Hv *string `json:"hv,omitempty"` + Hvpool *string `json:"hvpool,omitempty"` + Hvvdc *string `json:"hvvdc,omitempty"` + HwObsAlertDate *string `json:"hw_obs_alert_date,omitempty"` + HwObsWarnDate *string `json:"hw_obs_warn_date,omitempty"` + LastBoot *string `json:"last_boot,omitempty"` + LastComm *string `json:"last_comm,omitempty"` + ListenerPort *int `json:"listener_port,omitempty"` + LocAddr *string `json:"loc_addr,omitempty"` + LocBuilding *string `json:"loc_building,omitempty"` + LocCity *string `json:"loc_city,omitempty"` + LocCountry *string `json:"loc_country,omitempty"` + LocFloor *string `json:"loc_floor,omitempty"` + LocRack *string `json:"loc_rack,omitempty"` + LocRoom *string `json:"loc_room,omitempty"` + LocZip *string `json:"loc_zip,omitempty"` + MaintenanceEnd *string `json:"maintenance_end,omitempty"` + Manufacturer *string `json:"manufacturer,omitempty"` + MemBanks *int `json:"mem_banks,omitempty"` + MemBytes *int `json:"mem_bytes,omitempty"` + MemSlots *int `json:"mem_slots,omitempty"` + Model *string `json:"model,omitempty"` + NodeEnv *string `json:"node_env,omitempty"` + NodeFrozen *string `json:"node_frozen,omitempty"` + NodeFrozenAt *string `json:"node_frozen_at,omitempty"` + NodeId *string `json:"node_id,omitempty"` + Nodename *string `json:"nodename,omitempty"` + Notifications *string `json:"notifications,omitempty"` + OsArch *string `json:"os_arch,omitempty"` + OsConcat *string `json:"os_concat,omitempty"` + OsKernel *string `json:"os_kernel,omitempty"` + OsName *string `json:"os_name,omitempty"` + OsObsAlertDate *string `json:"os_obs_alert_date,omitempty"` + OsObsWarnDate *string `json:"os_obs_warn_date,omitempty"` + OsRelease *string `json:"os_release,omitempty"` + OsSegment *string `json:"os_segment,omitempty"` + OsUpdate *string `json:"os_update,omitempty"` + OsVendor *string `json:"os_vendor,omitempty"` + PowerBreaker1 *string `json:"power_breaker1,omitempty"` + PowerBreaker2 *string `json:"power_breaker2,omitempty"` + PowerCabinet1 *string `json:"power_cabinet1,omitempty"` + PowerCabinet2 *string `json:"power_cabinet2,omitempty"` + PowerProtect *string `json:"power_protect,omitempty"` + PowerProtectBreaker *string `json:"power_protect_breaker,omitempty"` + PowerSupplyNb *int `json:"power_supply_nb,omitempty"` + Role *string `json:"role,omitempty"` + SecZone *string `json:"sec_zone,omitempty"` + Serial *string `json:"serial,omitempty"` + SnoozeTill *string `json:"snooze_till,omitempty"` + SpVersion *string `json:"sp_version,omitempty"` + Status *string `json:"status,omitempty"` + TeamInteg *string `json:"team_integ,omitempty"` + TeamResponsible *string `json:"team_responsible,omitempty"` + TeamSupport *string `json:"team_support,omitempty"` + Type *string `json:"type,omitempty"` + Tz *string `json:"tz,omitempty"` + Updated *string `json:"updated,omitempty"` + Version *string `json:"version,omitempty"` + WarrantyEnd *string `json:"warranty_end,omitempty"` +} + +// ObsolescenceSettingListResponse defines model for ObsolescenceSettingListResponse. +type ObsolescenceSettingListResponse struct { + Data ObsolescenceSettingListResponse_Data `json:"data"` + Meta *ListMeta `json:"meta,omitempty"` +} + +// ObsolescenceSettingListResponseData0 defines model for . +type ObsolescenceSettingListResponseData0 = []ObsolescenceSettingRow + +// ObsolescenceSettingListResponseData1 defines model for . +type ObsolescenceSettingListResponseData1 map[string]map[string]int + +// ObsolescenceSettingListResponse_Data defines model for ObsolescenceSettingListResponse.Data. +type ObsolescenceSettingListResponse_Data struct { + union json.RawMessage } -// PostFiltersJSONBodyFOp defines parameters for PostFilters. -type PostFiltersJSONBodyFOp string +// ObsolescenceSettingRow An obsolescence setting: the warning and alert dates applied to the nodes +// running a hardware model (`obs_type` "hw") or an OS release (`obs_type` "os"). +// Every property is optional: the `props` query parameter selects which columns +// the server returns. Unset dates are returned as empty strings. `obs_count` is +// the number of nodes the setting applies to; hardware models whose name contains +// "virt" or "cluster" are not counted. +type ObsolescenceSettingRow struct { + Id *int `json:"id,omitempty"` + ObsAlertDate *string `json:"obs_alert_date,omitempty"` + ObsAlertDateUpdated *string `json:"obs_alert_date_updated,omitempty"` + ObsAlertDateUpdatedBy *string `json:"obs_alert_date_updated_by,omitempty"` + ObsCount *int `json:"obs_count,omitempty"` + ObsName *string `json:"obs_name,omitempty"` + ObsType *ObsolescenceSettingRowObsType `json:"obs_type,omitempty"` + ObsWarnDate *string `json:"obs_warn_date,omitempty"` + ObsWarnDateUpdated *string `json:"obs_warn_date_updated,omitempty"` + ObsWarnDateUpdatedBy *string `json:"obs_warn_date_updated_by,omitempty"` +} -// GetFilterParams defines parameters for GetFilter. -type GetFilterParams struct { - // Props A list of properties to include in each data dictionnary. - Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` +// ObsolescenceSettingRowObsType defines model for ObsolescenceSettingRow.ObsType. +type ObsolescenceSettingRowObsType string - // Limit The maximum number of entries to return. 0 means no limit. - Limit *InQueryLimit `form:"limit,omitempty" json:"limit,omitempty"` +// PackageDiffNode defines model for PackageDiffNode. +type PackageDiffNode struct { + NodeId string `json:"node_id"` + Nodename string `json:"nodename"` +} - // Offset Skip the first entries of the data cursor. - Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` +// PackageDiffRow A package version installed on a compared node, and missing from at least one other. +type PackageDiffRow struct { + NodeId string `json:"node_id"` + PkgArch string `json:"pkg_arch"` + PkgName string `json:"pkg_name"` + PkgType string `json:"pkg_type"` + PkgVersion string `json:"pkg_version"` +} - // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit the meta field. - Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` +// PackageListResponse defines model for PackageListResponse. +type PackageListResponse struct { + Data PackageListResponse_Data `json:"data"` + Meta *ListMeta `json:"meta,omitempty"` +} - // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. - Stats *InQueryStats `form:"stats,omitempty" json:"stats,omitempty"` +// PackageListResponseData0 defines model for . +type PackageListResponseData0 = []PackageRow - // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). - Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` +// PackageListResponseData1 defines model for . +type PackageListResponseData1 map[string]map[string]int - // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). - Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` +// PackageListResponse_Data defines model for PackageListResponse.Data. +type PackageListResponse_Data struct { + union json.RawMessage } -// PostFilterJSONBody defines parameters for PostFilter. -type PostFilterJSONBody struct { - FField *string `json:"f_field,omitempty"` - FLabel *string `json:"f_label,omitempty"` - FOp *string `json:"f_op,omitempty"` - FTable *string `json:"f_table,omitempty"` - FValue *string `json:"f_value,omitempty"` +// PackageRow A package installed on a node, as the agent reports it. Every property is +// optional: the `props` query parameter selects which columns the server +// returns. `sig_provider` names the provider of the signing key and is empty +// when the signature is unknown. The `nodes.` properties come from the joined +// nodes table. +type PackageRow struct { + Id *int `json:"id,omitempty"` + NodeId *string `json:"node_id,omitempty"` + NodesApp *string `json:"nodes.app,omitempty"` + NodesNodename *string `json:"nodes.nodename,omitempty"` + NodesOsName *string `json:"nodes.os_name,omitempty"` + PkgArch *string `json:"pkg_arch,omitempty"` + PkgInstallDate *string `json:"pkg_install_date,omitempty"` + PkgName *string `json:"pkg_name,omitempty"` + PkgSig *string `json:"pkg_sig,omitempty"` + PkgType *string `json:"pkg_type,omitempty"` + PkgUpdated *string `json:"pkg_updated,omitempty"` + PkgVersion *string `json:"pkg_version,omitempty"` + SigProvider *string `json:"sig_provider,omitempty"` +} + +// PackagesDiffResponse defines model for PackagesDiffResponse. +type PackagesDiffResponse struct { + Data []PackageDiffRow `json:"data"` + Meta struct { + // NodeIds The ids of the compared nodes, as the historical API returns them. + NodeIds []string `json:"node_ids"` + + // Nodes The compared nodes with their names, ordered by name. + Nodes []PackageDiffNode `json:"nodes"` + } `json:"meta"` } -// DeleteFiltersetsJSONBody defines parameters for DeleteFiltersets. -type DeleteFiltersetsJSONBody struct { - // Id Filterset record id, or filterset name - Id string `json:"id"` +// Problem defines model for Problem. +type Problem struct { + // Text A human-readable explanation specific to this occurrence of the + // problem. + Text string `json:"text"` } -// GetFiltersetsParams defines parameters for GetFiltersets. -type GetFiltersetsParams struct { - // Props A list of properties to include in each data dictionnary. - Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` +// RulesetListResponse defines model for RulesetListResponse. +type RulesetListResponse struct { + Data RulesetListResponse_Data `json:"data"` + Meta *ListMeta `json:"meta,omitempty"` +} - // Limit The maximum number of entries to return. 0 means no limit. - Limit *InQueryLimit `form:"limit,omitempty" json:"limit,omitempty"` +// RulesetListResponseData0 defines model for . +type RulesetListResponseData0 = []RulesetRow - // Offset Skip the first entries of the data cursor. - Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` +// RulesetListResponseData1 defines model for . +type RulesetListResponseData1 map[string]map[string]int - // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit the meta field. - Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` +// RulesetListResponse_Data defines model for RulesetListResponse.Data. +type RulesetListResponse_Data struct { + union json.RawMessage +} - // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. - Stats *InQueryStats `form:"stats,omitempty" json:"stats,omitempty"` +// RulesetRow A compliance ruleset. Every property is optional, as selected by `props`. +type RulesetRow struct { + Id *int `json:"id,omitempty"` + RulesetName *string `json:"ruleset_name,omitempty"` + RulesetPublic *string `json:"ruleset_public,omitempty"` + RulesetType *string `json:"ruleset_type,omitempty"` +} - // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). - Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` +// RulesetUsage What uses a ruleset. +type RulesetUsage struct { + Modulesets *[]struct { + Id *int `json:"id,omitempty"` + ModsetName *string `json:"modset_name,omitempty"` + } `json:"modulesets,omitempty"` + Nodes *[]struct { + NodeId *string `json:"node_id,omitempty"` + Nodename *string `json:"nodename,omitempty"` + } `json:"nodes,omitempty"` - // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). - Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` + // Rulesets The rulesets holding this one as a child. + Rulesets *[]struct { + Id *int `json:"id,omitempty"` + RulesetName *string `json:"ruleset_name,omitempty"` + } `json:"rulesets,omitempty"` + Services *[]struct { + SvcId *string `json:"svc_id,omitempty"` + Svcname *string `json:"svcname,omitempty"` + } `json:"services,omitempty"` } -// PostFiltersetsJSONBody defines parameters for PostFiltersets. -type PostFiltersetsJSONBody struct { - // FsetName Name of the filterset to create, or of the filterset to update - FsetName *string `json:"fset_name,omitempty"` +// RulesetVariableListResponse defines model for RulesetVariableListResponse. +type RulesetVariableListResponse struct { + Data RulesetVariableListResponse_Data `json:"data"` + Meta *ListMeta `json:"meta,omitempty"` +} - // FsetStats Whether the filterset is a stats filterset (T or F) - FsetStats *string `json:"fset_stats,omitempty"` +// RulesetVariableListResponseData0 defines model for . +type RulesetVariableListResponseData0 = []RulesetVariableRow - // Id Filterset record id or name, to update an existing filterset - Id *string `json:"id,omitempty"` +// RulesetVariableListResponseData1 defines model for . +type RulesetVariableListResponseData1 map[string]map[string]int + +// RulesetVariableListResponse_Data defines model for RulesetVariableListResponse.Data. +type RulesetVariableListResponse_Data struct { + union json.RawMessage } -// GetFiltersetParams defines parameters for GetFilterset. -type GetFiltersetParams struct { - // Props A list of properties to include in each data dictionnary. - Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` +// RulesetVariableRow A variable of a compliance ruleset. Every property is optional: the `props` +// query parameter selects which columns the server returns. +type RulesetVariableRow struct { + Id *int `json:"id,omitempty"` + RulesetId *int `json:"ruleset_id,omitempty"` + VarAuthor *string `json:"var_author,omitempty"` + VarClass *string `json:"var_class,omitempty"` + VarName *string `json:"var_name,omitempty"` + VarUpdated *string `json:"var_updated,omitempty"` + VarValue *string `json:"var_value,omitempty"` +} - // Limit The maximum number of entries to return. 0 means no limit. - Limit *InQueryLimit `form:"limit,omitempty" json:"limit,omitempty"` +// RulesetsVariableListResponse defines model for RulesetsVariableListResponse. +type RulesetsVariableListResponse struct { + Data RulesetsVariableListResponse_Data `json:"data"` + Meta *ListMeta `json:"meta,omitempty"` +} - // Offset Skip the first entries of the data cursor. - Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` +// RulesetsVariableListResponseData0 defines model for . +type RulesetsVariableListResponseData0 = []RulesetsVariableRow - // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit the meta field. - Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` +// RulesetsVariableListResponseData1 defines model for . +type RulesetsVariableListResponseData1 map[string]map[string]int - // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. - Stats *InQueryStats `form:"stats,omitempty" json:"stats,omitempty"` +// RulesetsVariableListResponse_Data defines model for RulesetsVariableListResponse.Data. +type RulesetsVariableListResponse_Data struct { + union json.RawMessage +} - // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). - Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` +// RulesetsVariableRow A variable of a compliance ruleset, own or encapsulated, with its ruleset and +// the ruleset's filterset and teams. Every property is optional: the `props` +// query parameter selects which columns the server returns. +type RulesetsVariableRow struct { + // Chain The path from the ruleset to the encapsulated one, as "a > b > c", empty for its own variables. + Chain *string `json:"chain,omitempty"` - // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). - Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` -} + // ChainLen The number of rulesets in the chain, 1 for its own variables. + ChainLen *int `json:"chain_len,omitempty"` -// PostFiltersetJSONBody defines parameters for PostFilterset. -type PostFiltersetJSONBody struct { - FsetName *string `json:"fset_name,omitempty"` - FsetStats *string `json:"fset_stats,omitempty"` -} + // EncapRset The encapsulated ruleset holding the variable, empty for its own variables. + EncapRset *string `json:"encap_rset,omitempty"` -// GetFiltersetFiltersParams defines parameters for GetFiltersetFilters. -type GetFiltersetFiltersParams struct { - // Props A list of properties to include in each data dictionnary. - Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` + // EncapRsetId The id of encap_rset, 0 for its own variables. + EncapRsetId *int `json:"encap_rset_id,omitempty"` + FsetId *int `json:"fset_id,omitempty"` - // Limit The maximum number of entries to return. 0 means no limit. - Limit *InQueryLimit `form:"limit,omitempty" json:"limit,omitempty"` + // FsetName The filterset of a contextual ruleset. + FsetName *string `json:"fset_name,omitempty"` - // Offset Skip the first entries of the data cursor. - Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` + // Id The variable id, 0 on the row of a ruleset without variable. + Id *int `json:"id,omitempty"` + RulesetId *int `json:"ruleset_id,omitempty"` + RulesetName *string `json:"ruleset_name,omitempty"` - // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit the meta field. - Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` + // RulesetPublic T when the ruleset is public, F otherwise. + RulesetPublic *string `json:"ruleset_public,omitempty"` - // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. - Stats *InQueryStats `form:"stats,omitempty" json:"stats,omitempty"` + // RulesetType explicit or contextual. + RulesetType *string `json:"ruleset_type,omitempty"` - // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). - Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` + // TeamsPublication The roles of the groups the ruleset is published to, comma separated. + TeamsPublication *string `json:"teams_publication,omitempty"` - // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). - Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` + // TeamsResponsible The roles of the groups responsible for the ruleset, comma separated. + TeamsResponsible *string `json:"teams_responsible,omitempty"` + VarAuthor *string `json:"var_author,omitempty"` + VarClass *string `json:"var_class,omitempty"` + VarName *string `json:"var_name,omitempty"` + VarUpdated *string `json:"var_updated,omitempty"` + VarValue *string `json:"var_value,omitempty"` } -// PostFiltersetFilterJSONBody defines parameters for PostFiltersetFilter. -type PostFiltersetFilterJSONBody struct { - FLogOp *string `json:"f_log_op,omitempty"` - FOrder *int `json:"f_order,omitempty"` -} +// SearchGroup The objects of one kind matching a search. +type SearchGroup struct { + // Error Set when the kind could not be searched. + Error *string `json:"error,omitempty"` -// GetFiltersetFiltersetsParams defines parameters for GetFiltersetFiltersets. -type GetFiltersetFiltersetsParams struct { - // Props A list of properties to include in each data dictionnary. - Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` + // Items One entry per object, with the props of its kind: node_id, nodename, app, + // node_env, cluster_id, fqdn, os_name for a node; svc_id, svcname, svc_app, + // svc_env, cluster_id, svc_availstatus, svc_topology for a service; svc_id, + // node_id, mon_vmname, mon_availstatus, services.svcname, nodes.nodename for + // an instance; id, app, app_domain, description for an application; id, addr, + // mask, intf, node_id, nodename, net_name for a node address; disk_id, + // disk_name, disk_size, disk_arrayid, nodename, svcname for a disk; tag_id, + // tag_name, tag_exclude for a tag; id, email, first_name, last_name, username + // for a user; id, role, privilege, description for a team; id, form_name, + // last_form_name, status, creator, last_update for a request; id, + // modset_name, modset_author for a moduleset; id, ruleset_name, ruleset_type, + // ruleset_public for a ruleset; id, fset_name, fset_author for a filterset; + // id, form_name, form_type, form_folder for a form. + Items []map[string]interface{} `json:"items"` + Kind SearchGroupKind `json:"kind"` - // Limit The maximum number of entries to return. 0 means no limit. - Limit *InQueryLimit `form:"limit,omitempty" json:"limit,omitempty"` + // More Other objects of the kind match beyond those returned. + More bool `json:"more"` +} - // Offset Skip the first entries of the data cursor. - Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` +// SearchGroupKind defines model for SearchGroup.Kind. +type SearchGroupKind string - // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit the meta field. - Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` +// SearchResponse defines model for SearchResponse. +type SearchResponse struct { + Data []SearchGroup `json:"data"` +} - // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. - Stats *InQueryStats `form:"stats,omitempty" json:"stats,omitempty"` +// ServiceListResponse defines model for ServiceListResponse. +type ServiceListResponse struct { + Data ServiceListResponse_Data `json:"data"` + Meta *ListMeta `json:"meta,omitempty"` +} - // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). - Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` +// ServiceListResponseData0 defines model for . +type ServiceListResponseData0 = []ServiceRow - // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). - Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` +// ServiceListResponseData1 defines model for . +type ServiceListResponseData1 map[string]map[string]int + +// ServiceListResponse_Data defines model for ServiceListResponse.Data. +type ServiceListResponse_Data struct { + union json.RawMessage } -// PostFiltersetFiltersetJSONBody defines parameters for PostFiltersetFilterset. -type PostFiltersetFiltersetJSONBody struct { - FLogOp *string `json:"f_log_op,omitempty"` - FOrder *int `json:"f_order,omitempty"` +// ServiceRow A service row of the services list. Every property is optional: the `props` +// query parameter selects which columns the server returns, so a row +// carries only the requested subset. +type ServiceRow struct { + ClusterId *string `json:"cluster_id,omitempty"` + Id *int `json:"id,omitempty"` + SvcApp *string `json:"svc_app,omitempty"` + SvcAutostart *string `json:"svc_autostart,omitempty"` + SvcAvailstatus *string `json:"svc_availstatus,omitempty"` + SvcComment *string `json:"svc_comment,omitempty"` + SvcConfig *string `json:"svc_config,omitempty"` + SvcConfigUpdated *string `json:"svc_config_updated,omitempty"` + SvcCreated *string `json:"svc_created,omitempty"` + SvcDrnoaction *string `json:"svc_drnoaction,omitempty"` + SvcDrpnode *string `json:"svc_drpnode,omitempty"` + SvcDrpnodes *string `json:"svc_drpnodes,omitempty"` + SvcDrptype *string `json:"svc_drptype,omitempty"` + SvcEnv *string `json:"svc_env,omitempty"` + SvcFlexCpuHighThreshold *int `json:"svc_flex_cpu_high_threshold,omitempty"` + SvcFlexCpuLowThreshold *int `json:"svc_flex_cpu_low_threshold,omitempty"` + SvcFlexMaxNodes *int `json:"svc_flex_max_nodes,omitempty"` + SvcFlexMinNodes *int `json:"svc_flex_min_nodes,omitempty"` + SvcFlexTarget *int `json:"svc_flex_target,omitempty"` + SvcFrozen *string `json:"svc_frozen,omitempty"` + SvcHa *int `json:"svc_ha,omitempty"` + SvcHostid *string `json:"svc_hostid,omitempty"` + SvcId *string `json:"svc_id,omitempty"` + SvcMetrocluster *string `json:"svc_metrocluster,omitempty"` + SvcNodes *string `json:"svc_nodes,omitempty"` + SvcNotifications *string `json:"svc_notifications,omitempty"` + SvcPlacement *string `json:"svc_placement,omitempty"` + SvcProvisioned *string `json:"svc_provisioned,omitempty"` + SvcSnoozeTill *string `json:"svc_snooze_till,omitempty"` + SvcStatus *string `json:"svc_status,omitempty"` + SvcStatusUpdated *string `json:"svc_status_updated,omitempty"` + SvcTopology *string `json:"svc_topology,omitempty"` + SvcWave *int `json:"svc_wave,omitempty"` + Svcname *string `json:"svcname,omitempty"` + Updated *string `json:"updated,omitempty"` } -// GetFiltersetNodesParams defines parameters for GetFiltersetNodes. -type GetFiltersetNodesParams struct { - // Props A list of properties to include in each data dictionnary. - Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` +// UserListResponse defines model for UserListResponse. +type UserListResponse struct { + Data UserListResponse_Data `json:"data"` + Meta *ListMeta `json:"meta,omitempty"` +} - // Limit The maximum number of entries to return. 0 means no limit. - Limit *InQueryLimit `form:"limit,omitempty" json:"limit,omitempty"` +// UserListResponseData0 defines model for . +type UserListResponseData0 = []UserRow - // Offset Skip the first entries of the data cursor. - Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` +// UserListResponseData1 defines model for . +type UserListResponseData1 map[string]map[string]int - // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit the meta field. - Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` +// UserListResponse_Data defines model for UserListResponse.Data. +type UserListResponse_Data struct { + union json.RawMessage +} - // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. - Stats *InQueryStats `form:"stats,omitempty" json:"stats,omitempty"` +// UserPrefsResponse The stored preferences, as saved by POST /users/{user_id}/prefs. The +// collector never interprets the content; an empty object means "no +// preferences stored", "user unknown" or "user not visible" alike. +type UserPrefsResponse struct { + Data map[string]interface{} `json:"data"` +} + +// UserRow A user of the users list. `password` and `registration_key` are never +// returned. The boolean-like columns (`email_notifications`, +// `im_notifications`, `lock_filter`) carry the collector's "T"/"F" +// convention, and the delay and quota columns are returned as strings. +// Every property is optional: the `props` query parameter selects which +// columns the server returns. +type UserRow struct { + Email *string `json:"email,omitempty"` + EmailLogLevel *string `json:"email_log_level,omitempty"` + EmailNotifications *string `json:"email_notifications,omitempty"` + EmailNotificationsDelay *string `json:"email_notifications_delay,omitempty"` + FirstName *string `json:"first_name,omitempty"` + Id *int `json:"id,omitempty"` + ImLogLevel *string `json:"im_log_level,omitempty"` + ImNotifications *string `json:"im_notifications,omitempty"` + ImNotificationsDelay *string `json:"im_notifications_delay,omitempty"` + ImType *string `json:"im_type,omitempty"` + ImUsername *string `json:"im_username,omitempty"` + LastName *string `json:"last_name,omitempty"` + LockFilter *string `json:"lock_filter,omitempty"` + PhoneWork *string `json:"phone_work,omitempty"` + QuotaApp *string `json:"quota_app,omitempty"` + QuotaDockerRegistries *string `json:"quota_docker_registries,omitempty"` + QuotaOrgGroup *string `json:"quota_org_group,omitempty"` + RegistrationId *string `json:"registration_id,omitempty"` + ResetPasswordKey *string `json:"reset_password_key,omitempty"` + Username *string `json:"username,omitempty"` +} + +// WorkflowListResponse defines model for WorkflowListResponse. +type WorkflowListResponse struct { + Data WorkflowListResponse_Data `json:"data"` + Meta *ListMeta `json:"meta,omitempty"` +} + +// WorkflowListResponseData0 defines model for . +type WorkflowListResponseData0 = []WorkflowRow + +// WorkflowListResponseData1 defines model for . +type WorkflowListResponseData1 map[string]map[string]int + +// WorkflowListResponse_Data defines model for WorkflowListResponse.Data. +type WorkflowListResponse_Data struct { + union json.RawMessage +} - // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). - Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` +// WorkflowRow A request: the workflow started by the submission of a form with a workflow +// output. `form_head_id` is the stored submission that started it, +// `last_form_id` and `last_form_name` its latest step; `status` is `pending` +// while a next step awaits `last_assignee`, `closed` otherwise. Every property +// is optional: the `props` query parameter selects which columns the server +// returns. `form_name`, `form_folder` and `form_yaml` come from the joined form +// revision and are null when it is missing. +type WorkflowRow struct { + CreateDate *string `json:"create_date,omitempty"` + Creator *string `json:"creator,omitempty"` + FormFolder *string `json:"form_folder,omitempty"` + FormHeadId *int `json:"form_head_id,omitempty"` + FormMd5 *string `json:"form_md5,omitempty"` + FormName *string `json:"form_name,omitempty"` + FormYaml *string `json:"form_yaml,omitempty"` + Id *int `json:"id,omitempty"` + LastAssignee *string `json:"last_assignee,omitempty"` + LastFormId *int `json:"last_form_id,omitempty"` + LastFormName *string `json:"last_form_name,omitempty"` + LastUpdate *string `json:"last_update,omitempty"` + Status *string `json:"status,omitempty"` + Steps *int `json:"steps,omitempty"` +} - // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). - Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` +// Version defines model for version. +type Version struct { + Version string `json:"version"` } -// GetFiltersetServicesParams defines parameters for GetFiltersetServices. -type GetFiltersetServicesParams struct { - // Props A list of properties to include in each data dictionnary. - Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` +// InPathMsetId defines model for inPathMsetId. +type InPathMsetId = string - // Limit The maximum number of entries to return. 0 means no limit. - Limit *InQueryLimit `form:"limit,omitempty" json:"limit,omitempty"` +// InPathNodeId defines model for inPathNodeId. +type InPathNodeId = string - // Offset Skip the first entries of the data cursor. - Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` +// InPathRsetId defines model for inPathRsetId. +type InPathRsetId = string - // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit the meta field. - Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` +// InQueryFilter defines model for inQueryFilter. +type InQueryFilter = []string - // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. - Stats *InQueryStats `form:"stats,omitempty" json:"stats,omitempty"` +// InQueryGroupby defines model for inQueryGroupby. +type InQueryGroupby = string - // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). - Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` +// InQueryLimit defines model for inQueryLimit. +type InQueryLimit = int - // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). - Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` -} +// InQueryMeta defines model for inQueryMeta. +type InQueryMeta = string -// DeleteFiltersetsFiltersJSONBody defines parameters for DeleteFiltersetsFilters. -type DeleteFiltersetsFiltersJSONBody struct { - // FId Filter record id, or filter label - FId string `json:"f_id"` +// InQueryOffset defines model for inQueryOffset. +type InQueryOffset = int - // FsetId Filterset record id, or filterset name - FsetId string `json:"fset_id"` -} +// InQueryOrderby defines model for inQueryOrderby. +type InQueryOrderby = string -// PostFiltersetsFiltersJSONBody defines parameters for PostFiltersetsFilters. -type PostFiltersetsFiltersJSONBody struct { - // FId Filter record id, or filter label - FId string `json:"f_id"` +// InQueryProps defines model for inQueryProps. +type InQueryProps = string - // FLogOp Logical operator joining this filter to the previous one - FLogOp *string `json:"f_log_op,omitempty"` +// InQueryStats defines model for inQueryStats. +type InQueryStats = string - // FOrder Position of the filter in the filterset - FOrder *int `json:"f_order,omitempty"` +// N400 defines model for 400. +type N400 = Problem - // FsetId Filterset record id, or filterset name - FsetId string `json:"fset_id"` -} +// N401 defines model for 401. +type N401 = Problem -// DeleteFiltersetsFiltersetsJSONBody defines parameters for DeleteFiltersetsFiltersets. -type DeleteFiltersetsFiltersetsJSONBody struct { - // ChildFsetId Child filterset record id, or name - ChildFsetId string `json:"child_fset_id"` +// N403 defines model for 403. +type N403 = Problem - // ParentFsetId Parent filterset record id, or name - ParentFsetId string `json:"parent_fset_id"` -} +// N404 defines model for 404. +type N404 = Problem -// PostFiltersetsFiltersetsJSONBody defines parameters for PostFiltersetsFiltersets. -type PostFiltersetsFiltersetsJSONBody struct { - // ChildFsetId Child filterset record id, or name - ChildFsetId string `json:"child_fset_id"` +// N409 defines model for 409. +type N409 = Problem - // FLogOp Logical operator joining this filterset to the previous entry - FLogOp *string `json:"f_log_op,omitempty"` +// N500 defines model for 500. +type N500 = Problem - // FOrder Position of the child filterset in the parent filterset - FOrder *int `json:"f_order,omitempty"` +// basicAuthContextKey is the context key for basicAuth security scheme +type basicAuthContextKey string - // ParentFsetId Parent filterset record id, or name - ParentFsetId string `json:"parent_fset_id"` -} +// bearerAuthContextKey is the context key for bearerAuth security scheme +type bearerAuthContextKey string -// GetFrontendHiddenMenuEntriesParams defines parameters for GetFrontendHiddenMenuEntries. -type GetFrontendHiddenMenuEntriesParams struct { +// GetActionsParams defines parameters for GetActions. +type GetActionsParams struct { // Props A list of properties to include in each data dictionnary. Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` @@ -919,7 +1930,10 @@ type GetFrontendHiddenMenuEntriesParams struct { // Offset Skip the first entries of the data cursor. Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` - // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit the meta field. + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. @@ -928,21 +1942,42 @@ type GetFrontendHiddenMenuEntriesParams struct { // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` + // Filter Column filter, repeatable; several filters combine with AND. Each value is + // `prop:expr`, `prop` being a property of the list (joined ones included, as + // for orderby) and `expr` one of: + // - text: case-insensitive match anywhere in the value; + // - `~regex`: regular expression (RE2 syntax), case-insensitive; + // - `in:a,b,c`: one of the listed values; + // - `eq:v`, `ne:v`: equal, not equal; + // - `gt:v`, `gte:v`, `lt:v`, `lte:v`: comparisons, for numbers and dates; + // - `empty`, `!empty`: no value, any value. + // An unknown property, a property without a column, or an invalid regular + // expression is answered with 400. + Filter *InQueryFilter `form:"filter,omitempty" json:"filter,omitempty"` + // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` } -// DeleteGroupsJSONBody defines parameters for DeleteGroups. -type DeleteGroupsJSONBody struct { - // Id Group record id - Id *string `json:"id,omitempty"` +// PostActionsJSONBody defines parameters for PostActions. +type PostActionsJSONBody struct { + // Id Action queue entry id + Id string `json:"id"` - // Role Group role/name - Role *string `json:"role,omitempty"` + // Status New status (the only updatable property) + Status *string `json:"status,omitempty"` } -// GetGroupsParams defines parameters for GetGroups. -type GetGroupsParams struct { +// PutActionsJSONBody defines parameters for PutActions. +type PutActionsJSONBody struct { + union json.RawMessage +} + +// PutActionsJSONBody1 defines parameters for PutActions. +type PutActionsJSONBody1 = []ActionEnqueue + +// GetActionParams defines parameters for GetAction. +type GetActionParams struct { // Props A list of properties to include in each data dictionnary. Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` @@ -952,7 +1987,10 @@ type GetGroupsParams struct { // Offset Skip the first entries of the data cursor. Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` - // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit the meta field. + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. @@ -965,22 +2003,8 @@ type GetGroupsParams struct { Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` } -// PostGroupsJSONBody defines parameters for PostGroups. -type PostGroupsJSONBody struct { - Description *string `json:"description,omitempty"` - - // Id Existing group id (selects update instead of create) - Id *string `json:"id,omitempty"` - - // Privilege 'T' for a privilege group, 'F' otherwise - Privilege *string `json:"privilege,omitempty"` - - // Role Group role/name - Role *string `json:"role,omitempty"` -} - -// GetGroupParams defines parameters for GetGroup. -type GetGroupParams struct { +// GetAlertEventParams defines parameters for GetAlertEvent. +type GetAlertEventParams struct { // Props A list of properties to include in each data dictionnary. Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` @@ -990,7 +2014,10 @@ type GetGroupParams struct { // Offset Skip the first entries of the data cursor. Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` - // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit the meta field. + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. @@ -1003,17 +2030,18 @@ type GetGroupParams struct { Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` } -// PostGroupJSONBody defines parameters for PostGroup. -type PostGroupJSONBody struct { - Description *string `json:"description,omitempty"` - - // Privilege 'T' for a privilege group, 'F' otherwise - Privilege *string `json:"privilege,omitempty"` - Role *string `json:"role,omitempty"` +// DeleteAlertsJSONBody defines parameters for DeleteAlerts. +type DeleteAlertsJSONBody struct { + DashInstance *string `json:"dash_instance,omitempty"` + DashSeverity *int `json:"dash_severity,omitempty"` + DashType *string `json:"dash_type,omitempty"` + Id *string `json:"id,omitempty"` + NodeId *string `json:"node_id,omitempty"` + SvcId *string `json:"svc_id,omitempty"` } -// GetGroupAppsParams defines parameters for GetGroupApps. -type GetGroupAppsParams struct { +// GetAlertsParams defines parameters for GetAlerts. +type GetAlertsParams struct { // Props A list of properties to include in each data dictionnary. Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` @@ -1023,7 +2051,10 @@ type GetGroupAppsParams struct { // Offset Skip the first entries of the data cursor. Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` - // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit the meta field. + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. @@ -1036,14 +2067,21 @@ type GetGroupAppsParams struct { Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` } -// DeleteGroupHiddenMenuEntriesJSONBody defines parameters for DeleteGroupHiddenMenuEntries. -type DeleteGroupHiddenMenuEntriesJSONBody struct { - // MenuEntry Menu entry key to unhide - MenuEntry string `json:"menu_entry"` +// PostAlertsJSONBody defines parameters for PostAlerts. +type PostAlertsJSONBody struct { + BaseSeverity *int `json:"base_severity,omitempty"` + DashDict *map[string]interface{} `json:"dash_dict,omitempty"` + DashEnv *string `json:"dash_env,omitempty"` + DashFmt *string `json:"dash_fmt,omitempty"` + DashInstance *string `json:"dash_instance,omitempty"` + DashSeverity *int `json:"dash_severity,omitempty"` + DashType string `json:"dash_type"` + NodeId *string `json:"node_id,omitempty"` + SvcId *string `json:"svc_id,omitempty"` } -// GetGroupHiddenMenuEntriesParams defines parameters for GetGroupHiddenMenuEntries. -type GetGroupHiddenMenuEntriesParams struct { +// GetAlertParams defines parameters for GetAlert. +type GetAlertParams struct { // Props A list of properties to include in each data dictionnary. Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` @@ -1053,7 +2091,10 @@ type GetGroupHiddenMenuEntriesParams struct { // Offset Skip the first entries of the data cursor. Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` - // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit the meta field. + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. @@ -1066,14 +2107,29 @@ type GetGroupHiddenMenuEntriesParams struct { Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` } -// PostGroupHiddenMenuEntriesJSONBody defines parameters for PostGroupHiddenMenuEntries. -type PostGroupHiddenMenuEntriesJSONBody struct { - // MenuEntry Menu entry key to hide - MenuEntry string `json:"menu_entry"` +// PostAlertJSONBody defines parameters for PostAlert. +type PostAlertJSONBody struct { + BaseSeverity *int `json:"base_severity,omitempty"` + DashDict *map[string]interface{} `json:"dash_dict,omitempty"` + DashFmt *string `json:"dash_fmt,omitempty"` + DashInstance *string `json:"dash_instance,omitempty"` + DashSeverity *int `json:"dash_severity,omitempty"` + DashType *string `json:"dash_type,omitempty"` + NodeId *string `json:"node_id,omitempty"` + SvcId *string `json:"svc_id,omitempty"` } -// GetGroupModulesetsParams defines parameters for GetGroupModulesets. -type GetGroupModulesetsParams struct { +// DeleteAppsJSONBody defines parameters for DeleteApps. +type DeleteAppsJSONBody struct { + // App App code + App *string `json:"app,omitempty"` + + // Id App record id + Id *string `json:"id,omitempty"` +} + +// GetAppsParams defines parameters for GetApps. +type GetAppsParams struct { // Props A list of properties to include in each data dictionnary. Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` @@ -1083,7 +2139,10 @@ type GetGroupModulesetsParams struct { // Offset Skip the first entries of the data cursor. Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` - // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit the meta field. + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. @@ -1094,34 +2153,45 @@ type GetGroupModulesetsParams struct { // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` + + // Filter Column filter, repeatable; several filters combine with AND. Each value is + // `prop:expr`, `prop` being a property of the list (joined ones included, as + // for orderby) and `expr` one of: + // - text: case-insensitive match anywhere in the value; + // - `~regex`: regular expression (RE2 syntax), case-insensitive; + // - `in:a,b,c`: one of the listed values; + // - `eq:v`, `ne:v`: equal, not equal; + // - `gt:v`, `gte:v`, `lt:v`, `lte:v`: comparisons, for numbers and dates; + // - `empty`, `!empty`: no value, any value. + // An unknown property, a property without a column, or an invalid regular + // expression is answered with 400. + Filter *InQueryFilter `form:"filter,omitempty" json:"filter,omitempty"` } -// GetGroupNodesParams defines parameters for GetGroupNodes. -type GetGroupNodesParams struct { +// PostAppsJSONBody defines parameters for PostApps. +type PostAppsJSONBody struct { + App string `json:"app"` + AppDomain *string `json:"app_domain,omitempty"` + AppTeamOps *string `json:"app_team_ops,omitempty"` + Description *string `json:"description,omitempty"` +} + +// GetAppParams defines parameters for GetApp. +type GetAppParams struct { // Props A list of properties to include in each data dictionnary. Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` +} - // Limit The maximum number of entries to return. 0 means no limit. - Limit *InQueryLimit `form:"limit,omitempty" json:"limit,omitempty"` - - // Offset Skip the first entries of the data cursor. - Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` - - // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit the meta field. - Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` - - // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. - Stats *InQueryStats `form:"stats,omitempty" json:"stats,omitempty"` - - // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). - Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` - - // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). - Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` +// PostAppJSONBody defines parameters for PostApp. +type PostAppJSONBody struct { + App *string `json:"app,omitempty"` + AppDomain *string `json:"app_domain,omitempty"` + AppTeamOps *string `json:"app_team_ops,omitempty"` + Description *string `json:"description,omitempty"` } -// GetGroupRulesetsParams defines parameters for GetGroupRulesets. -type GetGroupRulesetsParams struct { +// GetAppNodesParams defines parameters for GetAppNodes. +type GetAppNodesParams struct { // Props A list of properties to include in each data dictionnary. Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` @@ -1131,7 +2201,10 @@ type GetGroupRulesetsParams struct { // Offset Skip the first entries of the data cursor. Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` - // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit the meta field. + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. @@ -1144,8 +2217,8 @@ type GetGroupRulesetsParams struct { Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` } -// GetGroupServicesParams defines parameters for GetGroupServices. -type GetGroupServicesParams struct { +// GetAppPublicationsParams defines parameters for GetAppPublications. +type GetAppPublicationsParams struct { // Props A list of properties to include in each data dictionnary. Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` @@ -1155,7 +2228,10 @@ type GetGroupServicesParams struct { // Offset Skip the first entries of the data cursor. Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` - // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit the meta field. + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. @@ -1168,8 +2244,8 @@ type GetGroupServicesParams struct { Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` } -// GetGroupUsersParams defines parameters for GetGroupUsers. -type GetGroupUsersParams struct { +// GetAppQuotasParams defines parameters for GetAppQuotas. +type GetAppQuotasParams struct { // Props A list of properties to include in each data dictionnary. Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` @@ -1179,7 +2255,10 @@ type GetGroupUsersParams struct { // Offset Skip the first entries of the data cursor. Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` - // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit the meta field. + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. @@ -1192,14 +2271,8 @@ type GetGroupUsersParams struct { Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` } -// DeleteIpsJSONBody defines parameters for DeleteIps. -type DeleteIpsJSONBody struct { - // Id Ip identifier (node_ip.id) - Id string `json:"id"` -} - -// GetIpsParams defines parameters for GetIps. -type GetIpsParams struct { +// GetAppResponsiblesParams defines parameters for GetAppResponsibles. +type GetAppResponsiblesParams struct { // Props A list of properties to include in each data dictionnary. Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` @@ -1209,7 +2282,10 @@ type GetIpsParams struct { // Offset Skip the first entries of the data cursor. Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` - // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit the meta field. + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. @@ -1222,8 +2298,8 @@ type GetIpsParams struct { Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` } -// GetIpParams defines parameters for GetIp. -type GetIpParams struct { +// GetAppServicesParams defines parameters for GetAppServices. +type GetAppServicesParams struct { // Props A list of properties to include in each data dictionnary. Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` @@ -1233,7 +2309,10 @@ type GetIpParams struct { // Offset Skip the first entries of the data cursor. Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` - // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit the meta field. + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. @@ -1246,11 +2325,44 @@ type GetIpParams struct { Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` } -// GetLogsParams defines parameters for GetLogs. -type GetLogsParams struct { - // FsetId Restrict to log events matching this filterset (gen_filtersets.id or fset_name) - FsetId *string `form:"fset_id,omitempty" json:"fset_id,omitempty"` +// DeleteAppsPublicationsJSONBody defines parameters for DeleteAppsPublications. +type DeleteAppsPublicationsJSONBody struct { + // AppId App record id or app code + AppId string `json:"app_id"` + + // GroupId Group record id or group role + GroupId string `json:"group_id"` +} + +// PostAppsPublicationsJSONBody defines parameters for PostAppsPublications. +type PostAppsPublicationsJSONBody struct { + // AppId App record id or app code + AppId string `json:"app_id"` + + // GroupId Group record id or group role + GroupId string `json:"group_id"` +} + +// DeleteAppsResponsiblesJSONBody defines parameters for DeleteAppsResponsibles. +type DeleteAppsResponsiblesJSONBody struct { + // AppId App record id or app code + AppId string `json:"app_id"` + + // GroupId Group record id or group role + GroupId string `json:"group_id"` +} + +// PostAppsResponsiblesJSONBody defines parameters for PostAppsResponsibles. +type PostAppsResponsiblesJSONBody struct { + // AppId App record id or app code + AppId string `json:"app_id"` + + // GroupId Group record id or group role + GroupId string `json:"group_id"` +} +// GetArraysParams defines parameters for GetArrays. +type GetArraysParams struct { // Props A list of properties to include in each data dictionnary. Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` @@ -1260,7 +2372,10 @@ type GetLogsParams struct { // Offset Skip the first entries of the data cursor. Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` - // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit the meta field. + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. @@ -1273,17 +2388,24 @@ type GetLogsParams struct { Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` } -// PostLogsJSONBody defines parameters for PostLogs. -type PostLogsJSONBody struct { - LogDict *map[string]interface{} `json:"log_dict,omitempty"` - LogFmt string `json:"log_fmt"` - LogLevel *string `json:"log_level,omitempty"` - NodeId *string `json:"node_id,omitempty"` - SvcId *string `json:"svc_id,omitempty"` +// PostAuthNodeJSONBody defines parameters for PostAuthNode. +type PostAuthNodeJSONBody struct { + App *string `json:"app,omitempty"` + Nodename string `json:"nodename"` } -// GetLogParams defines parameters for GetLog. -type GetLogParams struct { +// PostComplianceImportJSONBody defines parameters for PostComplianceImport. +type PostComplianceImportJSONBody struct { + Filtersets *[]FiltersetExportItem `json:"filtersets,omitempty"` + Modulesets *[]CompExportModuleset `json:"modulesets,omitempty"` + Rulesets *[]CompExportRuleset `json:"rulesets,omitempty"` +} + +// GetComplianceLogsParams defines parameters for GetComplianceLogs. +type GetComplianceLogsParams struct { + // FsetId Restrict to the runs of the nodes this filterset selects (gen_filtersets.id or fset_name) + FsetId *string `form:"fset_id,omitempty" json:"fset_id,omitempty"` + // Props A list of properties to include in each data dictionnary. Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` @@ -1293,7 +2415,10 @@ type GetLogParams struct { // Offset Skip the first entries of the data cursor. Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` - // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit the meta field. + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. @@ -1302,18 +2427,37 @@ type GetLogParams struct { // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` + // Filter Column filter, repeatable; several filters combine with AND. Each value is + // `prop:expr`, `prop` being a property of the list (joined ones included, as + // for orderby) and `expr` one of: + // - text: case-insensitive match anywhere in the value; + // - `~regex`: regular expression (RE2 syntax), case-insensitive; + // - `in:a,b,c`: one of the listed values; + // - `eq:v`, `ne:v`: equal, not equal; + // - `gt:v`, `gte:v`, `lt:v`, `lte:v`: comparisons, for numbers and dates; + // - `empty`, `!empty`: no value, any value. + // An unknown property, a property without a column, or an invalid regular + // expression is answered with 400. + Filter *InQueryFilter `form:"filter,omitempty" json:"filter,omitempty"` + // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` } -// DeleteNodesJSONBody defines parameters for DeleteNodes. -type DeleteNodesJSONBody struct { - // NodeId Node identifier (node_id or nodename) - NodeId string `json:"node_id"` +// GetComplianceLogParams defines parameters for GetComplianceLog. +type GetComplianceLogParams struct { + // Props A list of properties to include in each data dictionnary. + Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` } -// GetNodesParams defines parameters for GetNodes. -type GetNodesParams struct { +// DeleteComplianceModulesetsJSONBody defines parameters for DeleteComplianceModulesets. +type DeleteComplianceModulesetsJSONBody struct { + // Id Moduleset id or name + Id interface{} `json:"id,omitempty"` +} + +// GetComplianceModulesetsParams defines parameters for GetComplianceModulesets. +type GetComplianceModulesetsParams struct { // Props A list of properties to include in each data dictionnary. Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` @@ -1323,7 +2467,10 @@ type GetNodesParams struct { // Offset Skip the first entries of the data cursor. Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` - // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit the meta field. + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. @@ -1332,93 +2479,49 @@ type GetNodesParams struct { // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` + // Filter Column filter, repeatable; several filters combine with AND. Each value is + // `prop:expr`, `prop` being a property of the list (joined ones included, as + // for orderby) and `expr` one of: + // - text: case-insensitive match anywhere in the value; + // - `~regex`: regular expression (RE2 syntax), case-insensitive; + // - `in:a,b,c`: one of the listed values; + // - `eq:v`, `ne:v`: equal, not equal; + // - `gt:v`, `gte:v`, `lt:v`, `lte:v`: comparisons, for numbers and dates; + // - `empty`, `!empty`: no value, any value. + // An unknown property, a property without a column, or an invalid regular + // expression is answered with 400. + Filter *InQueryFilter `form:"filter,omitempty" json:"filter,omitempty"` + // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` } -// PostNodesJSONBody defines parameters for PostNodes. -type PostNodesJSONBody struct { - ActionType *PostNodesJSONBodyActionType `json:"action_type,omitempty"` - App *string `json:"app,omitempty"` - AssetEnv *string `json:"asset_env,omitempty"` - Assetname *string `json:"assetname,omitempty"` - BiosVersion *string `json:"bios_version,omitempty"` - ClusterId *string `json:"cluster_id,omitempty"` - Collector *string `json:"collector,omitempty"` - ConnectTo *string `json:"connect_to,omitempty"` - CpuCores *int `json:"cpu_cores,omitempty"` - CpuDies *int `json:"cpu_dies,omitempty"` - CpuFreq *string `json:"cpu_freq,omitempty"` - CpuModel *string `json:"cpu_model,omitempty"` - CpuThreads *int `json:"cpu_threads,omitempty"` - CpuVendor *string `json:"cpu_vendor,omitempty"` - Enclosure *string `json:"enclosure,omitempty"` - Enclosureslot *string `json:"enclosureslot,omitempty"` - Fqdn *string `json:"fqdn,omitempty"` - Hv *string `json:"hv,omitempty"` - Hvpool *string `json:"hvpool,omitempty"` - Hvvdc *string `json:"hvvdc,omitempty"` - HwObsAlertDate *string `json:"hw_obs_alert_date,omitempty"` - HwObsWarnDate *string `json:"hw_obs_warn_date,omitempty"` - LastBoot *string `json:"last_boot,omitempty"` - LastComm *string `json:"last_comm,omitempty"` - ListenerPort *int `json:"listener_port,omitempty"` - LocAddr *string `json:"loc_addr,omitempty"` - LocBuilding *string `json:"loc_building,omitempty"` - LocCity *string `json:"loc_city,omitempty"` - LocCountry *string `json:"loc_country,omitempty"` - LocFloor *string `json:"loc_floor,omitempty"` - LocRack *string `json:"loc_rack,omitempty"` - LocRoom *string `json:"loc_room,omitempty"` - LocZip *string `json:"loc_zip,omitempty"` - MaintenanceEnd *string `json:"maintenance_end,omitempty"` - Manufacturer *string `json:"manufacturer,omitempty"` - MemBanks *int `json:"mem_banks,omitempty"` - MemBytes *int `json:"mem_bytes,omitempty"` - MemSlots *int `json:"mem_slots,omitempty"` - Model *string `json:"model,omitempty"` - NodeEnv *string `json:"node_env,omitempty"` - NodeFrozen *bool `json:"node_frozen,omitempty"` - NodeFrozenAt *string `json:"node_frozen_at,omitempty"` - NodeId *string `json:"node_id,omitempty"` - Nodename *string `json:"nodename,omitempty"` - Notifications *bool `json:"notifications,omitempty"` - OsArch *string `json:"os_arch,omitempty"` - OsConcat *string `json:"os_concat,omitempty"` - OsKernel *string `json:"os_kernel,omitempty"` - OsName *string `json:"os_name,omitempty"` - OsObsAlertDate *string `json:"os_obs_alert_date,omitempty"` - OsObsWarnDate *string `json:"os_obs_warn_date,omitempty"` - OsRelease *string `json:"os_release,omitempty"` - OsVendor *string `json:"os_vendor,omitempty"` - PowerBreaker1 *string `json:"power_breaker1,omitempty"` - PowerBreaker2 *string `json:"power_breaker2,omitempty"` - PowerCabinet1 *string `json:"power_cabinet1,omitempty"` - PowerCabinet2 *string `json:"power_cabinet2,omitempty"` - PowerProtect *string `json:"power_protect,omitempty"` - PowerProtectBreaker *string `json:"power_protect_breaker,omitempty"` - PowerSupplyNb *int `json:"power_supply_nb,omitempty"` - Role *string `json:"role,omitempty"` - SecZone *string `json:"sec_zone,omitempty"` - Serial *string `json:"serial,omitempty"` - SnoozeTill *string `json:"snooze_till,omitempty"` - SpVersion *string `json:"sp_version,omitempty"` - Status *string `json:"status,omitempty"` - TeamInteg *string `json:"team_integ,omitempty"` - TeamResponsible *string `json:"team_responsible,omitempty"` - TeamSupport *string `json:"team_support,omitempty"` - Type *string `json:"type,omitempty"` - Tz *string `json:"tz,omitempty"` - Updated *string `json:"updated,omitempty"` - Version *string `json:"version,omitempty"` - WarrantyEnd *string `json:"warranty_end,omitempty"` +// PostComplianceModulesetsJSONBody defines parameters for PostComplianceModulesets. +type PostComplianceModulesetsJSONBody struct { + ModsetName *string `json:"modset_name,omitempty"` } -// PostNodesJSONBodyActionType defines parameters for PostNodes. -type PostNodesJSONBodyActionType string +// GetComplianceModulesetParams defines parameters for GetComplianceModuleset. +type GetComplianceModulesetParams struct { + // Props A list of properties to include in each data dictionnary. + Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` +} -// GetNodesHardwareParams defines parameters for GetNodesHardware. -type GetNodesHardwareParams struct { +// PostComplianceModulesetJSONBody defines parameters for PostComplianceModuleset. +type PostComplianceModulesetJSONBody struct { + ModsetName *string `json:"modset_name,omitempty"` +} + +// PutComplianceModulesetJSONBody defines parameters for PutComplianceModuleset. +type PutComplianceModulesetJSONBody struct { + Action PutComplianceModulesetJSONBodyAction `json:"action"` +} + +// PutComplianceModulesetJSONBodyAction defines parameters for PutComplianceModuleset. +type PutComplianceModulesetJSONBodyAction string + +// GetComplianceModulesetCandidateNodesParams defines parameters for GetComplianceModulesetCandidateNodes. +type GetComplianceModulesetCandidateNodesParams struct { // Props A list of properties to include in each data dictionnary. Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` @@ -1428,7 +2531,10 @@ type GetNodesHardwareParams struct { // Offset Skip the first entries of the data cursor. Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` - // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit the meta field. + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. @@ -1437,12 +2543,28 @@ type GetNodesHardwareParams struct { // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` + // Filter Column filter, repeatable; several filters combine with AND. Each value is + // `prop:expr`, `prop` being a property of the list (joined ones included, as + // for orderby) and `expr` one of: + // - text: case-insensitive match anywhere in the value; + // - `~regex`: regular expression (RE2 syntax), case-insensitive; + // - `in:a,b,c`: one of the listed values; + // - `eq:v`, `ne:v`: equal, not equal; + // - `gt:v`, `gte:v`, `lt:v`, `lte:v`: comparisons, for numbers and dates; + // - `empty`, `!empty`: no value, any value. + // An unknown property, a property without a column, or an invalid regular + // expression is answered with 400. + Filter *InQueryFilter `form:"filter,omitempty" json:"filter,omitempty"` + // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` } -// GetNodesHbasParams defines parameters for GetNodesHbas. -type GetNodesHbasParams struct { +// GetComplianceModulesetCandidateServicesParams defines parameters for GetComplianceModulesetCandidateServices. +type GetComplianceModulesetCandidateServicesParams struct { + // Slave With true, the encapsulated services + Slave *bool `form:"slave,omitempty" json:"slave,omitempty"` + // Props A list of properties to include in each data dictionnary. Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` @@ -1452,7 +2574,10 @@ type GetNodesHbasParams struct { // Offset Skip the first entries of the data cursor. Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` - // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit the meta field. + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. @@ -1461,12 +2586,25 @@ type GetNodesHbasParams struct { // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` + // Filter Column filter, repeatable; several filters combine with AND. Each value is + // `prop:expr`, `prop` being a property of the list (joined ones included, as + // for orderby) and `expr` one of: + // - text: case-insensitive match anywhere in the value; + // - `~regex`: regular expression (RE2 syntax), case-insensitive; + // - `in:a,b,c`: one of the listed values; + // - `eq:v`, `ne:v`: equal, not equal; + // - `gt:v`, `gte:v`, `lt:v`, `lte:v`: comparisons, for numbers and dates; + // - `empty`, `!empty`: no value, any value. + // An unknown property, a property without a column, or an invalid regular + // expression is answered with 400. + Filter *InQueryFilter `form:"filter,omitempty" json:"filter,omitempty"` + // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` } -// GetNodeParams defines parameters for GetNode. -type GetNodeParams struct { +// GetComplianceModulesetModulesParams defines parameters for GetComplianceModulesetModules. +type GetComplianceModulesetModulesParams struct { // Props A list of properties to include in each data dictionnary. Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` @@ -1476,7 +2614,10 @@ type GetNodeParams struct { // Offset Skip the first entries of the data cursor. Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` - // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit the meta field. + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. @@ -1485,92 +2626,45 @@ type GetNodeParams struct { // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` + // Filter Column filter, repeatable; several filters combine with AND. Each value is + // `prop:expr`, `prop` being a property of the list (joined ones included, as + // for orderby) and `expr` one of: + // - text: case-insensitive match anywhere in the value; + // - `~regex`: regular expression (RE2 syntax), case-insensitive; + // - `in:a,b,c`: one of the listed values; + // - `eq:v`, `ne:v`: equal, not equal; + // - `gt:v`, `gte:v`, `lt:v`, `lte:v`: comparisons, for numbers and dates; + // - `empty`, `!empty`: no value, any value. + // An unknown property, a property without a column, or an invalid regular + // expression is answered with 400. + Filter *InQueryFilter `form:"filter,omitempty" json:"filter,omitempty"` + // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` } -// PostNodeJSONBody defines parameters for PostNode. -type PostNodeJSONBody struct { - ActionType *PostNodeJSONBodyActionType `json:"action_type,omitempty"` - App *string `json:"app,omitempty"` - AssetEnv *string `json:"asset_env,omitempty"` - Assetname *string `json:"assetname,omitempty"` - BiosVersion *string `json:"bios_version,omitempty"` - ClusterId *string `json:"cluster_id,omitempty"` - Collector *string `json:"collector,omitempty"` - ConnectTo *string `json:"connect_to,omitempty"` - CpuCores *int `json:"cpu_cores,omitempty"` - CpuDies *int `json:"cpu_dies,omitempty"` - CpuFreq *string `json:"cpu_freq,omitempty"` - CpuModel *string `json:"cpu_model,omitempty"` - CpuThreads *int `json:"cpu_threads,omitempty"` - CpuVendor *string `json:"cpu_vendor,omitempty"` - Enclosure *string `json:"enclosure,omitempty"` - Enclosureslot *string `json:"enclosureslot,omitempty"` - Fqdn *string `json:"fqdn,omitempty"` - Hv *string `json:"hv,omitempty"` - Hvpool *string `json:"hvpool,omitempty"` - Hvvdc *string `json:"hvvdc,omitempty"` - HwObsAlertDate *string `json:"hw_obs_alert_date,omitempty"` - HwObsWarnDate *string `json:"hw_obs_warn_date,omitempty"` - LastBoot *string `json:"last_boot,omitempty"` - LastComm *string `json:"last_comm,omitempty"` - ListenerPort *int `json:"listener_port,omitempty"` - LocAddr *string `json:"loc_addr,omitempty"` - LocBuilding *string `json:"loc_building,omitempty"` - LocCity *string `json:"loc_city,omitempty"` - LocCountry *string `json:"loc_country,omitempty"` - LocFloor *string `json:"loc_floor,omitempty"` - LocRack *string `json:"loc_rack,omitempty"` - LocRoom *string `json:"loc_room,omitempty"` - LocZip *string `json:"loc_zip,omitempty"` - MaintenanceEnd *string `json:"maintenance_end,omitempty"` - Manufacturer *string `json:"manufacturer,omitempty"` - MemBanks *int `json:"mem_banks,omitempty"` - MemBytes *int `json:"mem_bytes,omitempty"` - MemSlots *int `json:"mem_slots,omitempty"` - Model *string `json:"model,omitempty"` - NodeEnv *string `json:"node_env,omitempty"` - NodeFrozen *bool `json:"node_frozen,omitempty"` - NodeFrozenAt *string `json:"node_frozen_at,omitempty"` - Nodename *string `json:"nodename,omitempty"` - Notifications *bool `json:"notifications,omitempty"` - OsArch *string `json:"os_arch,omitempty"` - OsConcat *string `json:"os_concat,omitempty"` - OsKernel *string `json:"os_kernel,omitempty"` - OsName *string `json:"os_name,omitempty"` - OsObsAlertDate *string `json:"os_obs_alert_date,omitempty"` - OsObsWarnDate *string `json:"os_obs_warn_date,omitempty"` - OsRelease *string `json:"os_release,omitempty"` - OsVendor *string `json:"os_vendor,omitempty"` - PowerBreaker1 *string `json:"power_breaker1,omitempty"` - PowerBreaker2 *string `json:"power_breaker2,omitempty"` - PowerCabinet1 *string `json:"power_cabinet1,omitempty"` - PowerCabinet2 *string `json:"power_cabinet2,omitempty"` - PowerProtect *string `json:"power_protect,omitempty"` - PowerProtectBreaker *string `json:"power_protect_breaker,omitempty"` - PowerSupplyNb *int `json:"power_supply_nb,omitempty"` - Role *string `json:"role,omitempty"` - SecZone *string `json:"sec_zone,omitempty"` - Serial *string `json:"serial,omitempty"` - SnoozeTill *string `json:"snooze_till,omitempty"` - SpVersion *string `json:"sp_version,omitempty"` - Status *string `json:"status,omitempty"` - TeamInteg *string `json:"team_integ,omitempty"` - TeamResponsible *string `json:"team_responsible,omitempty"` - TeamSupport *string `json:"team_support,omitempty"` - Type *string `json:"type,omitempty"` - Tz *string `json:"tz,omitempty"` - Updated *string `json:"updated,omitempty"` - Version *string `json:"version,omitempty"` - WarrantyEnd *string `json:"warranty_end,omitempty"` +// PostComplianceModulesetModulesJSONBody defines parameters for PostComplianceModulesetModules. +type PostComplianceModulesetModulesJSONBody struct { + // Autofix A boolean, or "T" / "F" as stored. Whether the agent fixes the module on check failure. + Autofix interface{} `json:"autofix,omitempty"` + ModsetModName *string `json:"modset_mod_name,omitempty"` } -// PostNodeJSONBodyActionType defines parameters for PostNode. -type PostNodeJSONBodyActionType string +// GetComplianceModulesetModuleParams defines parameters for GetComplianceModulesetModule. +type GetComplianceModulesetModuleParams struct { + // Props A list of properties to include in each data dictionnary. + Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` +} -// GetNodeAlertsParams defines parameters for GetNodeAlerts. -type GetNodeAlertsParams struct { +// PostComplianceModulesetModuleJSONBody defines parameters for PostComplianceModulesetModule. +type PostComplianceModulesetModuleJSONBody struct { + // Autofix A boolean, or "T" / "F" as stored. Whether the agent fixes the module on check failure. + Autofix interface{} `json:"autofix,omitempty"` + ModsetModName *string `json:"modset_mod_name,omitempty"` +} + +// GetComplianceModulesetNodesParams defines parameters for GetComplianceModulesetNodes. +type GetComplianceModulesetNodesParams struct { // Props A list of properties to include in each data dictionnary. Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` @@ -1580,7 +2674,10 @@ type GetNodeAlertsParams struct { // Offset Skip the first entries of the data cursor. Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` - // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit the meta field. + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. @@ -1589,12 +2686,25 @@ type GetNodeAlertsParams struct { // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` + // Filter Column filter, repeatable; several filters combine with AND. Each value is + // `prop:expr`, `prop` being a property of the list (joined ones included, as + // for orderby) and `expr` one of: + // - text: case-insensitive match anywhere in the value; + // - `~regex`: regular expression (RE2 syntax), case-insensitive; + // - `in:a,b,c`: one of the listed values; + // - `eq:v`, `ne:v`: equal, not equal; + // - `gt:v`, `gte:v`, `lt:v`, `lte:v`: comparisons, for numbers and dates; + // - `empty`, `!empty`: no value, any value. + // An unknown property, a property without a column, or an invalid regular + // expression is answered with 400. + Filter *InQueryFilter `form:"filter,omitempty" json:"filter,omitempty"` + // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` } -// GetNodeCandidateTagsParams defines parameters for GetNodeCandidateTags. -type GetNodeCandidateTagsParams struct { +// GetComplianceModulesetPublicationsParams defines parameters for GetComplianceModulesetPublications. +type GetComplianceModulesetPublicationsParams struct { // Props A list of properties to include in each data dictionnary. Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` @@ -1604,7 +2714,10 @@ type GetNodeCandidateTagsParams struct { // Offset Skip the first entries of the data cursor. Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` - // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit the meta field. + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. @@ -1613,12 +2726,25 @@ type GetNodeCandidateTagsParams struct { // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` + // Filter Column filter, repeatable; several filters combine with AND. Each value is + // `prop:expr`, `prop` being a property of the list (joined ones included, as + // for orderby) and `expr` one of: + // - text: case-insensitive match anywhere in the value; + // - `~regex`: regular expression (RE2 syntax), case-insensitive; + // - `in:a,b,c`: one of the listed values; + // - `eq:v`, `ne:v`: equal, not equal; + // - `gt:v`, `gte:v`, `lt:v`, `lte:v`: comparisons, for numbers and dates; + // - `empty`, `!empty`: no value, any value. + // An unknown property, a property without a column, or an invalid regular + // expression is answered with 400. + Filter *InQueryFilter `form:"filter,omitempty" json:"filter,omitempty"` + // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` } -// GetNodeChecksParams defines parameters for GetNodeChecks. -type GetNodeChecksParams struct { +// GetComplianceModulesetResponsiblesParams defines parameters for GetComplianceModulesetResponsibles. +type GetComplianceModulesetResponsiblesParams struct { // Props A list of properties to include in each data dictionnary. Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` @@ -1628,7 +2754,10 @@ type GetNodeChecksParams struct { // Offset Skip the first entries of the data cursor. Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` - // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit the meta field. + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. @@ -1637,12 +2766,28 @@ type GetNodeChecksParams struct { // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` + // Filter Column filter, repeatable; several filters combine with AND. Each value is + // `prop:expr`, `prop` being a property of the list (joined ones included, as + // for orderby) and `expr` one of: + // - text: case-insensitive match anywhere in the value; + // - `~regex`: regular expression (RE2 syntax), case-insensitive; + // - `in:a,b,c`: one of the listed values; + // - `eq:v`, `ne:v`: equal, not equal; + // - `gt:v`, `gte:v`, `lt:v`, `lte:v`: comparisons, for numbers and dates; + // - `empty`, `!empty`: no value, any value. + // An unknown property, a property without a column, or an invalid regular + // expression is answered with 400. + Filter *InQueryFilter `form:"filter,omitempty" json:"filter,omitempty"` + // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` } -// GetNodeComplianceCandidateModulesetsParams defines parameters for GetNodeComplianceCandidateModulesets. -type GetNodeComplianceCandidateModulesetsParams struct { +// GetComplianceModulesetServicesParams defines parameters for GetComplianceModulesetServices. +type GetComplianceModulesetServicesParams struct { + // Slave With true, the encapsulated services + Slave *bool `form:"slave,omitempty" json:"slave,omitempty"` + // Props A list of properties to include in each data dictionnary. Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` @@ -1652,7 +2797,10 @@ type GetNodeComplianceCandidateModulesetsParams struct { // Offset Skip the first entries of the data cursor. Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` - // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit the meta field. + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. @@ -1661,12 +2809,25 @@ type GetNodeComplianceCandidateModulesetsParams struct { // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` + // Filter Column filter, repeatable; several filters combine with AND. Each value is + // `prop:expr`, `prop` being a property of the list (joined ones included, as + // for orderby) and `expr` one of: + // - text: case-insensitive match anywhere in the value; + // - `~regex`: regular expression (RE2 syntax), case-insensitive; + // - `in:a,b,c`: one of the listed values; + // - `eq:v`, `ne:v`: equal, not equal; + // - `gt:v`, `gte:v`, `lt:v`, `lte:v`: comparisons, for numbers and dates; + // - `empty`, `!empty`: no value, any value. + // An unknown property, a property without a column, or an invalid regular + // expression is answered with 400. + Filter *InQueryFilter `form:"filter,omitempty" json:"filter,omitempty"` + // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` } -// GetNodeComplianceCandidateRulesetsParams defines parameters for GetNodeComplianceCandidateRulesets. -type GetNodeComplianceCandidateRulesetsParams struct { +// GetComplianceModulesetsModulesParams defines parameters for GetComplianceModulesetsModules. +type GetComplianceModulesetsModulesParams struct { // Props A list of properties to include in each data dictionnary. Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` @@ -1676,7 +2837,10 @@ type GetNodeComplianceCandidateRulesetsParams struct { // Offset Skip the first entries of the data cursor. Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` - // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit the meta field. + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. @@ -1685,12 +2849,105 @@ type GetNodeComplianceCandidateRulesetsParams struct { // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` + // Filter Column filter, repeatable; several filters combine with AND. Each value is + // `prop:expr`, `prop` being a property of the list (joined ones included, as + // for orderby) and `expr` one of: + // - text: case-insensitive match anywhere in the value; + // - `~regex`: regular expression (RE2 syntax), case-insensitive; + // - `in:a,b,c`: one of the listed values; + // - `eq:v`, `ne:v`: equal, not equal; + // - `gt:v`, `gte:v`, `lt:v`, `lte:v`: comparisons, for numbers and dates; + // - `empty`, `!empty`: no value, any value. + // An unknown property, a property without a column, or an invalid regular + // expression is answered with 400. + Filter *InQueryFilter `form:"filter,omitempty" json:"filter,omitempty"` + // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` } -// GetNodeComplianceLogsParams defines parameters for GetNodeComplianceLogs. -type GetNodeComplianceLogsParams struct { +// DeleteComplianceModulesetsNodesJSONBody defines parameters for DeleteComplianceModulesetsNodes. +type DeleteComplianceModulesetsNodesJSONBody struct { + // ModsetId Moduleset id or name + ModsetId interface{} `json:"modset_id,omitempty"` + ModsetName *string `json:"modset_name,omitempty"` + NodeId string `json:"node_id"` +} + +// PostComplianceModulesetsNodesJSONBody defines parameters for PostComplianceModulesetsNodes. +type PostComplianceModulesetsNodesJSONBody struct { + // ModsetId Moduleset id or name + ModsetId interface{} `json:"modset_id,omitempty"` + ModsetName *string `json:"modset_name,omitempty"` + NodeId string `json:"node_id"` +} + +// DeleteComplianceModulesetsPublicationsJSONBody defines parameters for DeleteComplianceModulesetsPublications. +type DeleteComplianceModulesetsPublicationsJSONBody struct { + // GroupId Group id or role + GroupId interface{} `json:"group_id"` + + // ModsetId Moduleset id or name + ModsetId interface{} `json:"modset_id"` +} + +// PostComplianceModulesetsPublicationsJSONBody defines parameters for PostComplianceModulesetsPublications. +type PostComplianceModulesetsPublicationsJSONBody struct { + // GroupId Group id or role + GroupId interface{} `json:"group_id"` + + // ModsetId Moduleset id or name + ModsetId interface{} `json:"modset_id"` +} + +// DeleteComplianceModulesetsResponsiblesJSONBody defines parameters for DeleteComplianceModulesetsResponsibles. +type DeleteComplianceModulesetsResponsiblesJSONBody struct { + // GroupId Group id or role + GroupId interface{} `json:"group_id"` + + // ModsetId Moduleset id or name + ModsetId interface{} `json:"modset_id"` +} + +// PostComplianceModulesetsResponsiblesJSONBody defines parameters for PostComplianceModulesetsResponsibles. +type PostComplianceModulesetsResponsiblesJSONBody struct { + // GroupId Group id or role + GroupId interface{} `json:"group_id"` + + // ModsetId Moduleset id or name + ModsetId interface{} `json:"modset_id"` +} + +// DeleteComplianceModulesetsServicesJSONBody defines parameters for DeleteComplianceModulesetsServices. +type DeleteComplianceModulesetsServicesJSONBody struct { + // ModsetId Moduleset id or name + ModsetId interface{} `json:"modset_id,omitempty"` + ModsetName *string `json:"modset_name,omitempty"` + + // Slave A boolean; true for the encapsulated service. encap is accepted as well. + Slave interface{} `json:"slave,omitempty"` + SvcId string `json:"svc_id"` +} + +// PostComplianceModulesetsServicesJSONBody defines parameters for PostComplianceModulesetsServices. +type PostComplianceModulesetsServicesJSONBody struct { + // ModsetId Moduleset id or name + ModsetId interface{} `json:"modset_id,omitempty"` + ModsetName *string `json:"modset_name,omitempty"` + + // Slave A boolean; true for the encapsulated service. encap is accepted as well. + Slave interface{} `json:"slave,omitempty"` + SvcId string `json:"svc_id"` +} + +// DeleteComplianceRulesetsJSONBody defines parameters for DeleteComplianceRulesets. +type DeleteComplianceRulesetsJSONBody struct { + // Id Ruleset id or name + Id interface{} `json:"id,omitempty"` +} + +// GetComplianceRulesetsParams defines parameters for GetComplianceRulesets. +type GetComplianceRulesetsParams struct { // Props A list of properties to include in each data dictionnary. Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` @@ -1700,7 +2957,10 @@ type GetNodeComplianceLogsParams struct { // Offset Skip the first entries of the data cursor. Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` - // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit the meta field. + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. @@ -1709,12 +2969,63 @@ type GetNodeComplianceLogsParams struct { // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` + // Filter Column filter, repeatable; several filters combine with AND. Each value is + // `prop:expr`, `prop` being a property of the list (joined ones included, as + // for orderby) and `expr` one of: + // - text: case-insensitive match anywhere in the value; + // - `~regex`: regular expression (RE2 syntax), case-insensitive; + // - `in:a,b,c`: one of the listed values; + // - `eq:v`, `ne:v`: equal, not equal; + // - `gt:v`, `gte:v`, `lt:v`, `lte:v`: comparisons, for numbers and dates; + // - `empty`, `!empty`: no value, any value. + // An unknown property, a property without a column, or an invalid regular + // expression is answered with 400. + Filter *InQueryFilter `form:"filter,omitempty" json:"filter,omitempty"` + // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` } -// GetNodeComplianceModulesetsParams defines parameters for GetNodeComplianceModulesets. -type GetNodeComplianceModulesetsParams struct { +// PostComplianceRulesetsJSONBody defines parameters for PostComplianceRulesets. +type PostComplianceRulesetsJSONBody struct { + RulesetName *string `json:"ruleset_name,omitempty"` + + // RulesetPublic A boolean, or "T" / "F" as stored. + RulesetPublic interface{} `json:"ruleset_public,omitempty"` + RulesetType *PostComplianceRulesetsJSONBodyRulesetType `json:"ruleset_type,omitempty"` +} + +// PostComplianceRulesetsJSONBodyRulesetType defines parameters for PostComplianceRulesets. +type PostComplianceRulesetsJSONBodyRulesetType string + +// GetComplianceRulesetParams defines parameters for GetComplianceRuleset. +type GetComplianceRulesetParams struct { + // Props A list of properties to include in each data dictionnary. + Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` +} + +// PostComplianceRulesetJSONBody defines parameters for PostComplianceRuleset. +type PostComplianceRulesetJSONBody struct { + RulesetName *string `json:"ruleset_name,omitempty"` + + // RulesetPublic A boolean, or "T" / "F" as stored. + RulesetPublic interface{} `json:"ruleset_public,omitempty"` + RulesetType *PostComplianceRulesetJSONBodyRulesetType `json:"ruleset_type,omitempty"` +} + +// PostComplianceRulesetJSONBodyRulesetType defines parameters for PostComplianceRuleset. +type PostComplianceRulesetJSONBodyRulesetType string + +// PutComplianceRulesetJSONBody defines parameters for PutComplianceRuleset. +type PutComplianceRulesetJSONBody struct { + Action PutComplianceRulesetJSONBodyAction `json:"action"` +} + +// PutComplianceRulesetJSONBodyAction defines parameters for PutComplianceRuleset. +type PutComplianceRulesetJSONBodyAction string + +// GetComplianceRulesetCandidateNodesParams defines parameters for GetComplianceRulesetCandidateNodes. +type GetComplianceRulesetCandidateNodesParams struct { // Props A list of properties to include in each data dictionnary. Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` @@ -1724,7 +3035,10 @@ type GetNodeComplianceModulesetsParams struct { // Offset Skip the first entries of the data cursor. Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` - // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit the meta field. + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. @@ -1733,15 +3047,28 @@ type GetNodeComplianceModulesetsParams struct { // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` + // Filter Column filter, repeatable; several filters combine with AND. Each value is + // `prop:expr`, `prop` being a property of the list (joined ones included, as + // for orderby) and `expr` one of: + // - text: case-insensitive match anywhere in the value; + // - `~regex`: regular expression (RE2 syntax), case-insensitive; + // - `in:a,b,c`: one of the listed values; + // - `eq:v`, `ne:v`: equal, not equal; + // - `gt:v`, `gte:v`, `lt:v`, `lte:v`: comparisons, for numbers and dates; + // - `empty`, `!empty`: no value, any value. + // An unknown property, a property without a column, or an invalid regular + // expression is answered with 400. + Filter *InQueryFilter `form:"filter,omitempty" json:"filter,omitempty"` + // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` } -// PostNodeComplianceModulesetJSONBody defines parameters for PostNodeComplianceModuleset. -type PostNodeComplianceModulesetJSONBody = map[string]interface{} +// GetComplianceRulesetCandidateServicesParams defines parameters for GetComplianceRulesetCandidateServices. +type GetComplianceRulesetCandidateServicesParams struct { + // Slave With true, the encapsulated services + Slave *bool `form:"slave,omitempty" json:"slave,omitempty"` -// GetNodeComplianceRulesetsParams defines parameters for GetNodeComplianceRulesets. -type GetNodeComplianceRulesetsParams struct { // Props A list of properties to include in each data dictionnary. Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` @@ -1751,7 +3078,10 @@ type GetNodeComplianceRulesetsParams struct { // Offset Skip the first entries of the data cursor. Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` - // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit the meta field. + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. @@ -1760,15 +3090,25 @@ type GetNodeComplianceRulesetsParams struct { // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` + // Filter Column filter, repeatable; several filters combine with AND. Each value is + // `prop:expr`, `prop` being a property of the list (joined ones included, as + // for orderby) and `expr` one of: + // - text: case-insensitive match anywhere in the value; + // - `~regex`: regular expression (RE2 syntax), case-insensitive; + // - `in:a,b,c`: one of the listed values; + // - `eq:v`, `ne:v`: equal, not equal; + // - `gt:v`, `gte:v`, `lt:v`, `lte:v`: comparisons, for numbers and dates; + // - `empty`, `!empty`: no value, any value. + // An unknown property, a property without a column, or an invalid regular + // expression is answered with 400. + Filter *InQueryFilter `form:"filter,omitempty" json:"filter,omitempty"` + // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` } -// PostNodeComplianceRulesetJSONBody defines parameters for PostNodeComplianceRuleset. -type PostNodeComplianceRulesetJSONBody = map[string]interface{} - -// GetNodeComplianceStatusParams defines parameters for GetNodeComplianceStatus. -type GetNodeComplianceStatusParams struct { +// GetComplianceRulesetNodesParams defines parameters for GetComplianceRulesetNodes. +type GetComplianceRulesetNodesParams struct { // Props A list of properties to include in each data dictionnary. Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` @@ -1778,7 +3118,10 @@ type GetNodeComplianceStatusParams struct { // Offset Skip the first entries of the data cursor. Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` - // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit the meta field. + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. @@ -1787,12 +3130,25 @@ type GetNodeComplianceStatusParams struct { // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` + // Filter Column filter, repeatable; several filters combine with AND. Each value is + // `prop:expr`, `prop` being a property of the list (joined ones included, as + // for orderby) and `expr` one of: + // - text: case-insensitive match anywhere in the value; + // - `~regex`: regular expression (RE2 syntax), case-insensitive; + // - `in:a,b,c`: one of the listed values; + // - `eq:v`, `ne:v`: equal, not equal; + // - `gt:v`, `gte:v`, `lt:v`, `lte:v`: comparisons, for numbers and dates; + // - `empty`, `!empty`: no value, any value. + // An unknown property, a property without a column, or an invalid regular + // expression is answered with 400. + Filter *InQueryFilter `form:"filter,omitempty" json:"filter,omitempty"` + // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` } -// GetNodeDisksParams defines parameters for GetNodeDisks. -type GetNodeDisksParams struct { +// GetComplianceRulesetPublicationsParams defines parameters for GetComplianceRulesetPublications. +type GetComplianceRulesetPublicationsParams struct { // Props A list of properties to include in each data dictionnary. Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` @@ -1802,7 +3158,10 @@ type GetNodeDisksParams struct { // Offset Skip the first entries of the data cursor. Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` - // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit the meta field. + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. @@ -1811,12 +3170,25 @@ type GetNodeDisksParams struct { // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` + // Filter Column filter, repeatable; several filters combine with AND. Each value is + // `prop:expr`, `prop` being a property of the list (joined ones included, as + // for orderby) and `expr` one of: + // - text: case-insensitive match anywhere in the value; + // - `~regex`: regular expression (RE2 syntax), case-insensitive; + // - `in:a,b,c`: one of the listed values; + // - `eq:v`, `ne:v`: equal, not equal; + // - `gt:v`, `gte:v`, `lt:v`, `lte:v`: comparisons, for numbers and dates; + // - `empty`, `!empty`: no value, any value. + // An unknown property, a property without a column, or an invalid regular + // expression is answered with 400. + Filter *InQueryFilter `form:"filter,omitempty" json:"filter,omitempty"` + // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` } -// GetNodeHardwareParams defines parameters for GetNodeHardware. -type GetNodeHardwareParams struct { +// GetComplianceRulesetResponsiblesParams defines parameters for GetComplianceRulesetResponsibles. +type GetComplianceRulesetResponsiblesParams struct { // Props A list of properties to include in each data dictionnary. Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` @@ -1826,7 +3198,10 @@ type GetNodeHardwareParams struct { // Offset Skip the first entries of the data cursor. Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` - // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit the meta field. + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. @@ -1835,12 +3210,28 @@ type GetNodeHardwareParams struct { // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` + // Filter Column filter, repeatable; several filters combine with AND. Each value is + // `prop:expr`, `prop` being a property of the list (joined ones included, as + // for orderby) and `expr` one of: + // - text: case-insensitive match anywhere in the value; + // - `~regex`: regular expression (RE2 syntax), case-insensitive; + // - `in:a,b,c`: one of the listed values; + // - `eq:v`, `ne:v`: equal, not equal; + // - `gt:v`, `gte:v`, `lt:v`, `lte:v`: comparisons, for numbers and dates; + // - `empty`, `!empty`: no value, any value. + // An unknown property, a property without a column, or an invalid regular + // expression is answered with 400. + Filter *InQueryFilter `form:"filter,omitempty" json:"filter,omitempty"` + // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` } -// GetNodeHbasParams defines parameters for GetNodeHbas. -type GetNodeHbasParams struct { +// GetComplianceRulesetServicesParams defines parameters for GetComplianceRulesetServices. +type GetComplianceRulesetServicesParams struct { + // Slave With true, the encapsulated services + Slave *bool `form:"slave,omitempty" json:"slave,omitempty"` + // Props A list of properties to include in each data dictionnary. Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` @@ -1850,7 +3241,10 @@ type GetNodeHbasParams struct { // Offset Skip the first entries of the data cursor. Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` - // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit the meta field. + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. @@ -1859,12 +3253,25 @@ type GetNodeHbasParams struct { // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` + // Filter Column filter, repeatable; several filters combine with AND. Each value is + // `prop:expr`, `prop` being a property of the list (joined ones included, as + // for orderby) and `expr` one of: + // - text: case-insensitive match anywhere in the value; + // - `~regex`: regular expression (RE2 syntax), case-insensitive; + // - `in:a,b,c`: one of the listed values; + // - `eq:v`, `ne:v`: equal, not equal; + // - `gt:v`, `gte:v`, `lt:v`, `lte:v`: comparisons, for numbers and dates; + // - `empty`, `!empty`: no value, any value. + // An unknown property, a property without a column, or an invalid regular + // expression is answered with 400. + Filter *InQueryFilter `form:"filter,omitempty" json:"filter,omitempty"` + // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` } -// GetNodeInterfacesParams defines parameters for GetNodeInterfaces. -type GetNodeInterfacesParams struct { +// GetComplianceRulesetVariablesParams defines parameters for GetComplianceRulesetVariables. +type GetComplianceRulesetVariablesParams struct { // Props A list of properties to include in each data dictionnary. Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` @@ -1874,7 +3281,10 @@ type GetNodeInterfacesParams struct { // Offset Skip the first entries of the data cursor. Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` - // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit the meta field. + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. @@ -1883,36 +3293,138 @@ type GetNodeInterfacesParams struct { // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` + // Filter Column filter, repeatable; several filters combine with AND. Each value is + // `prop:expr`, `prop` being a property of the list (joined ones included, as + // for orderby) and `expr` one of: + // - text: case-insensitive match anywhere in the value; + // - `~regex`: regular expression (RE2 syntax), case-insensitive; + // - `in:a,b,c`: one of the listed values; + // - `eq:v`, `ne:v`: equal, not equal; + // - `gt:v`, `gte:v`, `lt:v`, `lte:v`: comparisons, for numbers and dates; + // - `empty`, `!empty`: no value, any value. + // An unknown property, a property without a column, or an invalid regular + // expression is answered with 400. + Filter *InQueryFilter `form:"filter,omitempty" json:"filter,omitempty"` + // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` } -// GetNodeIpsParams defines parameters for GetNodeIps. -type GetNodeIpsParams struct { +// PostComplianceRulesetVariablesJSONBody defines parameters for PostComplianceRulesetVariables. +type PostComplianceRulesetVariablesJSONBody struct { + // VarClass The class of the variable, telling the modules how to read its value. + VarClass *string `json:"var_class,omitempty"` + VarName *string `json:"var_name,omitempty"` + + // VarValue The value, a string or any JSON value, stored serialized. + VarValue interface{} `json:"var_value,omitempty"` +} + +// GetComplianceRulesetVariableParams defines parameters for GetComplianceRulesetVariable. +type GetComplianceRulesetVariableParams struct { // Props A list of properties to include in each data dictionnary. Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` +} - // Limit The maximum number of entries to return. 0 means no limit. - Limit *InQueryLimit `form:"limit,omitempty" json:"limit,omitempty"` +// PostComplianceRulesetVariableJSONBody defines parameters for PostComplianceRulesetVariable. +type PostComplianceRulesetVariableJSONBody struct { + // VarClass The class of the variable, telling the modules how to read its value. + VarClass *string `json:"var_class,omitempty"` + VarName *string `json:"var_name,omitempty"` - // Offset Skip the first entries of the data cursor. - Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` + // VarValue The value, a string or any JSON value, stored serialized. + VarValue interface{} `json:"var_value,omitempty"` +} - // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit the meta field. - Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` +// PutComplianceRulesetVariableJSONBody defines parameters for PutComplianceRulesetVariable. +type PutComplianceRulesetVariableJSONBody struct { + Action PutComplianceRulesetVariableJSONBodyAction `json:"action"` - // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. - Stats *InQueryStats `form:"stats,omitempty" json:"stats,omitempty"` + // DstRuleset Id or name of the destination ruleset + DstRuleset interface{} `json:"dst_ruleset"` +} - // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). - Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` +// PutComplianceRulesetVariableJSONBodyAction defines parameters for PutComplianceRulesetVariable. +type PutComplianceRulesetVariableJSONBodyAction string - // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). - Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` +// DeleteComplianceRulesetsNodesJSONBody defines parameters for DeleteComplianceRulesetsNodes. +type DeleteComplianceRulesetsNodesJSONBody struct { + NodeId string `json:"node_id"` + + // RulesetId Ruleset id or name + RulesetId interface{} `json:"ruleset_id,omitempty"` + RulesetName *string `json:"ruleset_name,omitempty"` } -// GetNodeServicesParams defines parameters for GetNodeServices. -type GetNodeServicesParams struct { +// PostComplianceRulesetsNodesJSONBody defines parameters for PostComplianceRulesetsNodes. +type PostComplianceRulesetsNodesJSONBody struct { + NodeId string `json:"node_id"` + + // RulesetId Ruleset id or name + RulesetId interface{} `json:"ruleset_id,omitempty"` + RulesetName *string `json:"ruleset_name,omitempty"` +} + +// DeleteComplianceRulesetsPublicationsJSONBody defines parameters for DeleteComplianceRulesetsPublications. +type DeleteComplianceRulesetsPublicationsJSONBody struct { + // GroupId Group id or role + GroupId interface{} `json:"group_id"` + + // RulesetId Ruleset id or name + RulesetId interface{} `json:"ruleset_id"` +} + +// PostComplianceRulesetsPublicationsJSONBody defines parameters for PostComplianceRulesetsPublications. +type PostComplianceRulesetsPublicationsJSONBody struct { + // GroupId Group id or role + GroupId interface{} `json:"group_id"` + + // RulesetId Ruleset id or name + RulesetId interface{} `json:"ruleset_id"` +} + +// DeleteComplianceRulesetsResponsiblesJSONBody defines parameters for DeleteComplianceRulesetsResponsibles. +type DeleteComplianceRulesetsResponsiblesJSONBody struct { + // GroupId Group id or role + GroupId interface{} `json:"group_id"` + + // RulesetId Ruleset id or name + RulesetId interface{} `json:"ruleset_id"` +} + +// PostComplianceRulesetsResponsiblesJSONBody defines parameters for PostComplianceRulesetsResponsibles. +type PostComplianceRulesetsResponsiblesJSONBody struct { + // GroupId Group id or role + GroupId interface{} `json:"group_id"` + + // RulesetId Ruleset id or name + RulesetId interface{} `json:"ruleset_id"` +} + +// DeleteComplianceRulesetsServicesJSONBody defines parameters for DeleteComplianceRulesetsServices. +type DeleteComplianceRulesetsServicesJSONBody struct { + // RulesetId Ruleset id or name + RulesetId interface{} `json:"ruleset_id,omitempty"` + RulesetName *string `json:"ruleset_name,omitempty"` + + // Slave A boolean; true for the encapsulated service. encap is accepted as well. + Slave interface{} `json:"slave,omitempty"` + SvcId string `json:"svc_id"` +} + +// PostComplianceRulesetsServicesJSONBody defines parameters for PostComplianceRulesetsServices. +type PostComplianceRulesetsServicesJSONBody struct { + // RulesetId Ruleset id or name + RulesetId interface{} `json:"ruleset_id,omitempty"` + RulesetName *string `json:"ruleset_name,omitempty"` + + // Slave A boolean; true for the encapsulated service. encap is accepted as well. + Slave interface{} `json:"slave,omitempty"` + SvcId string `json:"svc_id"` +} + +// GetComplianceRulesetsVariablesParams defines parameters for GetComplianceRulesetsVariables. +type GetComplianceRulesetsVariablesParams struct { // Props A list of properties to include in each data dictionnary. Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` @@ -1922,7 +3434,10 @@ type GetNodeServicesParams struct { // Offset Skip the first entries of the data cursor. Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` - // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit the meta field. + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. @@ -1931,12 +3446,42 @@ type GetNodeServicesParams struct { // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` + // Filter Column filter, repeatable; several filters combine with AND. Each value is + // `prop:expr`, `prop` being a property of the list (joined ones included, as + // for orderby) and `expr` one of: + // - text: case-insensitive match anywhere in the value; + // - `~regex`: regular expression (RE2 syntax), case-insensitive; + // - `in:a,b,c`: one of the listed values; + // - `eq:v`, `ne:v`: equal, not equal; + // - `gt:v`, `gte:v`, `lt:v`, `lte:v`: comparisons, for numbers and dates; + // - `empty`, `!empty`: no value, any value. + // An unknown property, a property without a column, or an invalid regular + // expression is answered with 400. + Filter *InQueryFilter `form:"filter,omitempty" json:"filter,omitempty"` + // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` } -// GetNodeServiceParams defines parameters for GetNodeService. -type GetNodeServiceParams struct { +// PostComplianceRulesetsVariablesJSONBody defines parameters for PostComplianceRulesetsVariables. +type PostComplianceRulesetsVariablesJSONBody struct { + RulesetId *int `json:"ruleset_id,omitempty"` + RulesetName *string `json:"ruleset_name,omitempty"` + VarClass *string `json:"var_class,omitempty"` + VarName *string `json:"var_name,omitempty"` + + // VarValue The value, a string or any JSON value, stored serialized. + VarValue interface{} `json:"var_value,omitempty"` +} + +// DeleteComplianceStatusJSONBody defines parameters for DeleteComplianceStatus. +type DeleteComplianceStatusJSONBody struct { + // Id Id of the run (comp_status.id) + Id *int `json:"id,omitempty"` +} + +// GetComplianceStatusParams defines parameters for GetComplianceStatus. +type GetComplianceStatusParams struct { // Props A list of properties to include in each data dictionnary. Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` @@ -1946,7 +3491,10 @@ type GetNodeServiceParams struct { // Offset Skip the first entries of the data cursor. Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` - // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit the meta field. + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. @@ -1955,18 +3503,37 @@ type GetNodeServiceParams struct { // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` + // Filter Column filter, repeatable; several filters combine with AND. Each value is + // `prop:expr`, `prop` being a property of the list (joined ones included, as + // for orderby) and `expr` one of: + // - text: case-insensitive match anywhere in the value; + // - `~regex`: regular expression (RE2 syntax), case-insensitive; + // - `in:a,b,c`: one of the listed values; + // - `eq:v`, `ne:v`: equal, not equal; + // - `gt:v`, `gte:v`, `lt:v`, `lte:v`: comparisons, for numbers and dates; + // - `empty`, `!empty`: no value, any value. + // An unknown property, a property without a column, or an invalid regular + // expression is answered with 400. + Filter *InQueryFilter `form:"filter,omitempty" json:"filter,omitempty"` + // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` } -// PostNodeSnoozeJSONBody defines parameters for PostNodeSnooze. -type PostNodeSnoozeJSONBody struct { - // Duration Duration string (e.g. "1h", "30m", "2d"). Omit to unsnooze. - Duration *string `json:"duration,omitempty"` +// GetComplianceStatusRunParams defines parameters for GetComplianceStatusRun. +type GetComplianceStatusRunParams struct { + // Props A list of properties to include in each data dictionnary. + Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` } -// GetNodeTagsParams defines parameters for GetNodeTags. -type GetNodeTagsParams struct { +// DeleteDisksJSONBody defines parameters for DeleteDisks. +type DeleteDisksJSONBody struct { + // DiskId Disk identifier + DiskId string `json:"disk_id"` +} + +// GetDisksParams defines parameters for GetDisks. +type GetDisksParams struct { // Props A list of properties to include in each data dictionnary. Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` @@ -1976,7 +3543,10 @@ type GetNodeTagsParams struct { // Offset Skip the first entries of the data cursor. Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` - // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit the meta field. + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. @@ -1987,16 +3557,38 @@ type GetNodeTagsParams struct { // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` + + // Filter Column filter, repeatable; several filters combine with AND. Each value is + // `prop:expr`, `prop` being a property of the list (joined ones included, as + // for orderby) and `expr` one of: + // - text: case-insensitive match anywhere in the value; + // - `~regex`: regular expression (RE2 syntax), case-insensitive; + // - `in:a,b,c`: one of the listed values; + // - `eq:v`, `ne:v`: equal, not equal; + // - `gt:v`, `gte:v`, `lt:v`, `lte:v`: comparisons, for numbers and dates; + // - `empty`, `!empty`: no value, any value. + // An unknown property, a property without a column, or an invalid regular + // expression is answered with 400. + Filter *InQueryFilter `form:"filter,omitempty" json:"filter,omitempty"` } -// DeleteObsolescenceSettingsJSONBody defines parameters for DeleteObsolescenceSettings. -type DeleteObsolescenceSettingsJSONBody struct { - // Id Obsolescence setting record id - Id string `json:"id"` +// PostDisksJSONBody defines parameters for PostDisks. +type PostDisksJSONBody struct { + DiskAlloc *int64 `json:"disk_alloc,omitempty"` + DiskArrayid string `json:"disk_arrayid"` + DiskController *string `json:"disk_controller,omitempty"` + DiskDevid *string `json:"disk_devid,omitempty"` + DiskGroup *string `json:"disk_group,omitempty"` + DiskId string `json:"disk_id"` + DiskLevel *int `json:"disk_level,omitempty"` + DiskName *string `json:"disk_name,omitempty"` + DiskRaid *string `json:"disk_raid,omitempty"` + DiskSize *int64 `json:"disk_size,omitempty"` + DiskUpdated *string `json:"disk_updated,omitempty"` } -// GetObsolescenceSettingsParams defines parameters for GetObsolescenceSettings. -type GetObsolescenceSettingsParams struct { +// GetDiskParams defines parameters for GetDisk. +type GetDiskParams struct { // Props A list of properties to include in each data dictionnary. Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` @@ -2006,7 +3598,10 @@ type GetObsolescenceSettingsParams struct { // Offset Skip the first entries of the data cursor. Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` - // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit the meta field. + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. @@ -2019,20 +3614,14 @@ type GetObsolescenceSettingsParams struct { Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` } -// PostObsolescenceSettingsJSONBody defines parameters for PostObsolescenceSettings. -type PostObsolescenceSettingsJSONBody struct { - // Id Obsolescence setting record id +// DeleteFiltersJSONBody defines parameters for DeleteFilters. +type DeleteFiltersJSONBody struct { + // Id Filter record id, or filter label Id string `json:"id"` - - // ObsAlertDate Date from which nodes matching this setting are flagged as obsolete - ObsAlertDate *string `json:"obs_alert_date,omitempty"` - - // ObsWarnDate Date from which nodes matching this setting are flagged as a warning - ObsWarnDate *string `json:"obs_warn_date,omitempty"` } -// GetObsolescenceSettingParams defines parameters for GetObsolescenceSetting. -type GetObsolescenceSettingParams struct { +// GetFiltersParams defines parameters for GetFilters. +type GetFiltersParams struct { // Props A list of properties to include in each data dictionnary. Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` @@ -2042,7 +3631,10 @@ type GetObsolescenceSettingParams struct { // Offset Skip the first entries of the data cursor. Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` - // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit the meta field. + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. @@ -2055,23 +3647,26 @@ type GetObsolescenceSettingParams struct { Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` } -// PostObsolescenceSettingJSONBody defines parameters for PostObsolescenceSetting. -type PostObsolescenceSettingJSONBody struct { - // ObsAlertDate Date from which nodes matching this setting are flagged as obsolete - ObsAlertDate *string `json:"obs_alert_date,omitempty"` +// PostFiltersJSONBody defines parameters for PostFilters. +type PostFiltersJSONBody struct { + // FField Column of f_table the filter applies to + FField string `json:"f_field"` - // ObsWarnDate Date from which nodes matching this setting are flagged as a warning - ObsWarnDate *string `json:"obs_warn_date,omitempty"` -} + // FOp Comparison operator + FOp PostFiltersJSONBodyFOp `json:"f_op"` -// DeleteServicesJSONBody defines parameters for DeleteServices. -type DeleteServicesJSONBody struct { - // SvcId Service id or name - SvcId string `json:"svc_id"` + // FTable Table the filter applies to + FTable string `json:"f_table"` + + // FValue Value to compare the column to + FValue string `json:"f_value"` } -// GetServicesParams defines parameters for GetServices. -type GetServicesParams struct { +// PostFiltersJSONBodyFOp defines parameters for PostFilters. +type PostFiltersJSONBodyFOp string + +// GetFilterParams defines parameters for GetFilter. +type GetFilterParams struct { // Props A list of properties to include in each data dictionnary. Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` @@ -2081,7 +3676,10 @@ type GetServicesParams struct { // Offset Skip the first entries of the data cursor. Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` - // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit the meta field. + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. @@ -2094,37 +3692,28 @@ type GetServicesParams struct { Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` } -// PostServicesJSONBody defines parameters for PostServices. -type PostServicesJSONBody struct { - ClusterId *string `json:"cluster_id,omitempty"` - SvcApp *string `json:"svc_app,omitempty"` - SvcAutostart *string `json:"svc_autostart,omitempty"` - SvcComment *string `json:"svc_comment,omitempty"` - SvcDrnoaction *string `json:"svc_drnoaction,omitempty"` - SvcDrpnode *string `json:"svc_drpnode,omitempty"` - SvcDrpnodes *string `json:"svc_drpnodes,omitempty"` - SvcDrptype *string `json:"svc_drptype,omitempty"` - SvcEnv *string `json:"svc_env,omitempty"` - SvcFlexCpuHighThreshold *int `json:"svc_flex_cpu_high_threshold,omitempty"` - SvcFlexCpuLowThreshold *int `json:"svc_flex_cpu_low_threshold,omitempty"` - SvcFlexMaxNodes *int `json:"svc_flex_max_nodes,omitempty"` - SvcFlexMinNodes *int `json:"svc_flex_min_nodes,omitempty"` - SvcFrozen *string `json:"svc_frozen,omitempty"` - SvcHa *string `json:"svc_ha,omitempty"` - SvcId *string `json:"svc_id,omitempty"` - SvcMetrocluster *string `json:"svc_metrocluster,omitempty"` - SvcNodes *string `json:"svc_nodes,omitempty"` - SvcNotifications *bool `json:"svc_notifications,omitempty"` - SvcPlacement *string `json:"svc_placement,omitempty"` - SvcProvisioned *string `json:"svc_provisioned,omitempty"` - SvcSnoozeTill *string `json:"svc_snooze_till,omitempty"` - SvcTopology *string `json:"svc_topology,omitempty"` - SvcWave *int `json:"svc_wave,omitempty"` - Svcname *string `json:"svcname,omitempty"` +// PostFilterJSONBody defines parameters for PostFilter. +type PostFilterJSONBody struct { + FField *string `json:"f_field,omitempty"` + + // FLabel Rejected with a 400; the label is computed from the definition. + FLabel *string `json:"f_label,omitempty"` + FOp *PostFilterJSONBodyFOp `json:"f_op,omitempty"` + FTable *string `json:"f_table,omitempty"` + FValue *string `json:"f_value,omitempty"` } -// GetServiceParams defines parameters for GetService. -type GetServiceParams struct { +// PostFilterJSONBodyFOp defines parameters for PostFilter. +type PostFilterJSONBodyFOp string + +// DeleteFiltersetsJSONBody defines parameters for DeleteFiltersets. +type DeleteFiltersetsJSONBody struct { + // Id Filterset record id, or filterset name + Id string `json:"id"` +} + +// GetFiltersetsParams defines parameters for GetFiltersets. +type GetFiltersetsParams struct { // Props A list of properties to include in each data dictionnary. Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` @@ -2134,7 +3723,10 @@ type GetServiceParams struct { // Offset Skip the first entries of the data cursor. Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` - // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit the meta field. + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. @@ -2145,37 +3737,38 @@ type GetServiceParams struct { // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` + + // Filter Column filter, repeatable; several filters combine with AND. Each value is + // `prop:expr`, `prop` being a property of the list (joined ones included, as + // for orderby) and `expr` one of: + // - text: case-insensitive match anywhere in the value; + // - `~regex`: regular expression (RE2 syntax), case-insensitive; + // - `in:a,b,c`: one of the listed values; + // - `eq:v`, `ne:v`: equal, not equal; + // - `gt:v`, `gte:v`, `lt:v`, `lte:v`: comparisons, for numbers and dates; + // - `empty`, `!empty`: no value, any value. + // An unknown property, a property without a column, or an invalid regular + // expression is answered with 400. + Filter *InQueryFilter `form:"filter,omitempty" json:"filter,omitempty"` } -// PostServiceJSONBody defines parameters for PostService. -type PostServiceJSONBody struct { - SvcApp *string `json:"svc_app,omitempty"` - SvcAutostart *string `json:"svc_autostart,omitempty"` - SvcComment *string `json:"svc_comment,omitempty"` - SvcDrnoaction *string `json:"svc_drnoaction,omitempty"` - SvcDrpnode *string `json:"svc_drpnode,omitempty"` - SvcDrpnodes *string `json:"svc_drpnodes,omitempty"` - SvcDrptype *string `json:"svc_drptype,omitempty"` - SvcEnv *string `json:"svc_env,omitempty"` - SvcFlexCpuHighThreshold *int `json:"svc_flex_cpu_high_threshold,omitempty"` - SvcFlexCpuLowThreshold *int `json:"svc_flex_cpu_low_threshold,omitempty"` - SvcFlexMaxNodes *int `json:"svc_flex_max_nodes,omitempty"` - SvcFlexMinNodes *int `json:"svc_flex_min_nodes,omitempty"` - SvcFrozen *string `json:"svc_frozen,omitempty"` - SvcHa *string `json:"svc_ha,omitempty"` - SvcMetrocluster *string `json:"svc_metrocluster,omitempty"` - SvcNodes *string `json:"svc_nodes,omitempty"` - SvcNotifications *bool `json:"svc_notifications,omitempty"` - SvcPlacement *string `json:"svc_placement,omitempty"` - SvcProvisioned *string `json:"svc_provisioned,omitempty"` - SvcSnoozeTill *string `json:"svc_snooze_till,omitempty"` - SvcTopology *string `json:"svc_topology,omitempty"` - SvcWave *int `json:"svc_wave,omitempty"` - Svcname *string `json:"svcname,omitempty"` +// PostFiltersetsJSONBody defines parameters for PostFiltersets. +type PostFiltersetsJSONBody struct { + // FsetName Name of the filterset to create, or of the filterset to update + FsetName *string `json:"fset_name,omitempty"` + + // FsetStats Whether the filterset is a stats filterset (T or F) + FsetStats *PostFiltersetsJSONBodyFsetStats `json:"fset_stats,omitempty"` + + // Id Filterset record id or name, to update an existing filterset + Id *string `json:"id,omitempty"` } -// GetServiceAlertsParams defines parameters for GetServiceAlerts. -type GetServiceAlertsParams struct { +// PostFiltersetsJSONBodyFsetStats defines parameters for PostFiltersets. +type PostFiltersetsJSONBodyFsetStats string + +// GetFiltersetParams defines parameters for GetFilterset. +type GetFiltersetParams struct { // Props A list of properties to include in each data dictionnary. Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` @@ -2185,7 +3778,10 @@ type GetServiceAlertsParams struct { // Offset Skip the first entries of the data cursor. Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` - // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit the meta field. + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. @@ -2198,8 +3794,17 @@ type GetServiceAlertsParams struct { Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` } -// GetServiceCandidateTagsParams defines parameters for GetServiceCandidateTags. -type GetServiceCandidateTagsParams struct { +// PostFiltersetJSONBody defines parameters for PostFilterset. +type PostFiltersetJSONBody struct { + FsetName *string `json:"fset_name,omitempty"` + FsetStats *PostFiltersetJSONBodyFsetStats `json:"fset_stats,omitempty"` +} + +// PostFiltersetJSONBodyFsetStats defines parameters for PostFilterset. +type PostFiltersetJSONBodyFsetStats string + +// GetFiltersetFiltersParams defines parameters for GetFiltersetFilters. +type GetFiltersetFiltersParams struct { // Props A list of properties to include in each data dictionnary. Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` @@ -2209,7 +3814,10 @@ type GetServiceCandidateTagsParams struct { // Offset Skip the first entries of the data cursor. Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` - // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit the meta field. + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. @@ -2222,8 +3830,17 @@ type GetServiceCandidateTagsParams struct { Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` } -// GetServiceChecksParams defines parameters for GetServiceChecks. -type GetServiceChecksParams struct { +// PostFiltersetFilterJSONBody defines parameters for PostFiltersetFilter. +type PostFiltersetFilterJSONBody struct { + FLogOp *PostFiltersetFilterJSONBodyFLogOp `json:"f_log_op,omitempty"` + FOrder *int `json:"f_order,omitempty"` +} + +// PostFiltersetFilterJSONBodyFLogOp defines parameters for PostFiltersetFilter. +type PostFiltersetFilterJSONBodyFLogOp string + +// GetFiltersetFiltersetsParams defines parameters for GetFiltersetFiltersets. +type GetFiltersetFiltersetsParams struct { // Props A list of properties to include in each data dictionnary. Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` @@ -2233,7 +3850,10 @@ type GetServiceChecksParams struct { // Offset Skip the first entries of the data cursor. Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` - // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit the meta field. + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. @@ -2246,8 +3866,17 @@ type GetServiceChecksParams struct { Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` } -// GetServiceComplianceCandidateModulesetsParams defines parameters for GetServiceComplianceCandidateModulesets. -type GetServiceComplianceCandidateModulesetsParams struct { +// PostFiltersetFiltersetJSONBody defines parameters for PostFiltersetFilterset. +type PostFiltersetFiltersetJSONBody struct { + FLogOp *PostFiltersetFiltersetJSONBodyFLogOp `json:"f_log_op,omitempty"` + FOrder *int `json:"f_order,omitempty"` +} + +// PostFiltersetFiltersetJSONBodyFLogOp defines parameters for PostFiltersetFilterset. +type PostFiltersetFiltersetJSONBodyFLogOp string + +// GetFiltersetNodesParams defines parameters for GetFiltersetNodes. +type GetFiltersetNodesParams struct { // Props A list of properties to include in each data dictionnary. Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` @@ -2257,7 +3886,10 @@ type GetServiceComplianceCandidateModulesetsParams struct { // Offset Skip the first entries of the data cursor. Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` - // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit the meta field. + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. @@ -2266,15 +3898,25 @@ type GetServiceComplianceCandidateModulesetsParams struct { // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` + // Filter Column filter, repeatable; several filters combine with AND. Each value is + // `prop:expr`, `prop` being a property of the list (joined ones included, as + // for orderby) and `expr` one of: + // - text: case-insensitive match anywhere in the value; + // - `~regex`: regular expression (RE2 syntax), case-insensitive; + // - `in:a,b,c`: one of the listed values; + // - `eq:v`, `ne:v`: equal, not equal; + // - `gt:v`, `gte:v`, `lt:v`, `lte:v`: comparisons, for numbers and dates; + // - `empty`, `!empty`: no value, any value. + // An unknown property, a property without a column, or an invalid regular + // expression is answered with 400. + Filter *InQueryFilter `form:"filter,omitempty" json:"filter,omitempty"` + // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` } -// GetServiceComplianceCandidateRulesetsParams defines parameters for GetServiceComplianceCandidateRulesets. -type GetServiceComplianceCandidateRulesetsParams struct { - // Slave If true, list rulesets attachable to the encapsulated service - Slave *bool `form:"slave,omitempty" json:"slave,omitempty"` - +// GetFiltersetServicesParams defines parameters for GetFiltersetServices. +type GetFiltersetServicesParams struct { // Props A list of properties to include in each data dictionnary. Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` @@ -2284,7 +3926,10 @@ type GetServiceComplianceCandidateRulesetsParams struct { // Offset Skip the first entries of the data cursor. Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` - // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit the meta field. + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. @@ -2293,39 +3938,102 @@ type GetServiceComplianceCandidateRulesetsParams struct { // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` + // Filter Column filter, repeatable; several filters combine with AND. Each value is + // `prop:expr`, `prop` being a property of the list (joined ones included, as + // for orderby) and `expr` one of: + // - text: case-insensitive match anywhere in the value; + // - `~regex`: regular expression (RE2 syntax), case-insensitive; + // - `in:a,b,c`: one of the listed values; + // - `eq:v`, `ne:v`: equal, not equal; + // - `gt:v`, `gte:v`, `lt:v`, `lte:v`: comparisons, for numbers and dates; + // - `empty`, `!empty`: no value, any value. + // An unknown property, a property without a column, or an invalid regular + // expression is answered with 400. + Filter *InQueryFilter `form:"filter,omitempty" json:"filter,omitempty"` + // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` } -// GetServiceComplianceLogsParams defines parameters for GetServiceComplianceLogs. -type GetServiceComplianceLogsParams struct { - // Props A list of properties to include in each data dictionnary. - Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` +// DeleteFiltersetsFiltersJSONBody defines parameters for DeleteFiltersetsFilters. +type DeleteFiltersetsFiltersJSONBody struct { + // FId Filter record id, or filter label + FId string `json:"f_id"` - // Limit The maximum number of entries to return. 0 means no limit. - Limit *InQueryLimit `form:"limit,omitempty" json:"limit,omitempty"` + // FsetId Filterset record id, or filterset name + FsetId string `json:"fset_id"` +} - // Offset Skip the first entries of the data cursor. - Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` +// PostFiltersetsFiltersJSONBody defines parameters for PostFiltersetsFilters. +type PostFiltersetsFiltersJSONBody struct { + // FId Filter record id, or filter label + FId string `json:"f_id"` - // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit the meta field. - Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` + // FLogOp Logical operator joining this filter to the previous one + FLogOp *PostFiltersetsFiltersJSONBodyFLogOp `json:"f_log_op,omitempty"` - // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. - Stats *InQueryStats `form:"stats,omitempty" json:"stats,omitempty"` + // FOrder Position of the filter in the filterset + FOrder *int `json:"f_order,omitempty"` - // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). - Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` + // FsetId Filterset record id, or filterset name + FsetId string `json:"fset_id"` +} - // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). - Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` +// PostFiltersetsFiltersJSONBodyFLogOp defines parameters for PostFiltersetsFilters. +type PostFiltersetsFiltersJSONBodyFLogOp string + +// DeleteFiltersetsFiltersetsJSONBody defines parameters for DeleteFiltersetsFiltersets. +type DeleteFiltersetsFiltersetsJSONBody struct { + // ChildFsetId Child filterset record id, or name + ChildFsetId string `json:"child_fset_id"` + + // ParentFsetId Parent filterset record id, or name + ParentFsetId string `json:"parent_fset_id"` } -// GetServiceComplianceModulesetsParams defines parameters for GetServiceComplianceModulesets. -type GetServiceComplianceModulesetsParams struct { - // Slave If true, list modulesets attached to the encapsulated service - Slave *bool `form:"slave,omitempty" json:"slave,omitempty"` +// PostFiltersetsFiltersetsJSONBody defines parameters for PostFiltersetsFiltersets. +type PostFiltersetsFiltersetsJSONBody struct { + // ChildFsetId Child filterset record id, or name + ChildFsetId string `json:"child_fset_id"` + + // FLogOp Logical operator joining this filterset to the previous entry + FLogOp *PostFiltersetsFiltersetsJSONBodyFLogOp `json:"f_log_op,omitempty"` + + // FOrder Position of the child filterset in the parent filterset + FOrder *int `json:"f_order,omitempty"` + + // ParentFsetId Parent filterset record id, or name + ParentFsetId string `json:"parent_fset_id"` +} + +// PostFiltersetsFiltersetsJSONBodyFLogOp defines parameters for PostFiltersetsFiltersets. +type PostFiltersetsFiltersetsJSONBodyFLogOp string + +// PutFormOutputResultsJSONBody defines parameters for PutFormOutputResults. +type PutFormOutputResultsJSONBody struct { + // Log The log lines to append to output_id logs, [[lvl, fmt, data], ...], lvl 0 for info, 1 for error + Log interface{} `json:"log,omitempty"` + + // OutputId The id of the form output for which to store the result + OutputId *string `json:"output_id,omitempty"` + + // Result The result to add for output_id, a JSON document or its string form + Result interface{} `json:"result,omitempty"` +} + +// DeleteFormsJSONBody defines parameters for DeleteForms. +type DeleteFormsJSONBody struct { + union json.RawMessage +} + +// DeleteFormsJSONBody0 defines parameters for DeleteForms. +type DeleteFormsJSONBody0 map[string]interface{} + +// DeleteFormsJSONBody1 defines parameters for DeleteForms. +type DeleteFormsJSONBody1 = []map[string]interface{} +// GetFormsParams defines parameters for GetForms. +type GetFormsParams struct { // Props A list of properties to include in each data dictionnary. Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` @@ -2335,7 +4043,10 @@ type GetServiceComplianceModulesetsParams struct { // Offset Skip the first entries of the data cursor. Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` - // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit the meta field. + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. @@ -2346,25 +4057,34 @@ type GetServiceComplianceModulesetsParams struct { // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` -} -// DeleteServiceComplianceModulesetParams defines parameters for DeleteServiceComplianceModuleset. -type DeleteServiceComplianceModulesetParams struct { - // Slave If true, detach from the encapsulated service - Slave *bool `form:"slave,omitempty" json:"slave,omitempty"` + // Filter Column filter, repeatable; several filters combine with AND. Each value is + // `prop:expr`, `prop` being a property of the list (joined ones included, as + // for orderby) and `expr` one of: + // - text: case-insensitive match anywhere in the value; + // - `~regex`: regular expression (RE2 syntax), case-insensitive; + // - `in:a,b,c`: one of the listed values; + // - `eq:v`, `ne:v`: equal, not equal; + // - `gt:v`, `gte:v`, `lt:v`, `lte:v`: comparisons, for numbers and dates; + // - `empty`, `!empty`: no value, any value. + // An unknown property, a property without a column, or an invalid regular + // expression is answered with 400. + Filter *InQueryFilter `form:"filter,omitempty" json:"filter,omitempty"` +} + +// PostFormsJSONBody defines parameters for PostForms. +type PostFormsJSONBody struct { + union json.RawMessage } -// PostServiceComplianceModulesetParams defines parameters for PostServiceComplianceModuleset. -type PostServiceComplianceModulesetParams struct { - // Slave If true, attach to the encapsulated service - Slave *bool `form:"slave,omitempty" json:"slave,omitempty"` -} +// PostFormsJSONBody0 defines parameters for PostForms. +type PostFormsJSONBody0 map[string]interface{} -// GetServiceComplianceRulesetsParams defines parameters for GetServiceComplianceRulesets. -type GetServiceComplianceRulesetsParams struct { - // Slave If true, list rulesets attached to the encapsulated service - Slave *bool `form:"slave,omitempty" json:"slave,omitempty"` +// PostFormsJSONBody1 defines parameters for PostForms. +type PostFormsJSONBody1 = []map[string]interface{} +// GetFormParams defines parameters for GetForm. +type GetFormParams struct { // Props A list of properties to include in each data dictionnary. Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` @@ -2374,7 +4094,10 @@ type GetServiceComplianceRulesetsParams struct { // Offset Skip the first entries of the data cursor. Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` - // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit the meta field. + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. @@ -2385,22 +4108,41 @@ type GetServiceComplianceRulesetsParams struct { // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` + + // Filter Column filter, repeatable; several filters combine with AND. Each value is + // `prop:expr`, `prop` being a property of the list (joined ones included, as + // for orderby) and `expr` one of: + // - text: case-insensitive match anywhere in the value; + // - `~regex`: regular expression (RE2 syntax), case-insensitive; + // - `in:a,b,c`: one of the listed values; + // - `eq:v`, `ne:v`: equal, not equal; + // - `gt:v`, `gte:v`, `lt:v`, `lte:v`: comparisons, for numbers and dates; + // - `empty`, `!empty`: no value, any value. + // An unknown property, a property without a column, or an invalid regular + // expression is answered with 400. + Filter *InQueryFilter `form:"filter,omitempty" json:"filter,omitempty"` } -// DeleteServiceComplianceRulesetParams defines parameters for DeleteServiceComplianceRuleset. -type DeleteServiceComplianceRulesetParams struct { - // Slave If true, detach from the encapsulated service - Slave *bool `form:"slave,omitempty" json:"slave,omitempty"` +// PostFormJSONBody defines parameters for PostForm. +type PostFormJSONBody map[string]interface{} + +// PutFormJSONBody defines parameters for PutForm. +type PutFormJSONBody struct { + // Data The information the form expects, as an object, a list of objects or their JSON string form. + Data interface{} `json:"data,omitempty"` + + // PrevWfid The previous step id in an existing workflow. + PrevWfid interface{} `json:"prev_wfid,omitempty"` } -// PostServiceComplianceRulesetParams defines parameters for PostServiceComplianceRuleset. -type PostServiceComplianceRulesetParams struct { - // Slave If true, attach to the encapsulated service - Slave *bool `form:"slave,omitempty" json:"slave,omitempty"` +// GetFormDiffParams defines parameters for GetFormDiff. +type GetFormDiffParams struct { + // Other Another revision to compare cid with + Other *string `form:"other,omitempty" json:"other,omitempty"` } -// GetServiceComplianceStatusParams defines parameters for GetServiceComplianceStatus. -type GetServiceComplianceStatusParams struct { +// GetFormPublicationsParams defines parameters for GetFormPublications. +type GetFormPublicationsParams struct { // Props A list of properties to include in each data dictionnary. Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` @@ -2410,7 +4152,10 @@ type GetServiceComplianceStatusParams struct { // Offset Skip the first entries of the data cursor. Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` - // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit the meta field. + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. @@ -2421,10 +4166,23 @@ type GetServiceComplianceStatusParams struct { // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` -} -// GetServiceDisksParams defines parameters for GetServiceDisks. -type GetServiceDisksParams struct { + // Filter Column filter, repeatable; several filters combine with AND. Each value is + // `prop:expr`, `prop` being a property of the list (joined ones included, as + // for orderby) and `expr` one of: + // - text: case-insensitive match anywhere in the value; + // - `~regex`: regular expression (RE2 syntax), case-insensitive; + // - `in:a,b,c`: one of the listed values; + // - `eq:v`, `ne:v`: equal, not equal; + // - `gt:v`, `gte:v`, `lt:v`, `lte:v`: comparisons, for numbers and dates; + // - `empty`, `!empty`: no value, any value. + // An unknown property, a property without a column, or an invalid regular + // expression is answered with 400. + Filter *InQueryFilter `form:"filter,omitempty" json:"filter,omitempty"` +} + +// GetFormResponsiblesParams defines parameters for GetFormResponsibles. +type GetFormResponsiblesParams struct { // Props A list of properties to include in each data dictionnary. Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` @@ -2434,7 +4192,10 @@ type GetServiceDisksParams struct { // Offset Skip the first entries of the data cursor. Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` - // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit the meta field. + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. @@ -2445,10 +4206,67 @@ type GetServiceDisksParams struct { // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` + + // Filter Column filter, repeatable; several filters combine with AND. Each value is + // `prop:expr`, `prop` being a property of the list (joined ones included, as + // for orderby) and `expr` one of: + // - text: case-insensitive match anywhere in the value; + // - `~regex`: regular expression (RE2 syntax), case-insensitive; + // - `in:a,b,c`: one of the listed values; + // - `eq:v`, `ne:v`: equal, not equal; + // - `gt:v`, `gte:v`, `lt:v`, `lte:v`: comparisons, for numbers and dates; + // - `empty`, `!empty`: no value, any value. + // An unknown property, a property without a column, or an invalid regular + // expression is answered with 400. + Filter *InQueryFilter `form:"filter,omitempty" json:"filter,omitempty"` +} + +// DeleteFormsPublicationsJSONBody defines parameters for DeleteFormsPublications. +type DeleteFormsPublicationsJSONBody struct { + union json.RawMessage } -// GetServiceInstanceParams defines parameters for GetServiceInstance. -type GetServiceInstanceParams struct { +// DeleteFormsPublicationsJSONBody0 defines parameters for DeleteFormsPublications. +type DeleteFormsPublicationsJSONBody0 map[string]interface{} + +// DeleteFormsPublicationsJSONBody1 defines parameters for DeleteFormsPublications. +type DeleteFormsPublicationsJSONBody1 = []map[string]interface{} + +// PostFormsPublicationsJSONBody defines parameters for PostFormsPublications. +type PostFormsPublicationsJSONBody struct { + union json.RawMessage +} + +// PostFormsPublicationsJSONBody0 defines parameters for PostFormsPublications. +type PostFormsPublicationsJSONBody0 map[string]interface{} + +// PostFormsPublicationsJSONBody1 defines parameters for PostFormsPublications. +type PostFormsPublicationsJSONBody1 = []map[string]interface{} + +// DeleteFormsResponsiblesJSONBody defines parameters for DeleteFormsResponsibles. +type DeleteFormsResponsiblesJSONBody struct { + union json.RawMessage +} + +// DeleteFormsResponsiblesJSONBody0 defines parameters for DeleteFormsResponsibles. +type DeleteFormsResponsiblesJSONBody0 map[string]interface{} + +// DeleteFormsResponsiblesJSONBody1 defines parameters for DeleteFormsResponsibles. +type DeleteFormsResponsiblesJSONBody1 = []map[string]interface{} + +// PostFormsResponsiblesJSONBody defines parameters for PostFormsResponsibles. +type PostFormsResponsiblesJSONBody struct { + union json.RawMessage +} + +// PostFormsResponsiblesJSONBody0 defines parameters for PostFormsResponsibles. +type PostFormsResponsiblesJSONBody0 map[string]interface{} + +// PostFormsResponsiblesJSONBody1 defines parameters for PostFormsResponsibles. +type PostFormsResponsiblesJSONBody1 = []map[string]interface{} + +// GetFormsRevisionsParams defines parameters for GetFormsRevisions. +type GetFormsRevisionsParams struct { // Props A list of properties to include in each data dictionnary. Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` @@ -2458,7 +4276,10 @@ type GetServiceInstanceParams struct { // Offset Skip the first entries of the data cursor. Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` - // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit the meta field. + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. @@ -2469,10 +4290,23 @@ type GetServiceInstanceParams struct { // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` -} -// GetServiceNodesParams defines parameters for GetServiceNodes. -type GetServiceNodesParams struct { + // Filter Column filter, repeatable; several filters combine with AND. Each value is + // `prop:expr`, `prop` being a property of the list (joined ones included, as + // for orderby) and `expr` one of: + // - text: case-insensitive match anywhere in the value; + // - `~regex`: regular expression (RE2 syntax), case-insensitive; + // - `in:a,b,c`: one of the listed values; + // - `eq:v`, `ne:v`: equal, not equal; + // - `gt:v`, `gte:v`, `lt:v`, `lte:v`: comparisons, for numbers and dates; + // - `empty`, `!empty`: no value, any value. + // An unknown property, a property without a column, or an invalid regular + // expression is answered with 400. + Filter *InQueryFilter `form:"filter,omitempty" json:"filter,omitempty"` +} + +// GetFormsRevisionParams defines parameters for GetFormsRevision. +type GetFormsRevisionParams struct { // Props A list of properties to include in each data dictionnary. Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` @@ -2482,7 +4316,10 @@ type GetServiceNodesParams struct { // Offset Skip the first entries of the data cursor. Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` - // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit the meta field. + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. @@ -2493,10 +4330,23 @@ type GetServiceNodesParams struct { // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` -} -// GetServiceNodeParams defines parameters for GetServiceNode. -type GetServiceNodeParams struct { + // Filter Column filter, repeatable; several filters combine with AND. Each value is + // `prop:expr`, `prop` being a property of the list (joined ones included, as + // for orderby) and `expr` one of: + // - text: case-insensitive match anywhere in the value; + // - `~regex`: regular expression (RE2 syntax), case-insensitive; + // - `in:a,b,c`: one of the listed values; + // - `eq:v`, `ne:v`: equal, not equal; + // - `gt:v`, `gte:v`, `lt:v`, `lte:v`: comparisons, for numbers and dates; + // - `empty`, `!empty`: no value, any value. + // An unknown property, a property without a column, or an invalid regular + // expression is answered with 400. + Filter *InQueryFilter `form:"filter,omitempty" json:"filter,omitempty"` +} + +// GetFormsStoreParams defines parameters for GetFormsStore. +type GetFormsStoreParams struct { // Props A list of properties to include in each data dictionnary. Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` @@ -2506,7 +4356,10 @@ type GetServiceNodeParams struct { // Offset Skip the first entries of the data cursor. Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` - // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit the meta field. + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. @@ -2517,10 +4370,23 @@ type GetServiceNodeParams struct { // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` -} -// GetServiceNodeResourcesParams defines parameters for GetServiceNodeResources. -type GetServiceNodeResourcesParams struct { + // Filter Column filter, repeatable; several filters combine with AND. Each value is + // `prop:expr`, `prop` being a property of the list (joined ones included, as + // for orderby) and `expr` one of: + // - text: case-insensitive match anywhere in the value; + // - `~regex`: regular expression (RE2 syntax), case-insensitive; + // - `in:a,b,c`: one of the listed values; + // - `eq:v`, `ne:v`: equal, not equal; + // - `gt:v`, `gte:v`, `lt:v`, `lte:v`: comparisons, for numbers and dates; + // - `empty`, `!empty`: no value, any value. + // An unknown property, a property without a column, or an invalid regular + // expression is answered with 400. + Filter *InQueryFilter `form:"filter,omitempty" json:"filter,omitempty"` +} + +// GetFormStoreParams defines parameters for GetFormStore. +type GetFormStoreParams struct { // Props A list of properties to include in each data dictionnary. Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` @@ -2530,7 +4396,10 @@ type GetServiceNodeResourcesParams struct { // Offset Skip the first entries of the data cursor. Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` - // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit the meta field. + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. @@ -2541,10 +4410,23 @@ type GetServiceNodeResourcesParams struct { // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` + + // Filter Column filter, repeatable; several filters combine with AND. Each value is + // `prop:expr`, `prop` being a property of the list (joined ones included, as + // for orderby) and `expr` one of: + // - text: case-insensitive match anywhere in the value; + // - `~regex`: regular expression (RE2 syntax), case-insensitive; + // - `in:a,b,c`: one of the listed values; + // - `eq:v`, `ne:v`: equal, not equal; + // - `gt:v`, `gte:v`, `lt:v`, `lte:v`: comparisons, for numbers and dates; + // - `empty`, `!empty`: no value, any value. + // An unknown property, a property without a column, or an invalid regular + // expression is answered with 400. + Filter *InQueryFilter `form:"filter,omitempty" json:"filter,omitempty"` } -// GetServiceNodeResourceLogsParams defines parameters for GetServiceNodeResourceLogs. -type GetServiceNodeResourceLogsParams struct { +// GetFrontendHiddenMenuEntriesParams defines parameters for GetFrontendHiddenMenuEntries. +type GetFrontendHiddenMenuEntriesParams struct { // Props A list of properties to include in each data dictionnary. Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` @@ -2554,7 +4436,10 @@ type GetServiceNodeResourceLogsParams struct { // Offset Skip the first entries of the data cursor. Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` - // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit the meta field. + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. @@ -2567,8 +4452,17 @@ type GetServiceNodeResourceLogsParams struct { Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` } -// GetServiceResinfoParams defines parameters for GetServiceResinfo. -type GetServiceResinfoParams struct { +// DeleteGroupsJSONBody defines parameters for DeleteGroups. +type DeleteGroupsJSONBody struct { + // Id Group record id + Id *string `json:"id,omitempty"` + + // Role Group role/name + Role *string `json:"role,omitempty"` +} + +// GetGroupsParams defines parameters for GetGroups. +type GetGroupsParams struct { // Props A list of properties to include in each data dictionnary. Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` @@ -2578,7 +4472,10 @@ type GetServiceResinfoParams struct { // Offset Skip the first entries of the data cursor. Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` - // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit the meta field. + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. @@ -2589,10 +4486,37 @@ type GetServiceResinfoParams struct { // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` + + // Filter Column filter, repeatable; several filters combine with AND. Each value is + // `prop:expr`, `prop` being a property of the list (joined ones included, as + // for orderby) and `expr` one of: + // - text: case-insensitive match anywhere in the value; + // - `~regex`: regular expression (RE2 syntax), case-insensitive; + // - `in:a,b,c`: one of the listed values; + // - `eq:v`, `ne:v`: equal, not equal; + // - `gt:v`, `gte:v`, `lt:v`, `lte:v`: comparisons, for numbers and dates; + // - `empty`, `!empty`: no value, any value. + // An unknown property, a property without a column, or an invalid regular + // expression is answered with 400. + Filter *InQueryFilter `form:"filter,omitempty" json:"filter,omitempty"` } -// GetServiceResourcesParams defines parameters for GetServiceResources. -type GetServiceResourcesParams struct { +// PostGroupsJSONBody defines parameters for PostGroups. +type PostGroupsJSONBody struct { + Description *string `json:"description,omitempty"` + + // Id Existing group id (selects update instead of create) + Id *string `json:"id,omitempty"` + + // Privilege 'T' for a privilege group, 'F' otherwise + Privilege *string `json:"privilege,omitempty"` + + // Role Group role/name + Role *string `json:"role,omitempty"` +} + +// GetGroupParams defines parameters for GetGroup. +type GetGroupParams struct { // Props A list of properties to include in each data dictionnary. Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` @@ -2602,7 +4526,10 @@ type GetServiceResourcesParams struct { // Offset Skip the first entries of the data cursor. Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` - // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit the meta field. + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. @@ -2615,8 +4542,17 @@ type GetServiceResourcesParams struct { Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` } -// GetServiceResourceLogsParams defines parameters for GetServiceResourceLogs. -type GetServiceResourceLogsParams struct { +// PostGroupJSONBody defines parameters for PostGroup. +type PostGroupJSONBody struct { + Description *string `json:"description,omitempty"` + + // Privilege 'T' for a privilege group, 'F' otherwise + Privilege *string `json:"privilege,omitempty"` + Role *string `json:"role,omitempty"` +} + +// GetGroupAppsParams defines parameters for GetGroupApps. +type GetGroupAppsParams struct { // Props A list of properties to include in each data dictionnary. Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` @@ -2626,7 +4562,10 @@ type GetServiceResourceLogsParams struct { // Offset Skip the first entries of the data cursor. Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` - // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit the meta field. + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. @@ -2639,18 +4578,27 @@ type GetServiceResourceLogsParams struct { Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` } -// GetServiceTagsParams defines parameters for GetServiceTags. -type GetServiceTagsParams struct { - // Props A list of properties to include in each data dictionnary. - Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` - +// DeleteGroupHiddenMenuEntriesJSONBody defines parameters for DeleteGroupHiddenMenuEntries. +type DeleteGroupHiddenMenuEntriesJSONBody struct { + // MenuEntry Menu entry key to unhide + MenuEntry string `json:"menu_entry"` +} + +// GetGroupHiddenMenuEntriesParams defines parameters for GetGroupHiddenMenuEntries. +type GetGroupHiddenMenuEntriesParams struct { + // Props A list of properties to include in each data dictionnary. + Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` + // Limit The maximum number of entries to return. 0 means no limit. Limit *InQueryLimit `form:"limit,omitempty" json:"limit,omitempty"` // Offset Skip the first entries of the data cursor. Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` - // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit the meta field. + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. @@ -2663,20 +4611,14 @@ type GetServiceTagsParams struct { Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` } -// DeleteServicesInstancesJSONBody defines parameters for DeleteServicesInstances. -type DeleteServicesInstancesJSONBody struct { - // Id Service instance record id, as an alternative to svc_id + node_id - Id *int `json:"id,omitempty"` - - // NodeId Node id or name, to be used along with svc_id - NodeId *string `json:"node_id,omitempty"` - - // SvcId Service id or name, to be used along with node_id - SvcId *string `json:"svc_id,omitempty"` +// PostGroupHiddenMenuEntriesJSONBody defines parameters for PostGroupHiddenMenuEntries. +type PostGroupHiddenMenuEntriesJSONBody struct { + // MenuEntry Menu entry key to hide + MenuEntry string `json:"menu_entry"` } -// GetServicesInstancesParams defines parameters for GetServicesInstances. -type GetServicesInstancesParams struct { +// GetGroupModulesetsParams defines parameters for GetGroupModulesets. +type GetGroupModulesetsParams struct { // Props A list of properties to include in each data dictionnary. Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` @@ -2686,7 +4628,10 @@ type GetServicesInstancesParams struct { // Offset Skip the first entries of the data cursor. Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` - // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit the meta field. + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. @@ -2699,8 +4644,8 @@ type GetServicesInstancesParams struct { Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` } -// GetServicesInstanceParams defines parameters for GetServicesInstance. -type GetServicesInstanceParams struct { +// GetGroupNodesParams defines parameters for GetGroupNodes. +type GetGroupNodesParams struct { // Props A list of properties to include in each data dictionnary. Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` @@ -2710,7 +4655,10 @@ type GetServicesInstanceParams struct { // Offset Skip the first entries of the data cursor. Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` - // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit the meta field. + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. @@ -2723,8 +4671,8 @@ type GetServicesInstanceParams struct { Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` } -// GetServicesInstancesStatusLogParams defines parameters for GetServicesInstancesStatusLog. -type GetServicesInstancesStatusLogParams struct { +// GetGroupRulesetsParams defines parameters for GetGroupRulesets. +type GetGroupRulesetsParams struct { // Props A list of properties to include in each data dictionnary. Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` @@ -2734,7 +4682,10 @@ type GetServicesInstancesStatusLogParams struct { // Offset Skip the first entries of the data cursor. Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` - // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit the meta field. + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. @@ -2747,8 +4698,8 @@ type GetServicesInstancesStatusLogParams struct { Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` } -// GetServicesStatusLogParams defines parameters for GetServicesStatusLog. -type GetServicesStatusLogParams struct { +// GetGroupServicesParams defines parameters for GetGroupServices. +type GetGroupServicesParams struct { // Props A list of properties to include in each data dictionnary. Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` @@ -2758,7 +4709,10 @@ type GetServicesStatusLogParams struct { // Offset Skip the first entries of the data cursor. Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` - // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit the meta field. + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. @@ -2771,14 +4725,8 @@ type GetServicesStatusLogParams struct { Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` } -// DeleteTagsJSONBody defines parameters for DeleteTags. -type DeleteTagsJSONBody struct { - // TagId Tag tag_id, or tag record id - TagId string `json:"tag_id"` -} - -// GetTagsParams defines parameters for GetTags. -type GetTagsParams struct { +// GetGroupUsersParams defines parameters for GetGroupUsers. +type GetGroupUsersParams struct { // Props A list of properties to include in each data dictionnary. Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` @@ -2788,7 +4736,10 @@ type GetTagsParams struct { // Offset Skip the first entries of the data cursor. Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` - // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit the meta field. + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. @@ -2801,27 +4752,14 @@ type GetTagsParams struct { Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` } -// PostTagsJSONBody defines parameters for PostTags. -type PostTagsJSONBody struct { - // TagData Free form JSON data attached to the tag - TagData *string `json:"tag_data,omitempty"` - - // TagExclude Regular expression of tag names that can not be attached along with this tag - TagExclude *string `json:"tag_exclude,omitempty"` - TagName string `json:"tag_name"` -} - -// DeleteTagsNodesJSONBody defines parameters for DeleteTagsNodes. -type DeleteTagsNodesJSONBody struct { - // NodeId Node id - NodeId string `json:"node_id"` - - // TagId Tag tag_id, or tag record id - TagId string `json:"tag_id"` +// DeleteIpsJSONBody defines parameters for DeleteIps. +type DeleteIpsJSONBody struct { + // Id Ip identifier (node_ip.id) + Id string `json:"id"` } -// GetTagsNodesParams defines parameters for GetTagsNodes. -type GetTagsNodesParams struct { +// GetIpsParams defines parameters for GetIps. +type GetIpsParams struct { // Props A list of properties to include in each data dictionnary. Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` @@ -2831,7 +4769,10 @@ type GetTagsNodesParams struct { // Offset Skip the first entries of the data cursor. Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` - // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit the meta field. + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. @@ -2840,33 +4781,55 @@ type GetTagsNodesParams struct { // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` + // Filter Column filter, repeatable; several filters combine with AND. Each value is + // `prop:expr`, `prop` being a property of the list (joined ones included, as + // for orderby) and `expr` one of: + // - text: case-insensitive match anywhere in the value; + // - `~regex`: regular expression (RE2 syntax), case-insensitive; + // - `in:a,b,c`: one of the listed values; + // - `eq:v`, `ne:v`: equal, not equal; + // - `gt:v`, `gte:v`, `lt:v`, `lte:v`: comparisons, for numbers and dates; + // - `empty`, `!empty`: no value, any value. + // An unknown property, a property without a column, or an invalid regular + // expression is answered with 400. + Filter *InQueryFilter `form:"filter,omitempty" json:"filter,omitempty"` + // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` } -// PostTagsNodesJSONBody defines parameters for PostTagsNodes. -type PostTagsNodesJSONBody struct { - // NodeId Node id - NodeId string `json:"node_id"` +// GetIpParams defines parameters for GetIp. +type GetIpParams struct { + // Props A list of properties to include in each data dictionnary. + Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` - // TagAttachData Free form JSON data attached to the attachment - TagAttachData *string `json:"tag_attach_data,omitempty"` + // Limit The maximum number of entries to return. 0 means no limit. + Limit *InQueryLimit `form:"limit,omitempty" json:"limit,omitempty"` - // TagId Tag tag_id, or tag record id - TagId string `json:"tag_id"` -} + // Offset Skip the first entries of the data cursor. + Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` -// DeleteTagsServicesJSONBody defines parameters for DeleteTagsServices. -type DeleteTagsServicesJSONBody struct { - // SvcId Service id or name - SvcId string `json:"svc_id"` + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. + Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` - // TagId Tag tag_id, or tag record id - TagId string `json:"tag_id"` + // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. + Stats *InQueryStats `form:"stats,omitempty" json:"stats,omitempty"` + + // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). + Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` + + // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). + Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` } -// GetTagsServicesParams defines parameters for GetTagsServices. -type GetTagsServicesParams struct { +// GetLogsParams defines parameters for GetLogs. +type GetLogsParams struct { + // FsetId Restrict to log events matching this filterset (gen_filtersets.id or fset_name) + FsetId *string `form:"fset_id,omitempty" json:"fset_id,omitempty"` + // Props A list of properties to include in each data dictionnary. Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` @@ -2876,7 +4839,10 @@ type GetTagsServicesParams struct { // Offset Skip the first entries of the data cursor. Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` - // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit the meta field. + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. @@ -2889,33 +4855,17 @@ type GetTagsServicesParams struct { Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` } -// PostTagsServicesJSONBody defines parameters for PostTagsServices. -type PostTagsServicesJSONBody struct { - // SvcId Service id or name - SvcId string `json:"svc_id"` - - // TagAttachData Free form JSON data attached to the attachment - TagAttachData *string `json:"tag_attach_data,omitempty"` - - // TagId Tag tag_id, or tag record id - TagId string `json:"tag_id"` -} - -// GetTagParams defines parameters for GetTag. -type GetTagParams struct { - // Props A list of properties to include in each data dictionnary. - Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` -} - -// PostTagJSONBody defines parameters for PostTag. -type PostTagJSONBody struct { - TagData *string `json:"tag_data,omitempty"` - TagExclude *string `json:"tag_exclude,omitempty"` - TagName *string `json:"tag_name,omitempty"` +// PostLogsJSONBody defines parameters for PostLogs. +type PostLogsJSONBody struct { + LogDict *map[string]interface{} `json:"log_dict,omitempty"` + LogFmt string `json:"log_fmt"` + LogLevel *string `json:"log_level,omitempty"` + NodeId *string `json:"node_id,omitempty"` + SvcId *string `json:"svc_id,omitempty"` } -// GetTagNodesParams defines parameters for GetTagNodes. -type GetTagNodesParams struct { +// GetLogParams defines parameters for GetLog. +type GetLogParams struct { // Props A list of properties to include in each data dictionnary. Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` @@ -2924,15 +4874,25 @@ type GetTagNodesParams struct { // Offset Skip the first entries of the data cursor. Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` -} -// PostTagNodeJSONBody defines parameters for PostTagNode. -type PostTagNodeJSONBody struct { - TagAttachData *string `json:"tag_attach_data,omitempty"` + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. + Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` + + // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. + Stats *InQueryStats `form:"stats,omitempty" json:"stats,omitempty"` + + // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). + Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` + + // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). + Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` } -// GetTagServicesParams defines parameters for GetTagServices. -type GetTagServicesParams struct { +// GetNetworksParams defines parameters for GetNetworks. +type GetNetworksParams struct { // Props A list of properties to include in each data dictionnary. Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` @@ -2942,7 +4902,10 @@ type GetTagServicesParams struct { // Offset Skip the first entries of the data cursor. Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` - // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit the meta field. + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. @@ -2951,196 +4914,4577 @@ type GetTagServicesParams struct { // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` + // Filter Column filter, repeatable; several filters combine with AND. Each value is + // `prop:expr`, `prop` being a property of the list (joined ones included, as + // for orderby) and `expr` one of: + // - text: case-insensitive match anywhere in the value; + // - `~regex`: regular expression (RE2 syntax), case-insensitive; + // - `in:a,b,c`: one of the listed values; + // - `eq:v`, `ne:v`: equal, not equal; + // - `gt:v`, `gte:v`, `lt:v`, `lte:v`: comparisons, for numbers and dates; + // - `empty`, `!empty`: no value, any value. + // An unknown property, a property without a column, or an invalid regular + // expression is answered with 400. + Filter *InQueryFilter `form:"filter,omitempty" json:"filter,omitempty"` + // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` } -// PostTagServiceJSONBody defines parameters for PostTagService. -type PostTagServiceJSONBody struct { - TagAttachData *string `json:"tag_attach_data,omitempty"` +// PostNetworksJSONBody defines parameters for PostNetworks. +type PostNetworksJSONBody struct { + Comment *string `json:"comment,omitempty"` + + // Gateway IPv4 address inside the network + Gateway *string `json:"gateway,omitempty"` + Name *string `json:"name,omitempty"` + + // Netmask Prefix length + Netmask int `json:"netmask"` + + // Network IPv4 network address, for example 192.168.10.0 + Network string `json:"network"` + + // Prio Priority among overlapping networks + Prio *int `json:"prio,omitempty"` + + // Pvid VLAN id + Pvid *int `json:"pvid,omitempty"` + + // TeamResponsible Organisational group responsible for the network + TeamResponsible *string `json:"team_responsible,omitempty"` } -// PostActionsJSONRequestBody defines body for PostActions for application/json ContentType. -type PostActionsJSONRequestBody PostActionsJSONBody +// PostNetworkSegmentsJSONBody defines parameters for PostNetworkSegments. +type PostNetworkSegmentsJSONBody struct { + // SegBegin First IPv4 address of the segment + SegBegin string `json:"seg_begin"` -// DeleteAlertsJSONRequestBody defines body for DeleteAlerts for application/json ContentType. -type DeleteAlertsJSONRequestBody DeleteAlertsJSONBody + // SegEnd Last IPv4 address of the segment + SegEnd string `json:"seg_end"` -// PostAlertsJSONRequestBody defines body for PostAlerts for application/json ContentType. -type PostAlertsJSONRequestBody PostAlertsJSONBody + // SegType How the addresses of the segment are allocated + SegType *PostNetworkSegmentsJSONBodySegType `json:"seg_type,omitempty"` +} -// PostAlertJSONRequestBody defines body for PostAlert for application/json ContentType. -type PostAlertJSONRequestBody PostAlertJSONBody +// PostNetworkSegmentsJSONBodySegType defines parameters for PostNetworkSegments. +type PostNetworkSegmentsJSONBodySegType string -// DeleteAppsJSONRequestBody defines body for DeleteApps for application/json ContentType. -type DeleteAppsJSONRequestBody DeleteAppsJSONBody +// DeleteNodesJSONBody defines parameters for DeleteNodes. +type DeleteNodesJSONBody struct { + // NodeId Node identifier (node_id or nodename) + NodeId string `json:"node_id"` +} -// PostAppsJSONRequestBody defines body for PostApps for application/json ContentType. -type PostAppsJSONRequestBody PostAppsJSONBody +// GetNodesParams defines parameters for GetNodes. +type GetNodesParams struct { + // Props A list of properties to include in each data dictionnary. + Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` -// PostAppJSONRequestBody defines body for PostApp for application/json ContentType. -type PostAppJSONRequestBody PostAppJSONBody + // Limit The maximum number of entries to return. 0 means no limit. + Limit *InQueryLimit `form:"limit,omitempty" json:"limit,omitempty"` -// DeleteAppsPublicationsJSONRequestBody defines body for DeleteAppsPublications for application/json ContentType. -type DeleteAppsPublicationsJSONRequestBody DeleteAppsPublicationsJSONBody + // Offset Skip the first entries of the data cursor. + Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` -// PostAppsPublicationsJSONRequestBody defines body for PostAppsPublications for application/json ContentType. -type PostAppsPublicationsJSONRequestBody PostAppsPublicationsJSONBody + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. + Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` -// DeleteAppsResponsiblesJSONRequestBody defines body for DeleteAppsResponsibles for application/json ContentType. -type DeleteAppsResponsiblesJSONRequestBody DeleteAppsResponsiblesJSONBody + // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. + Stats *InQueryStats `form:"stats,omitempty" json:"stats,omitempty"` -// PostAppsResponsiblesJSONRequestBody defines body for PostAppsResponsibles for application/json ContentType. -type PostAppsResponsiblesJSONRequestBody PostAppsResponsiblesJSONBody + // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). + Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` -// PostAuthNodeJSONRequestBody defines body for PostAuthNode for application/json ContentType. -type PostAuthNodeJSONRequestBody PostAuthNodeJSONBody + // Filter Column filter, repeatable; several filters combine with AND. Each value is + // `prop:expr`, `prop` being a property of the list (joined ones included, as + // for orderby) and `expr` one of: + // - text: case-insensitive match anywhere in the value; + // - `~regex`: regular expression (RE2 syntax), case-insensitive; + // - `in:a,b,c`: one of the listed values; + // - `eq:v`, `ne:v`: equal, not equal; + // - `gt:v`, `gte:v`, `lt:v`, `lte:v`: comparisons, for numbers and dates; + // - `empty`, `!empty`: no value, any value. + // An unknown property, a property without a column, or an invalid regular + // expression is answered with 400. + Filter *InQueryFilter `form:"filter,omitempty" json:"filter,omitempty"` + + // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). + Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` +} + +// PostNodesJSONBody defines parameters for PostNodes. +type PostNodesJSONBody struct { + ActionType *PostNodesJSONBodyActionType `json:"action_type,omitempty"` + App *string `json:"app,omitempty"` + AssetEnv *string `json:"asset_env,omitempty"` + Assetname *string `json:"assetname,omitempty"` + BiosVersion *string `json:"bios_version,omitempty"` + ClusterId *string `json:"cluster_id,omitempty"` + Collector *string `json:"collector,omitempty"` + ConnectTo *string `json:"connect_to,omitempty"` + CpuCores *int `json:"cpu_cores,omitempty"` + CpuDies *int `json:"cpu_dies,omitempty"` + CpuFreq *string `json:"cpu_freq,omitempty"` + CpuModel *string `json:"cpu_model,omitempty"` + CpuThreads *int `json:"cpu_threads,omitempty"` + CpuVendor *string `json:"cpu_vendor,omitempty"` + Enclosure *string `json:"enclosure,omitempty"` + Enclosureslot *string `json:"enclosureslot,omitempty"` + Fqdn *string `json:"fqdn,omitempty"` + Hv *string `json:"hv,omitempty"` + Hvpool *string `json:"hvpool,omitempty"` + Hvvdc *string `json:"hvvdc,omitempty"` + HwObsAlertDate *string `json:"hw_obs_alert_date,omitempty"` + HwObsWarnDate *string `json:"hw_obs_warn_date,omitempty"` + LastBoot *string `json:"last_boot,omitempty"` + LastComm *string `json:"last_comm,omitempty"` + ListenerPort *int `json:"listener_port,omitempty"` + LocAddr *string `json:"loc_addr,omitempty"` + LocBuilding *string `json:"loc_building,omitempty"` + LocCity *string `json:"loc_city,omitempty"` + LocCountry *string `json:"loc_country,omitempty"` + LocFloor *string `json:"loc_floor,omitempty"` + LocRack *string `json:"loc_rack,omitempty"` + LocRoom *string `json:"loc_room,omitempty"` + LocZip *string `json:"loc_zip,omitempty"` + MaintenanceEnd *string `json:"maintenance_end,omitempty"` + Manufacturer *string `json:"manufacturer,omitempty"` + MemBanks *int `json:"mem_banks,omitempty"` + MemBytes *int `json:"mem_bytes,omitempty"` + MemSlots *int `json:"mem_slots,omitempty"` + Model *string `json:"model,omitempty"` + NodeEnv *string `json:"node_env,omitempty"` + NodeFrozen *bool `json:"node_frozen,omitempty"` + NodeFrozenAt *string `json:"node_frozen_at,omitempty"` + NodeId *string `json:"node_id,omitempty"` + Nodename *string `json:"nodename,omitempty"` + Notifications *bool `json:"notifications,omitempty"` + OsArch *string `json:"os_arch,omitempty"` + OsConcat *string `json:"os_concat,omitempty"` + OsKernel *string `json:"os_kernel,omitempty"` + OsName *string `json:"os_name,omitempty"` + OsObsAlertDate *string `json:"os_obs_alert_date,omitempty"` + OsObsWarnDate *string `json:"os_obs_warn_date,omitempty"` + OsRelease *string `json:"os_release,omitempty"` + OsVendor *string `json:"os_vendor,omitempty"` + PowerBreaker1 *string `json:"power_breaker1,omitempty"` + PowerBreaker2 *string `json:"power_breaker2,omitempty"` + PowerCabinet1 *string `json:"power_cabinet1,omitempty"` + PowerCabinet2 *string `json:"power_cabinet2,omitempty"` + PowerProtect *string `json:"power_protect,omitempty"` + PowerProtectBreaker *string `json:"power_protect_breaker,omitempty"` + PowerSupplyNb *int `json:"power_supply_nb,omitempty"` + Role *string `json:"role,omitempty"` + SecZone *string `json:"sec_zone,omitempty"` + Serial *string `json:"serial,omitempty"` + SnoozeTill *string `json:"snooze_till,omitempty"` + SpVersion *string `json:"sp_version,omitempty"` + Status *string `json:"status,omitempty"` + TeamInteg *string `json:"team_integ,omitempty"` + TeamResponsible *string `json:"team_responsible,omitempty"` + TeamSupport *string `json:"team_support,omitempty"` + Type *string `json:"type,omitempty"` + Tz *string `json:"tz,omitempty"` + Updated *string `json:"updated,omitempty"` + Version *string `json:"version,omitempty"` + WarrantyEnd *string `json:"warranty_end,omitempty"` +} + +// PostNodesJSONBodyActionType defines parameters for PostNodes. +type PostNodesJSONBodyActionType string + +// GetNodesHardwareParams defines parameters for GetNodesHardware. +type GetNodesHardwareParams struct { + // Props A list of properties to include in each data dictionnary. + Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` + + // Limit The maximum number of entries to return. 0 means no limit. + Limit *InQueryLimit `form:"limit,omitempty" json:"limit,omitempty"` + + // Offset Skip the first entries of the data cursor. + Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` + + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. + Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` + + // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. + Stats *InQueryStats `form:"stats,omitempty" json:"stats,omitempty"` + + // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). + Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` + + // Filter Column filter, repeatable; several filters combine with AND. Each value is + // `prop:expr`, `prop` being a property of the list (joined ones included, as + // for orderby) and `expr` one of: + // - text: case-insensitive match anywhere in the value; + // - `~regex`: regular expression (RE2 syntax), case-insensitive; + // - `in:a,b,c`: one of the listed values; + // - `eq:v`, `ne:v`: equal, not equal; + // - `gt:v`, `gte:v`, `lt:v`, `lte:v`: comparisons, for numbers and dates; + // - `empty`, `!empty`: no value, any value. + // An unknown property, a property without a column, or an invalid regular + // expression is answered with 400. + Filter *InQueryFilter `form:"filter,omitempty" json:"filter,omitempty"` + + // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). + Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` +} + +// GetNodesHbasParams defines parameters for GetNodesHbas. +type GetNodesHbasParams struct { + // Props A list of properties to include in each data dictionnary. + Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` + + // Limit The maximum number of entries to return. 0 means no limit. + Limit *InQueryLimit `form:"limit,omitempty" json:"limit,omitempty"` + + // Offset Skip the first entries of the data cursor. + Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` + + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. + Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` + + // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. + Stats *InQueryStats `form:"stats,omitempty" json:"stats,omitempty"` + + // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). + Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` + + // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). + Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` +} + +// GetNodeParams defines parameters for GetNode. +type GetNodeParams struct { + // Props A list of properties to include in each data dictionnary. + Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` + + // Limit The maximum number of entries to return. 0 means no limit. + Limit *InQueryLimit `form:"limit,omitempty" json:"limit,omitempty"` + + // Offset Skip the first entries of the data cursor. + Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` + + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. + Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` + + // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. + Stats *InQueryStats `form:"stats,omitempty" json:"stats,omitempty"` + + // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). + Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` + + // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). + Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` +} + +// PostNodeJSONBody defines parameters for PostNode. +type PostNodeJSONBody struct { + ActionType *PostNodeJSONBodyActionType `json:"action_type,omitempty"` + App *string `json:"app,omitempty"` + AssetEnv *string `json:"asset_env,omitempty"` + Assetname *string `json:"assetname,omitempty"` + BiosVersion *string `json:"bios_version,omitempty"` + ClusterId *string `json:"cluster_id,omitempty"` + Collector *string `json:"collector,omitempty"` + ConnectTo *string `json:"connect_to,omitempty"` + CpuCores *int `json:"cpu_cores,omitempty"` + CpuDies *int `json:"cpu_dies,omitempty"` + CpuFreq *string `json:"cpu_freq,omitempty"` + CpuModel *string `json:"cpu_model,omitempty"` + CpuThreads *int `json:"cpu_threads,omitempty"` + CpuVendor *string `json:"cpu_vendor,omitempty"` + Enclosure *string `json:"enclosure,omitempty"` + Enclosureslot *string `json:"enclosureslot,omitempty"` + Fqdn *string `json:"fqdn,omitempty"` + Hv *string `json:"hv,omitempty"` + Hvpool *string `json:"hvpool,omitempty"` + Hvvdc *string `json:"hvvdc,omitempty"` + HwObsAlertDate *string `json:"hw_obs_alert_date,omitempty"` + HwObsWarnDate *string `json:"hw_obs_warn_date,omitempty"` + LastBoot *string `json:"last_boot,omitempty"` + LastComm *string `json:"last_comm,omitempty"` + ListenerPort *int `json:"listener_port,omitempty"` + LocAddr *string `json:"loc_addr,omitempty"` + LocBuilding *string `json:"loc_building,omitempty"` + LocCity *string `json:"loc_city,omitempty"` + LocCountry *string `json:"loc_country,omitempty"` + LocFloor *string `json:"loc_floor,omitempty"` + LocRack *string `json:"loc_rack,omitempty"` + LocRoom *string `json:"loc_room,omitempty"` + LocZip *string `json:"loc_zip,omitempty"` + MaintenanceEnd *string `json:"maintenance_end,omitempty"` + Manufacturer *string `json:"manufacturer,omitempty"` + MemBanks *int `json:"mem_banks,omitempty"` + MemBytes *int `json:"mem_bytes,omitempty"` + MemSlots *int `json:"mem_slots,omitempty"` + Model *string `json:"model,omitempty"` + NodeEnv *string `json:"node_env,omitempty"` + NodeFrozen *bool `json:"node_frozen,omitempty"` + NodeFrozenAt *string `json:"node_frozen_at,omitempty"` + Nodename *string `json:"nodename,omitempty"` + Notifications *bool `json:"notifications,omitempty"` + OsArch *string `json:"os_arch,omitempty"` + OsConcat *string `json:"os_concat,omitempty"` + OsKernel *string `json:"os_kernel,omitempty"` + OsName *string `json:"os_name,omitempty"` + OsObsAlertDate *string `json:"os_obs_alert_date,omitempty"` + OsObsWarnDate *string `json:"os_obs_warn_date,omitempty"` + OsRelease *string `json:"os_release,omitempty"` + OsVendor *string `json:"os_vendor,omitempty"` + PowerBreaker1 *string `json:"power_breaker1,omitempty"` + PowerBreaker2 *string `json:"power_breaker2,omitempty"` + PowerCabinet1 *string `json:"power_cabinet1,omitempty"` + PowerCabinet2 *string `json:"power_cabinet2,omitempty"` + PowerProtect *string `json:"power_protect,omitempty"` + PowerProtectBreaker *string `json:"power_protect_breaker,omitempty"` + PowerSupplyNb *int `json:"power_supply_nb,omitempty"` + Role *string `json:"role,omitempty"` + SecZone *string `json:"sec_zone,omitempty"` + Serial *string `json:"serial,omitempty"` + SnoozeTill *string `json:"snooze_till,omitempty"` + SpVersion *string `json:"sp_version,omitempty"` + Status *string `json:"status,omitempty"` + TeamInteg *string `json:"team_integ,omitempty"` + TeamResponsible *string `json:"team_responsible,omitempty"` + TeamSupport *string `json:"team_support,omitempty"` + Type *string `json:"type,omitempty"` + Tz *string `json:"tz,omitempty"` + Updated *string `json:"updated,omitempty"` + Version *string `json:"version,omitempty"` + WarrantyEnd *string `json:"warranty_end,omitempty"` +} + +// PostNodeJSONBodyActionType defines parameters for PostNode. +type PostNodeJSONBodyActionType string + +// GetNodeAlertsParams defines parameters for GetNodeAlerts. +type GetNodeAlertsParams struct { + // Props A list of properties to include in each data dictionnary. + Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` + + // Limit The maximum number of entries to return. 0 means no limit. + Limit *InQueryLimit `form:"limit,omitempty" json:"limit,omitempty"` + + // Offset Skip the first entries of the data cursor. + Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` + + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. + Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` + + // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. + Stats *InQueryStats `form:"stats,omitempty" json:"stats,omitempty"` + + // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). + Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` + + // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). + Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` +} + +// GetNodeCandidateTagsParams defines parameters for GetNodeCandidateTags. +type GetNodeCandidateTagsParams struct { + // Props A list of properties to include in each data dictionnary. + Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` + + // Limit The maximum number of entries to return. 0 means no limit. + Limit *InQueryLimit `form:"limit,omitempty" json:"limit,omitempty"` + + // Offset Skip the first entries of the data cursor. + Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` + + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. + Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` + + // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. + Stats *InQueryStats `form:"stats,omitempty" json:"stats,omitempty"` + + // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). + Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` + + // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). + Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` +} + +// GetNodeChecksParams defines parameters for GetNodeChecks. +type GetNodeChecksParams struct { + // Props A list of properties to include in each data dictionnary. + Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` + + // Limit The maximum number of entries to return. 0 means no limit. + Limit *InQueryLimit `form:"limit,omitempty" json:"limit,omitempty"` + + // Offset Skip the first entries of the data cursor. + Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` + + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. + Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` + + // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. + Stats *InQueryStats `form:"stats,omitempty" json:"stats,omitempty"` + + // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). + Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` + + // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). + Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` +} + +// GetNodeComplianceCandidateModulesetsParams defines parameters for GetNodeComplianceCandidateModulesets. +type GetNodeComplianceCandidateModulesetsParams struct { + // Props A list of properties to include in each data dictionnary. + Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` + + // Limit The maximum number of entries to return. 0 means no limit. + Limit *InQueryLimit `form:"limit,omitempty" json:"limit,omitempty"` + + // Offset Skip the first entries of the data cursor. + Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` + + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. + Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` + + // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. + Stats *InQueryStats `form:"stats,omitempty" json:"stats,omitempty"` + + // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). + Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` + + // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). + Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` +} + +// GetNodeComplianceCandidateRulesetsParams defines parameters for GetNodeComplianceCandidateRulesets. +type GetNodeComplianceCandidateRulesetsParams struct { + // Props A list of properties to include in each data dictionnary. + Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` + + // Limit The maximum number of entries to return. 0 means no limit. + Limit *InQueryLimit `form:"limit,omitempty" json:"limit,omitempty"` + + // Offset Skip the first entries of the data cursor. + Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` + + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. + Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` + + // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. + Stats *InQueryStats `form:"stats,omitempty" json:"stats,omitempty"` + + // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). + Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` + + // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). + Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` +} + +// GetNodeComplianceLogsParams defines parameters for GetNodeComplianceLogs. +type GetNodeComplianceLogsParams struct { + // Props A list of properties to include in each data dictionnary. + Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` + + // Limit The maximum number of entries to return. 0 means no limit. + Limit *InQueryLimit `form:"limit,omitempty" json:"limit,omitempty"` + + // Offset Skip the first entries of the data cursor. + Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` + + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. + Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` + + // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. + Stats *InQueryStats `form:"stats,omitempty" json:"stats,omitempty"` + + // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). + Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` + + // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). + Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` +} + +// GetNodeComplianceModulesetsParams defines parameters for GetNodeComplianceModulesets. +type GetNodeComplianceModulesetsParams struct { + // Props A list of properties to include in each data dictionnary. + Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` + + // Limit The maximum number of entries to return. 0 means no limit. + Limit *InQueryLimit `form:"limit,omitempty" json:"limit,omitempty"` + + // Offset Skip the first entries of the data cursor. + Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` + + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. + Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` + + // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. + Stats *InQueryStats `form:"stats,omitempty" json:"stats,omitempty"` + + // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). + Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` + + // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). + Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` +} + +// PostNodeComplianceModulesetJSONBody defines parameters for PostNodeComplianceModuleset. +type PostNodeComplianceModulesetJSONBody = map[string]interface{} + +// GetNodeComplianceRulesetsParams defines parameters for GetNodeComplianceRulesets. +type GetNodeComplianceRulesetsParams struct { + // Props A list of properties to include in each data dictionnary. + Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` + + // Limit The maximum number of entries to return. 0 means no limit. + Limit *InQueryLimit `form:"limit,omitempty" json:"limit,omitempty"` + + // Offset Skip the first entries of the data cursor. + Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` + + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. + Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` + + // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. + Stats *InQueryStats `form:"stats,omitempty" json:"stats,omitempty"` + + // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). + Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` + + // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). + Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` +} + +// PostNodeComplianceRulesetJSONBody defines parameters for PostNodeComplianceRuleset. +type PostNodeComplianceRulesetJSONBody = map[string]interface{} + +// GetNodeComplianceStatusParams defines parameters for GetNodeComplianceStatus. +type GetNodeComplianceStatusParams struct { + // Props A list of properties to include in each data dictionnary. + Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` + + // Limit The maximum number of entries to return. 0 means no limit. + Limit *InQueryLimit `form:"limit,omitempty" json:"limit,omitempty"` + + // Offset Skip the first entries of the data cursor. + Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` + + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. + Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` + + // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. + Stats *InQueryStats `form:"stats,omitempty" json:"stats,omitempty"` + + // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). + Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` + + // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). + Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` +} + +// GetNodeDisksParams defines parameters for GetNodeDisks. +type GetNodeDisksParams struct { + // Props A list of properties to include in each data dictionnary. + Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` + + // Limit The maximum number of entries to return. 0 means no limit. + Limit *InQueryLimit `form:"limit,omitempty" json:"limit,omitempty"` + + // Offset Skip the first entries of the data cursor. + Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` + + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. + Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` + + // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. + Stats *InQueryStats `form:"stats,omitempty" json:"stats,omitempty"` + + // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). + Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` + + // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). + Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` +} + +// GetNodeHardwareParams defines parameters for GetNodeHardware. +type GetNodeHardwareParams struct { + // Props A list of properties to include in each data dictionnary. + Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` + + // Limit The maximum number of entries to return. 0 means no limit. + Limit *InQueryLimit `form:"limit,omitempty" json:"limit,omitempty"` + + // Offset Skip the first entries of the data cursor. + Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` + + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. + Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` + + // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. + Stats *InQueryStats `form:"stats,omitempty" json:"stats,omitempty"` + + // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). + Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` + + // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). + Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` +} + +// GetNodeHbasParams defines parameters for GetNodeHbas. +type GetNodeHbasParams struct { + // Props A list of properties to include in each data dictionnary. + Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` + + // Limit The maximum number of entries to return. 0 means no limit. + Limit *InQueryLimit `form:"limit,omitempty" json:"limit,omitempty"` + + // Offset Skip the first entries of the data cursor. + Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` + + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. + Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` + + // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. + Stats *InQueryStats `form:"stats,omitempty" json:"stats,omitempty"` + + // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). + Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` + + // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). + Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` +} + +// GetNodeInterfacesParams defines parameters for GetNodeInterfaces. +type GetNodeInterfacesParams struct { + // Props A list of properties to include in each data dictionnary. + Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` + + // Limit The maximum number of entries to return. 0 means no limit. + Limit *InQueryLimit `form:"limit,omitempty" json:"limit,omitempty"` + + // Offset Skip the first entries of the data cursor. + Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` + + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. + Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` + + // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. + Stats *InQueryStats `form:"stats,omitempty" json:"stats,omitempty"` + + // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). + Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` + + // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). + Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` +} + +// GetNodeIpsParams defines parameters for GetNodeIps. +type GetNodeIpsParams struct { + // Props A list of properties to include in each data dictionnary. + Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` + + // Limit The maximum number of entries to return. 0 means no limit. + Limit *InQueryLimit `form:"limit,omitempty" json:"limit,omitempty"` + + // Offset Skip the first entries of the data cursor. + Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` + + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. + Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` + + // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. + Stats *InQueryStats `form:"stats,omitempty" json:"stats,omitempty"` + + // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). + Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` + + // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). + Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` +} + +// GetNodeServicesParams defines parameters for GetNodeServices. +type GetNodeServicesParams struct { + // Props A list of properties to include in each data dictionnary. + Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` + + // Limit The maximum number of entries to return. 0 means no limit. + Limit *InQueryLimit `form:"limit,omitempty" json:"limit,omitempty"` + + // Offset Skip the first entries of the data cursor. + Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` + + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. + Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` + + // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. + Stats *InQueryStats `form:"stats,omitempty" json:"stats,omitempty"` + + // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). + Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` + + // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). + Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` +} + +// GetNodeServiceParams defines parameters for GetNodeService. +type GetNodeServiceParams struct { + // Props A list of properties to include in each data dictionnary. + Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` + + // Limit The maximum number of entries to return. 0 means no limit. + Limit *InQueryLimit `form:"limit,omitempty" json:"limit,omitempty"` + + // Offset Skip the first entries of the data cursor. + Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` + + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. + Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` + + // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. + Stats *InQueryStats `form:"stats,omitempty" json:"stats,omitempty"` + + // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). + Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` + + // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). + Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` +} + +// PostNodeSnoozeJSONBody defines parameters for PostNodeSnooze. +type PostNodeSnoozeJSONBody struct { + // Duration Duration string (e.g. "1h", "30m", "2d"). Omit to unsnooze. + Duration *string `json:"duration,omitempty"` +} + +// GetNodeTagsParams defines parameters for GetNodeTags. +type GetNodeTagsParams struct { + // Props A list of properties to include in each data dictionnary. + Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` + + // Limit The maximum number of entries to return. 0 means no limit. + Limit *InQueryLimit `form:"limit,omitempty" json:"limit,omitempty"` + + // Offset Skip the first entries of the data cursor. + Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` + + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. + Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` + + // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. + Stats *InQueryStats `form:"stats,omitempty" json:"stats,omitempty"` + + // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). + Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` + + // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). + Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` +} + +// DeleteObsolescenceSettingsJSONBody defines parameters for DeleteObsolescenceSettings. +type DeleteObsolescenceSettingsJSONBody struct { + // Id Obsolescence setting record id + Id string `json:"id"` +} + +// GetObsolescenceSettingsParams defines parameters for GetObsolescenceSettings. +type GetObsolescenceSettingsParams struct { + // Props A list of properties to include in each data dictionnary. + Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` + + // Limit The maximum number of entries to return. 0 means no limit. + Limit *InQueryLimit `form:"limit,omitempty" json:"limit,omitempty"` + + // Offset Skip the first entries of the data cursor. + Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` + + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. + Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` + + // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. + Stats *InQueryStats `form:"stats,omitempty" json:"stats,omitempty"` + + // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). + Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` + + // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). + Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` +} + +// PostObsolescenceSettingsJSONBody defines parameters for PostObsolescenceSettings. +type PostObsolescenceSettingsJSONBody struct { + // Id Obsolescence setting record id + Id string `json:"id"` + + // ObsAlertDate Date from which nodes matching this setting are flagged as obsolete. "YYYY-MM-DD" or "YYYY-MM-DD hh:mm:ss"; an empty string clears the date. + ObsAlertDate *string `json:"obs_alert_date,omitempty"` + + // ObsWarnDate Date from which nodes matching this setting are flagged as a warning. "YYYY-MM-DD" or "YYYY-MM-DD hh:mm:ss"; an empty string clears the date. + ObsWarnDate *string `json:"obs_warn_date,omitempty"` +} + +// GetObsolescenceSettingParams defines parameters for GetObsolescenceSetting. +type GetObsolescenceSettingParams struct { + // Props A list of properties to include in each data dictionnary. + Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` + + // Limit The maximum number of entries to return. 0 means no limit. + Limit *InQueryLimit `form:"limit,omitempty" json:"limit,omitempty"` + + // Offset Skip the first entries of the data cursor. + Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` + + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. + Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` + + // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. + Stats *InQueryStats `form:"stats,omitempty" json:"stats,omitempty"` + + // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). + Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` + + // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). + Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` +} + +// PostObsolescenceSettingJSONBody defines parameters for PostObsolescenceSetting. +type PostObsolescenceSettingJSONBody struct { + // ObsAlertDate Date from which nodes matching this setting are flagged as obsolete. "YYYY-MM-DD" or "YYYY-MM-DD hh:mm:ss"; an empty string clears the date. + ObsAlertDate *string `json:"obs_alert_date,omitempty"` + + // ObsWarnDate Date from which nodes matching this setting are flagged as a warning. "YYYY-MM-DD" or "YYYY-MM-DD hh:mm:ss"; an empty string clears the date. + ObsWarnDate *string `json:"obs_warn_date,omitempty"` +} + +// GetPackagesParams defines parameters for GetPackages. +type GetPackagesParams struct { + // Props A list of properties to include in each data dictionnary. + Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` + + // Limit The maximum number of entries to return. 0 means no limit. + Limit *InQueryLimit `form:"limit,omitempty" json:"limit,omitempty"` + + // Offset Skip the first entries of the data cursor. + Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` + + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. + Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` + + // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. + Stats *InQueryStats `form:"stats,omitempty" json:"stats,omitempty"` + + // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). + Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` + + // Filter Column filter, repeatable; several filters combine with AND. Each value is + // `prop:expr`, `prop` being a property of the list (joined ones included, as + // for orderby) and `expr` one of: + // - text: case-insensitive match anywhere in the value; + // - `~regex`: regular expression (RE2 syntax), case-insensitive; + // - `in:a,b,c`: one of the listed values; + // - `eq:v`, `ne:v`: equal, not equal; + // - `gt:v`, `gte:v`, `lt:v`, `lte:v`: comparisons, for numbers and dates; + // - `empty`, `!empty`: no value, any value. + // An unknown property, a property without a column, or an invalid regular + // expression is answered with 400. + Filter *InQueryFilter `form:"filter,omitempty" json:"filter,omitempty"` + + // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). + Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` +} + +// GetPackagesDiffParams defines parameters for GetPackagesDiff. +type GetPackagesDiffParams struct { + // NodeIds A comma-separated list of node ids to compare + NodeIds *string `form:"node_ids,omitempty" json:"node_ids,omitempty"` + + // SvcIds A comma-separated list of service ids whose nodes to compare + SvcIds *string `form:"svc_ids,omitempty" json:"svc_ids,omitempty"` + + // Encap With svc_ids, compare the services' encapsulated nodes instead of their hosts + Encap *bool `form:"encap,omitempty" json:"encap,omitempty"` +} + +// GetSearchParams defines parameters for GetSearch. +type GetSearchParams struct { + // Q The text to search for. + Q string `form:"q" json:"q"` + + // Kinds Comma-separated kinds to search, all by default: node, service, instance, + // app, network, disk, tag, user, group, request, moduleset, ruleset, + // filterset, form. + Kinds *string `form:"kinds,omitempty" json:"kinds,omitempty"` + + // Limit Hits returned per kind, 5 by default, 20 at most. + Limit *int `form:"limit,omitempty" json:"limit,omitempty"` +} + +// DeleteServicesJSONBody defines parameters for DeleteServices. +type DeleteServicesJSONBody struct { + // SvcId Service id or name + SvcId string `json:"svc_id"` +} + +// GetServicesParams defines parameters for GetServices. +type GetServicesParams struct { + // Props A list of properties to include in each data dictionnary. + Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` + + // Limit The maximum number of entries to return. 0 means no limit. + Limit *InQueryLimit `form:"limit,omitempty" json:"limit,omitempty"` + + // Offset Skip the first entries of the data cursor. + Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` + + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. + Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` + + // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. + Stats *InQueryStats `form:"stats,omitempty" json:"stats,omitempty"` + + // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). + Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` + + // Filter Column filter, repeatable; several filters combine with AND. Each value is + // `prop:expr`, `prop` being a property of the list (joined ones included, as + // for orderby) and `expr` one of: + // - text: case-insensitive match anywhere in the value; + // - `~regex`: regular expression (RE2 syntax), case-insensitive; + // - `in:a,b,c`: one of the listed values; + // - `eq:v`, `ne:v`: equal, not equal; + // - `gt:v`, `gte:v`, `lt:v`, `lte:v`: comparisons, for numbers and dates; + // - `empty`, `!empty`: no value, any value. + // An unknown property, a property without a column, or an invalid regular + // expression is answered with 400. + Filter *InQueryFilter `form:"filter,omitempty" json:"filter,omitempty"` + + // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). + Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` +} + +// PostServicesJSONBody defines parameters for PostServices. +type PostServicesJSONBody struct { + ClusterId *string `json:"cluster_id,omitempty"` + SvcApp *string `json:"svc_app,omitempty"` + SvcAutostart *string `json:"svc_autostart,omitempty"` + SvcComment *string `json:"svc_comment,omitempty"` + SvcDrnoaction *string `json:"svc_drnoaction,omitempty"` + SvcDrpnode *string `json:"svc_drpnode,omitempty"` + SvcDrpnodes *string `json:"svc_drpnodes,omitempty"` + SvcDrptype *string `json:"svc_drptype,omitempty"` + SvcEnv *string `json:"svc_env,omitempty"` + SvcFlexCpuHighThreshold *int `json:"svc_flex_cpu_high_threshold,omitempty"` + SvcFlexCpuLowThreshold *int `json:"svc_flex_cpu_low_threshold,omitempty"` + SvcFlexMaxNodes *int `json:"svc_flex_max_nodes,omitempty"` + SvcFlexMinNodes *int `json:"svc_flex_min_nodes,omitempty"` + SvcFrozen *string `json:"svc_frozen,omitempty"` + SvcHa *string `json:"svc_ha,omitempty"` + SvcId *string `json:"svc_id,omitempty"` + SvcMetrocluster *string `json:"svc_metrocluster,omitempty"` + SvcNodes *string `json:"svc_nodes,omitempty"` + SvcNotifications *bool `json:"svc_notifications,omitempty"` + SvcPlacement *string `json:"svc_placement,omitempty"` + SvcProvisioned *string `json:"svc_provisioned,omitempty"` + SvcSnoozeTill *string `json:"svc_snooze_till,omitempty"` + SvcTopology *string `json:"svc_topology,omitempty"` + SvcWave *int `json:"svc_wave,omitempty"` + Svcname *string `json:"svcname,omitempty"` +} + +// GetServiceParams defines parameters for GetService. +type GetServiceParams struct { + // Props A list of properties to include in each data dictionnary. + Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` + + // Limit The maximum number of entries to return. 0 means no limit. + Limit *InQueryLimit `form:"limit,omitempty" json:"limit,omitempty"` + + // Offset Skip the first entries of the data cursor. + Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` + + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. + Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` + + // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. + Stats *InQueryStats `form:"stats,omitempty" json:"stats,omitempty"` + + // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). + Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` + + // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). + Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` +} + +// PostServiceJSONBody defines parameters for PostService. +type PostServiceJSONBody struct { + SvcApp *string `json:"svc_app,omitempty"` + SvcAutostart *string `json:"svc_autostart,omitempty"` + SvcComment *string `json:"svc_comment,omitempty"` + SvcDrnoaction *string `json:"svc_drnoaction,omitempty"` + SvcDrpnode *string `json:"svc_drpnode,omitempty"` + SvcDrpnodes *string `json:"svc_drpnodes,omitempty"` + SvcDrptype *string `json:"svc_drptype,omitempty"` + SvcEnv *string `json:"svc_env,omitempty"` + SvcFlexCpuHighThreshold *int `json:"svc_flex_cpu_high_threshold,omitempty"` + SvcFlexCpuLowThreshold *int `json:"svc_flex_cpu_low_threshold,omitempty"` + SvcFlexMaxNodes *int `json:"svc_flex_max_nodes,omitempty"` + SvcFlexMinNodes *int `json:"svc_flex_min_nodes,omitempty"` + SvcFrozen *string `json:"svc_frozen,omitempty"` + SvcHa *string `json:"svc_ha,omitempty"` + SvcMetrocluster *string `json:"svc_metrocluster,omitempty"` + SvcNodes *string `json:"svc_nodes,omitempty"` + SvcNotifications *bool `json:"svc_notifications,omitempty"` + SvcPlacement *string `json:"svc_placement,omitempty"` + SvcProvisioned *string `json:"svc_provisioned,omitempty"` + SvcSnoozeTill *string `json:"svc_snooze_till,omitempty"` + SvcTopology *string `json:"svc_topology,omitempty"` + SvcWave *int `json:"svc_wave,omitempty"` + Svcname *string `json:"svcname,omitempty"` +} + +// GetServiceAlertsParams defines parameters for GetServiceAlerts. +type GetServiceAlertsParams struct { + // Props A list of properties to include in each data dictionnary. + Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` + + // Limit The maximum number of entries to return. 0 means no limit. + Limit *InQueryLimit `form:"limit,omitempty" json:"limit,omitempty"` + + // Offset Skip the first entries of the data cursor. + Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` + + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. + Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` + + // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. + Stats *InQueryStats `form:"stats,omitempty" json:"stats,omitempty"` + + // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). + Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` + + // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). + Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` +} + +// GetServiceCandidateTagsParams defines parameters for GetServiceCandidateTags. +type GetServiceCandidateTagsParams struct { + // Props A list of properties to include in each data dictionnary. + Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` + + // Limit The maximum number of entries to return. 0 means no limit. + Limit *InQueryLimit `form:"limit,omitempty" json:"limit,omitempty"` + + // Offset Skip the first entries of the data cursor. + Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` + + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. + Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` + + // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. + Stats *InQueryStats `form:"stats,omitempty" json:"stats,omitempty"` + + // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). + Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` + + // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). + Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` +} + +// GetServiceChecksParams defines parameters for GetServiceChecks. +type GetServiceChecksParams struct { + // Props A list of properties to include in each data dictionnary. + Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` + + // Limit The maximum number of entries to return. 0 means no limit. + Limit *InQueryLimit `form:"limit,omitempty" json:"limit,omitempty"` + + // Offset Skip the first entries of the data cursor. + Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` + + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. + Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` + + // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. + Stats *InQueryStats `form:"stats,omitempty" json:"stats,omitempty"` + + // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). + Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` + + // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). + Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` +} + +// GetServiceComplianceCandidateModulesetsParams defines parameters for GetServiceComplianceCandidateModulesets. +type GetServiceComplianceCandidateModulesetsParams struct { + // Props A list of properties to include in each data dictionnary. + Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` + + // Limit The maximum number of entries to return. 0 means no limit. + Limit *InQueryLimit `form:"limit,omitempty" json:"limit,omitempty"` + + // Offset Skip the first entries of the data cursor. + Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` + + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. + Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` + + // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. + Stats *InQueryStats `form:"stats,omitempty" json:"stats,omitempty"` + + // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). + Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` + + // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). + Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` +} + +// GetServiceComplianceCandidateRulesetsParams defines parameters for GetServiceComplianceCandidateRulesets. +type GetServiceComplianceCandidateRulesetsParams struct { + // Slave If true, list rulesets attachable to the encapsulated service + Slave *bool `form:"slave,omitempty" json:"slave,omitempty"` + + // Props A list of properties to include in each data dictionnary. + Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` + + // Limit The maximum number of entries to return. 0 means no limit. + Limit *InQueryLimit `form:"limit,omitempty" json:"limit,omitempty"` + + // Offset Skip the first entries of the data cursor. + Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` + + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. + Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` + + // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. + Stats *InQueryStats `form:"stats,omitempty" json:"stats,omitempty"` + + // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). + Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` + + // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). + Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` +} + +// GetServiceComplianceLogsParams defines parameters for GetServiceComplianceLogs. +type GetServiceComplianceLogsParams struct { + // Props A list of properties to include in each data dictionnary. + Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` + + // Limit The maximum number of entries to return. 0 means no limit. + Limit *InQueryLimit `form:"limit,omitempty" json:"limit,omitempty"` + + // Offset Skip the first entries of the data cursor. + Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` + + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. + Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` + + // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. + Stats *InQueryStats `form:"stats,omitempty" json:"stats,omitempty"` + + // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). + Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` + + // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). + Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` +} + +// GetServiceComplianceModulesetsParams defines parameters for GetServiceComplianceModulesets. +type GetServiceComplianceModulesetsParams struct { + // Slave If true, list modulesets attached to the encapsulated service + Slave *bool `form:"slave,omitempty" json:"slave,omitempty"` + + // Props A list of properties to include in each data dictionnary. + Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` + + // Limit The maximum number of entries to return. 0 means no limit. + Limit *InQueryLimit `form:"limit,omitempty" json:"limit,omitempty"` + + // Offset Skip the first entries of the data cursor. + Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` + + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. + Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` + + // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. + Stats *InQueryStats `form:"stats,omitempty" json:"stats,omitempty"` + + // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). + Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` + + // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). + Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` +} + +// DeleteServiceComplianceModulesetParams defines parameters for DeleteServiceComplianceModuleset. +type DeleteServiceComplianceModulesetParams struct { + // Slave If true, detach from the encapsulated service + Slave *bool `form:"slave,omitempty" json:"slave,omitempty"` +} + +// PostServiceComplianceModulesetParams defines parameters for PostServiceComplianceModuleset. +type PostServiceComplianceModulesetParams struct { + // Slave If true, attach to the encapsulated service + Slave *bool `form:"slave,omitempty" json:"slave,omitempty"` +} + +// GetServiceComplianceRulesetsParams defines parameters for GetServiceComplianceRulesets. +type GetServiceComplianceRulesetsParams struct { + // Slave If true, list rulesets attached to the encapsulated service + Slave *bool `form:"slave,omitempty" json:"slave,omitempty"` + + // Props A list of properties to include in each data dictionnary. + Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` + + // Limit The maximum number of entries to return. 0 means no limit. + Limit *InQueryLimit `form:"limit,omitempty" json:"limit,omitempty"` + + // Offset Skip the first entries of the data cursor. + Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` + + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. + Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` + + // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. + Stats *InQueryStats `form:"stats,omitempty" json:"stats,omitempty"` + + // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). + Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` + + // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). + Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` +} + +// DeleteServiceComplianceRulesetParams defines parameters for DeleteServiceComplianceRuleset. +type DeleteServiceComplianceRulesetParams struct { + // Slave If true, detach from the encapsulated service + Slave *bool `form:"slave,omitempty" json:"slave,omitempty"` +} + +// PostServiceComplianceRulesetParams defines parameters for PostServiceComplianceRuleset. +type PostServiceComplianceRulesetParams struct { + // Slave If true, attach to the encapsulated service + Slave *bool `form:"slave,omitempty" json:"slave,omitempty"` +} + +// GetServiceComplianceStatusParams defines parameters for GetServiceComplianceStatus. +type GetServiceComplianceStatusParams struct { + // Props A list of properties to include in each data dictionnary. + Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` + + // Limit The maximum number of entries to return. 0 means no limit. + Limit *InQueryLimit `form:"limit,omitempty" json:"limit,omitempty"` + + // Offset Skip the first entries of the data cursor. + Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` + + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. + Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` + + // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. + Stats *InQueryStats `form:"stats,omitempty" json:"stats,omitempty"` + + // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). + Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` + + // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). + Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` +} + +// GetServiceDisksParams defines parameters for GetServiceDisks. +type GetServiceDisksParams struct { + // Props A list of properties to include in each data dictionnary. + Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` + + // Limit The maximum number of entries to return. 0 means no limit. + Limit *InQueryLimit `form:"limit,omitempty" json:"limit,omitempty"` + + // Offset Skip the first entries of the data cursor. + Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` + + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. + Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` + + // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. + Stats *InQueryStats `form:"stats,omitempty" json:"stats,omitempty"` + + // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). + Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` + + // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). + Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` +} + +// GetServiceInstanceParams defines parameters for GetServiceInstance. +type GetServiceInstanceParams struct { + // Props A list of properties to include in each data dictionnary. + Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` + + // Limit The maximum number of entries to return. 0 means no limit. + Limit *InQueryLimit `form:"limit,omitempty" json:"limit,omitempty"` + + // Offset Skip the first entries of the data cursor. + Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` + + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. + Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` + + // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. + Stats *InQueryStats `form:"stats,omitempty" json:"stats,omitempty"` + + // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). + Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` + + // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). + Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` +} + +// GetServiceNodesParams defines parameters for GetServiceNodes. +type GetServiceNodesParams struct { + // Props A list of properties to include in each data dictionnary. + Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` + + // Limit The maximum number of entries to return. 0 means no limit. + Limit *InQueryLimit `form:"limit,omitempty" json:"limit,omitempty"` + + // Offset Skip the first entries of the data cursor. + Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` + + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. + Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` + + // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. + Stats *InQueryStats `form:"stats,omitempty" json:"stats,omitempty"` + + // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). + Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` + + // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). + Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` +} + +// GetServiceNodeParams defines parameters for GetServiceNode. +type GetServiceNodeParams struct { + // Props A list of properties to include in each data dictionnary. + Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` + + // Limit The maximum number of entries to return. 0 means no limit. + Limit *InQueryLimit `form:"limit,omitempty" json:"limit,omitempty"` + + // Offset Skip the first entries of the data cursor. + Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` + + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. + Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` + + // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. + Stats *InQueryStats `form:"stats,omitempty" json:"stats,omitempty"` + + // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). + Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` + + // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). + Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` +} + +// GetServiceNodeResourcesParams defines parameters for GetServiceNodeResources. +type GetServiceNodeResourcesParams struct { + // Props A list of properties to include in each data dictionnary. + Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` + + // Limit The maximum number of entries to return. 0 means no limit. + Limit *InQueryLimit `form:"limit,omitempty" json:"limit,omitempty"` + + // Offset Skip the first entries of the data cursor. + Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` + + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. + Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` + + // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. + Stats *InQueryStats `form:"stats,omitempty" json:"stats,omitempty"` + + // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). + Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` + + // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). + Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` +} + +// GetServiceNodeResourceLogsParams defines parameters for GetServiceNodeResourceLogs. +type GetServiceNodeResourceLogsParams struct { + // Props A list of properties to include in each data dictionnary. + Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` + + // Limit The maximum number of entries to return. 0 means no limit. + Limit *InQueryLimit `form:"limit,omitempty" json:"limit,omitempty"` + + // Offset Skip the first entries of the data cursor. + Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` + + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. + Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` + + // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. + Stats *InQueryStats `form:"stats,omitempty" json:"stats,omitempty"` + + // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). + Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` + + // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). + Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` +} + +// GetServiceResinfoParams defines parameters for GetServiceResinfo. +type GetServiceResinfoParams struct { + // Props A list of properties to include in each data dictionnary. + Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` + + // Limit The maximum number of entries to return. 0 means no limit. + Limit *InQueryLimit `form:"limit,omitempty" json:"limit,omitempty"` + + // Offset Skip the first entries of the data cursor. + Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` + + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. + Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` + + // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. + Stats *InQueryStats `form:"stats,omitempty" json:"stats,omitempty"` + + // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). + Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` + + // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). + Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` +} + +// GetServiceResourcesParams defines parameters for GetServiceResources. +type GetServiceResourcesParams struct { + // Props A list of properties to include in each data dictionnary. + Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` + + // Limit The maximum number of entries to return. 0 means no limit. + Limit *InQueryLimit `form:"limit,omitempty" json:"limit,omitempty"` + + // Offset Skip the first entries of the data cursor. + Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` + + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. + Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` + + // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. + Stats *InQueryStats `form:"stats,omitempty" json:"stats,omitempty"` + + // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). + Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` + + // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). + Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` +} + +// GetServiceResourceLogsParams defines parameters for GetServiceResourceLogs. +type GetServiceResourceLogsParams struct { + // Props A list of properties to include in each data dictionnary. + Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` + + // Limit The maximum number of entries to return. 0 means no limit. + Limit *InQueryLimit `form:"limit,omitempty" json:"limit,omitempty"` + + // Offset Skip the first entries of the data cursor. + Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` + + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. + Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` + + // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. + Stats *InQueryStats `form:"stats,omitempty" json:"stats,omitempty"` + + // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). + Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` + + // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). + Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` +} + +// GetServiceTagsParams defines parameters for GetServiceTags. +type GetServiceTagsParams struct { + // Props A list of properties to include in each data dictionnary. + Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` + + // Limit The maximum number of entries to return. 0 means no limit. + Limit *InQueryLimit `form:"limit,omitempty" json:"limit,omitempty"` + + // Offset Skip the first entries of the data cursor. + Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` + + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. + Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` + + // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. + Stats *InQueryStats `form:"stats,omitempty" json:"stats,omitempty"` + + // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). + Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` + + // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). + Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` +} + +// DeleteServicesInstancesJSONBody defines parameters for DeleteServicesInstances. +type DeleteServicesInstancesJSONBody struct { + // Id Service instance record id, as an alternative to svc_id + node_id + Id *int `json:"id,omitempty"` + + // NodeId Node id or name, to be used along with svc_id + NodeId *string `json:"node_id,omitempty"` + + // SvcId Service id or name, to be used along with node_id + SvcId *string `json:"svc_id,omitempty"` +} + +// GetServicesInstancesParams defines parameters for GetServicesInstances. +type GetServicesInstancesParams struct { + // Props A list of properties to include in each data dictionnary. + Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` + + // Limit The maximum number of entries to return. 0 means no limit. + Limit *InQueryLimit `form:"limit,omitempty" json:"limit,omitempty"` + + // Offset Skip the first entries of the data cursor. + Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` + + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. + Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` + + // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. + Stats *InQueryStats `form:"stats,omitempty" json:"stats,omitempty"` + + // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). + Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` + + // Filter Column filter, repeatable; several filters combine with AND. Each value is + // `prop:expr`, `prop` being a property of the list (joined ones included, as + // for orderby) and `expr` one of: + // - text: case-insensitive match anywhere in the value; + // - `~regex`: regular expression (RE2 syntax), case-insensitive; + // - `in:a,b,c`: one of the listed values; + // - `eq:v`, `ne:v`: equal, not equal; + // - `gt:v`, `gte:v`, `lt:v`, `lte:v`: comparisons, for numbers and dates; + // - `empty`, `!empty`: no value, any value. + // An unknown property, a property without a column, or an invalid regular + // expression is answered with 400. + Filter *InQueryFilter `form:"filter,omitempty" json:"filter,omitempty"` + + // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). + Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` +} + +// GetServicesInstanceParams defines parameters for GetServicesInstance. +type GetServicesInstanceParams struct { + // Props A list of properties to include in each data dictionnary. + Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` + + // Limit The maximum number of entries to return. 0 means no limit. + Limit *InQueryLimit `form:"limit,omitempty" json:"limit,omitempty"` + + // Offset Skip the first entries of the data cursor. + Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` + + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. + Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` + + // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. + Stats *InQueryStats `form:"stats,omitempty" json:"stats,omitempty"` + + // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). + Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` + + // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). + Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` +} + +// GetServicesInstancesStatusLogParams defines parameters for GetServicesInstancesStatusLog. +type GetServicesInstancesStatusLogParams struct { + // Props A list of properties to include in each data dictionnary. + Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` + + // Limit The maximum number of entries to return. 0 means no limit. + Limit *InQueryLimit `form:"limit,omitempty" json:"limit,omitempty"` + + // Offset Skip the first entries of the data cursor. + Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` + + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. + Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` + + // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. + Stats *InQueryStats `form:"stats,omitempty" json:"stats,omitempty"` + + // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). + Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` + + // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). + Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` +} + +// GetServicesStatusLogParams defines parameters for GetServicesStatusLog. +type GetServicesStatusLogParams struct { + // Props A list of properties to include in each data dictionnary. + Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` + + // Limit The maximum number of entries to return. 0 means no limit. + Limit *InQueryLimit `form:"limit,omitempty" json:"limit,omitempty"` + + // Offset Skip the first entries of the data cursor. + Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` + + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. + Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` + + // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. + Stats *InQueryStats `form:"stats,omitempty" json:"stats,omitempty"` + + // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). + Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` + + // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). + Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` +} + +// DeleteTagsJSONBody defines parameters for DeleteTags. +type DeleteTagsJSONBody struct { + // TagId Tag tag_id, or tag record id + TagId string `json:"tag_id"` +} + +// GetTagsParams defines parameters for GetTags. +type GetTagsParams struct { + // Props A list of properties to include in each data dictionnary. + Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` + + // Limit The maximum number of entries to return. 0 means no limit. + Limit *InQueryLimit `form:"limit,omitempty" json:"limit,omitempty"` + + // Offset Skip the first entries of the data cursor. + Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` + + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. + Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` + + // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. + Stats *InQueryStats `form:"stats,omitempty" json:"stats,omitempty"` + + // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). + Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` + + // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). + Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` +} + +// PostTagsJSONBody defines parameters for PostTags. +type PostTagsJSONBody struct { + // TagData Free form JSON data attached to the tag + TagData *string `json:"tag_data,omitempty"` + + // TagExclude Regular expression of tag names that can not be attached along with this tag + TagExclude *string `json:"tag_exclude,omitempty"` + TagName string `json:"tag_name"` +} + +// DeleteTagsNodesJSONBody defines parameters for DeleteTagsNodes. +type DeleteTagsNodesJSONBody struct { + // NodeId Node id + NodeId string `json:"node_id"` + + // TagId Tag tag_id, or tag record id + TagId string `json:"tag_id"` +} + +// GetTagsNodesParams defines parameters for GetTagsNodes. +type GetTagsNodesParams struct { + // Props A list of properties to include in each data dictionnary. + Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` + + // Limit The maximum number of entries to return. 0 means no limit. + Limit *InQueryLimit `form:"limit,omitempty" json:"limit,omitempty"` + + // Offset Skip the first entries of the data cursor. + Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` + + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. + Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` + + // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. + Stats *InQueryStats `form:"stats,omitempty" json:"stats,omitempty"` + + // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). + Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` + + // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). + Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` +} + +// PostTagsNodesJSONBody defines parameters for PostTagsNodes. +type PostTagsNodesJSONBody struct { + // NodeId Node id + NodeId string `json:"node_id"` + + // TagAttachData Free form JSON data attached to the attachment + TagAttachData *string `json:"tag_attach_data,omitempty"` + + // TagId Tag tag_id, or tag record id + TagId string `json:"tag_id"` +} + +// DeleteTagsServicesJSONBody defines parameters for DeleteTagsServices. +type DeleteTagsServicesJSONBody struct { + // SvcId Service id or name + SvcId string `json:"svc_id"` + + // TagId Tag tag_id, or tag record id + TagId string `json:"tag_id"` +} + +// GetTagsServicesParams defines parameters for GetTagsServices. +type GetTagsServicesParams struct { + // Props A list of properties to include in each data dictionnary. + Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` + + // Limit The maximum number of entries to return. 0 means no limit. + Limit *InQueryLimit `form:"limit,omitempty" json:"limit,omitempty"` + + // Offset Skip the first entries of the data cursor. + Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` + + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. + Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` + + // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. + Stats *InQueryStats `form:"stats,omitempty" json:"stats,omitempty"` + + // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). + Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` + + // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). + Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` +} + +// PostTagsServicesJSONBody defines parameters for PostTagsServices. +type PostTagsServicesJSONBody struct { + // SvcId Service id or name + SvcId string `json:"svc_id"` + + // TagAttachData Free form JSON data attached to the attachment + TagAttachData *string `json:"tag_attach_data,omitempty"` + + // TagId Tag tag_id, or tag record id + TagId string `json:"tag_id"` +} + +// GetTagParams defines parameters for GetTag. +type GetTagParams struct { + // Props A list of properties to include in each data dictionnary. + Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` +} + +// PostTagJSONBody defines parameters for PostTag. +type PostTagJSONBody struct { + TagData *string `json:"tag_data,omitempty"` + TagExclude *string `json:"tag_exclude,omitempty"` + TagName *string `json:"tag_name,omitempty"` +} + +// GetTagNodesParams defines parameters for GetTagNodes. +type GetTagNodesParams struct { + // Props A list of properties to include in each data dictionnary. + Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` + + // Limit The maximum number of entries to return. 0 means no limit. + Limit *InQueryLimit `form:"limit,omitempty" json:"limit,omitempty"` + + // Offset Skip the first entries of the data cursor. + Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` +} + +// PostTagNodeJSONBody defines parameters for PostTagNode. +type PostTagNodeJSONBody struct { + TagAttachData *string `json:"tag_attach_data,omitempty"` +} + +// GetTagServicesParams defines parameters for GetTagServices. +type GetTagServicesParams struct { + // Props A list of properties to include in each data dictionnary. + Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` + + // Limit The maximum number of entries to return. 0 means no limit. + Limit *InQueryLimit `form:"limit,omitempty" json:"limit,omitempty"` + + // Offset Skip the first entries of the data cursor. + Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` + + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. + Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` + + // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. + Stats *InQueryStats `form:"stats,omitempty" json:"stats,omitempty"` + + // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). + Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` + + // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). + Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` +} + +// PostTagServiceJSONBody defines parameters for PostTagService. +type PostTagServiceJSONBody struct { + TagAttachData *string `json:"tag_attach_data,omitempty"` +} + +// GetUsersParams defines parameters for GetUsers. +type GetUsersParams struct { + // Props A list of properties to include in each data dictionnary. + Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` + + // Limit The maximum number of entries to return. 0 means no limit. + Limit *InQueryLimit `form:"limit,omitempty" json:"limit,omitempty"` + + // Offset Skip the first entries of the data cursor. + Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` + + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. + Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` + + // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. + Stats *InQueryStats `form:"stats,omitempty" json:"stats,omitempty"` + + // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). + Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` + + // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). + Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` + + // Filter Column filter, repeatable; several filters combine with AND. Each value is + // `prop:expr`, `prop` being a property of the list (joined ones included, as + // for orderby) and `expr` one of: + // - text: case-insensitive match anywhere in the value; + // - `~regex`: regular expression (RE2 syntax), case-insensitive; + // - `in:a,b,c`: one of the listed values; + // - `eq:v`, `ne:v`: equal, not equal; + // - `gt:v`, `gte:v`, `lt:v`, `lte:v`: comparisons, for numbers and dates; + // - `empty`, `!empty`: no value, any value. + // An unknown property, a property without a column, or an invalid regular + // expression is answered with 400. + Filter *InQueryFilter `form:"filter,omitempty" json:"filter,omitempty"` +} + +// PostUsersJSONBody defines parameters for PostUsers. +type PostUsersJSONBody struct { + Email string `json:"email"` + FirstName *string `json:"first_name,omitempty"` + LastName *string `json:"last_name,omitempty"` + + // Password At least 8 characters. Stored as a web2py hash. + Password *string `json:"password,omitempty"` + PhoneWork *string `json:"phone_work,omitempty"` + Username *string `json:"username,omitempty"` +} + +// PostUserSelfPasswordJSONBody defines parameters for PostUserSelfPassword. +type PostUserSelfPasswordJSONBody struct { + CurrentPassword string `json:"current_password"` + + // NewPassword At least 12 characters. + NewPassword string `json:"new_password"` +} + +// GetUserParams defines parameters for GetUser. +type GetUserParams struct { + // Props A list of properties to include in each data dictionnary. + Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` + + // Limit The maximum number of entries to return. 0 means no limit. + Limit *InQueryLimit `form:"limit,omitempty" json:"limit,omitempty"` + + // Offset Skip the first entries of the data cursor. + Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` + + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. + Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` + + // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. + Stats *InQueryStats `form:"stats,omitempty" json:"stats,omitempty"` + + // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). + Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` + + // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). + Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` +} + +// PostUserJSONBody defines parameters for PostUser. +type PostUserJSONBody struct { + Email *string `json:"email,omitempty"` + FirstName *string `json:"first_name,omitempty"` + LastName *string `json:"last_name,omitempty"` +} + +// PostUserPrefsJSONBody defines parameters for PostUserPrefs. +type PostUserPrefsJSONBody struct { + // Data The preferences object, stored verbatim. + Data map[string]interface{} `json:"data"` + + // Uuid Opaque sender identifier echoed in the user_prefs_change + // event, so a client can ignore its own update. + Uuid *string `json:"uuid,omitempty"` +} + +// GetWorkflowsParams defines parameters for GetWorkflows. +type GetWorkflowsParams struct { + // Props A list of properties to include in each data dictionnary. + Props *InQueryProps `form:"props,omitempty" json:"props,omitempty"` + + // Limit The maximum number of entries to return. 0 means no limit. + Limit *InQueryLimit `form:"limit,omitempty" json:"limit,omitempty"` + + // Offset Skip the first entries of the data cursor. + Offset *InQueryOffset `form:"offset,omitempty" json:"offset,omitempty"` + + // Meta Include metadata in the response. Enabled by default. Use false or 0 to omit + // the meta field. The metadata of a list carries its total number of rows + // without pagination (total), as well as the rows returned (count), the offset + // and the limit. + Meta *InQueryMeta `form:"meta,omitempty" json:"meta,omitempty"` + + // Stats Controls the inclusion in the returned dictionnary of a "stats" key, containing the selected properties distinct values counts. + Stats *InQueryStats `form:"stats,omitempty" json:"stats,omitempty"` + + // Orderby Comma-separated list of properties to sort by. Prefix a property with - for descending order (e.g. orderby=nodename,-app). + Orderby *InQueryOrderby `form:"orderby,omitempty" json:"orderby,omitempty"` + + // Filter Column filter, repeatable; several filters combine with AND. Each value is + // `prop:expr`, `prop` being a property of the list (joined ones included, as + // for orderby) and `expr` one of: + // - text: case-insensitive match anywhere in the value; + // - `~regex`: regular expression (RE2 syntax), case-insensitive; + // - `in:a,b,c`: one of the listed values; + // - `eq:v`, `ne:v`: equal, not equal; + // - `gt:v`, `gte:v`, `lt:v`, `lte:v`: comparisons, for numbers and dates; + // - `empty`, `!empty`: no value, any value. + // An unknown property, a property without a column, or an invalid regular + // expression is answered with 400. + Filter *InQueryFilter `form:"filter,omitempty" json:"filter,omitempty"` + + // Groupby Comma-separated list of properties to group the result by (e.g. groupby=app,svcname). + Groupby *InQueryGroupby `form:"groupby,omitempty" json:"groupby,omitempty"` + + // Assigned Keep the pending workflows (status not closed) related to the caller's + // team, the caller's full name and the roles of their non-privilege + // groups: `team` those whose last assignee is in the team, as the + // historical "Assigned to my team"; `tiers` those created by the team and + // assigned to someone else, as the historical "Pending tiers action". + Assigned *GetWorkflowsParamsAssigned `form:"assigned,omitempty" json:"assigned,omitempty"` +} + +// GetWorkflowsParamsAssigned defines parameters for GetWorkflows. +type GetWorkflowsParamsAssigned string + +// PostActionsJSONRequestBody defines body for PostActions for application/json ContentType. +type PostActionsJSONRequestBody PostActionsJSONBody + +// PutActionsJSONRequestBody defines body for PutActions for application/json ContentType. +type PutActionsJSONRequestBody PutActionsJSONBody + +// DeleteAlertsJSONRequestBody defines body for DeleteAlerts for application/json ContentType. +type DeleteAlertsJSONRequestBody DeleteAlertsJSONBody + +// PostAlertsJSONRequestBody defines body for PostAlerts for application/json ContentType. +type PostAlertsJSONRequestBody PostAlertsJSONBody + +// PostAlertJSONRequestBody defines body for PostAlert for application/json ContentType. +type PostAlertJSONRequestBody PostAlertJSONBody + +// DeleteAppsJSONRequestBody defines body for DeleteApps for application/json ContentType. +type DeleteAppsJSONRequestBody DeleteAppsJSONBody + +// PostAppsJSONRequestBody defines body for PostApps for application/json ContentType. +type PostAppsJSONRequestBody PostAppsJSONBody + +// PostAppJSONRequestBody defines body for PostApp for application/json ContentType. +type PostAppJSONRequestBody PostAppJSONBody + +// DeleteAppsPublicationsJSONRequestBody defines body for DeleteAppsPublications for application/json ContentType. +type DeleteAppsPublicationsJSONRequestBody DeleteAppsPublicationsJSONBody + +// PostAppsPublicationsJSONRequestBody defines body for PostAppsPublications for application/json ContentType. +type PostAppsPublicationsJSONRequestBody PostAppsPublicationsJSONBody + +// DeleteAppsResponsiblesJSONRequestBody defines body for DeleteAppsResponsibles for application/json ContentType. +type DeleteAppsResponsiblesJSONRequestBody DeleteAppsResponsiblesJSONBody + +// PostAppsResponsiblesJSONRequestBody defines body for PostAppsResponsibles for application/json ContentType. +type PostAppsResponsiblesJSONRequestBody PostAppsResponsiblesJSONBody + +// PostAuthNodeJSONRequestBody defines body for PostAuthNode for application/json ContentType. +type PostAuthNodeJSONRequestBody PostAuthNodeJSONBody + +// PostComplianceImportJSONRequestBody defines body for PostComplianceImport for application/json ContentType. +type PostComplianceImportJSONRequestBody PostComplianceImportJSONBody + +// DeleteComplianceModulesetsJSONRequestBody defines body for DeleteComplianceModulesets for application/json ContentType. +type DeleteComplianceModulesetsJSONRequestBody DeleteComplianceModulesetsJSONBody + +// PostComplianceModulesetsJSONRequestBody defines body for PostComplianceModulesets for application/json ContentType. +type PostComplianceModulesetsJSONRequestBody PostComplianceModulesetsJSONBody + +// PostComplianceModulesetJSONRequestBody defines body for PostComplianceModuleset for application/json ContentType. +type PostComplianceModulesetJSONRequestBody PostComplianceModulesetJSONBody + +// PutComplianceModulesetJSONRequestBody defines body for PutComplianceModuleset for application/json ContentType. +type PutComplianceModulesetJSONRequestBody PutComplianceModulesetJSONBody + +// PostComplianceModulesetModulesJSONRequestBody defines body for PostComplianceModulesetModules for application/json ContentType. +type PostComplianceModulesetModulesJSONRequestBody PostComplianceModulesetModulesJSONBody + +// PostComplianceModulesetModuleJSONRequestBody defines body for PostComplianceModulesetModule for application/json ContentType. +type PostComplianceModulesetModuleJSONRequestBody PostComplianceModulesetModuleJSONBody + +// DeleteComplianceModulesetsNodesJSONRequestBody defines body for DeleteComplianceModulesetsNodes for application/json ContentType. +type DeleteComplianceModulesetsNodesJSONRequestBody DeleteComplianceModulesetsNodesJSONBody + +// PostComplianceModulesetsNodesJSONRequestBody defines body for PostComplianceModulesetsNodes for application/json ContentType. +type PostComplianceModulesetsNodesJSONRequestBody PostComplianceModulesetsNodesJSONBody + +// DeleteComplianceModulesetsPublicationsJSONRequestBody defines body for DeleteComplianceModulesetsPublications for application/json ContentType. +type DeleteComplianceModulesetsPublicationsJSONRequestBody DeleteComplianceModulesetsPublicationsJSONBody + +// PostComplianceModulesetsPublicationsJSONRequestBody defines body for PostComplianceModulesetsPublications for application/json ContentType. +type PostComplianceModulesetsPublicationsJSONRequestBody PostComplianceModulesetsPublicationsJSONBody + +// DeleteComplianceModulesetsResponsiblesJSONRequestBody defines body for DeleteComplianceModulesetsResponsibles for application/json ContentType. +type DeleteComplianceModulesetsResponsiblesJSONRequestBody DeleteComplianceModulesetsResponsiblesJSONBody + +// PostComplianceModulesetsResponsiblesJSONRequestBody defines body for PostComplianceModulesetsResponsibles for application/json ContentType. +type PostComplianceModulesetsResponsiblesJSONRequestBody PostComplianceModulesetsResponsiblesJSONBody + +// DeleteComplianceModulesetsServicesJSONRequestBody defines body for DeleteComplianceModulesetsServices for application/json ContentType. +type DeleteComplianceModulesetsServicesJSONRequestBody DeleteComplianceModulesetsServicesJSONBody + +// PostComplianceModulesetsServicesJSONRequestBody defines body for PostComplianceModulesetsServices for application/json ContentType. +type PostComplianceModulesetsServicesJSONRequestBody PostComplianceModulesetsServicesJSONBody + +// DeleteComplianceRulesetsJSONRequestBody defines body for DeleteComplianceRulesets for application/json ContentType. +type DeleteComplianceRulesetsJSONRequestBody DeleteComplianceRulesetsJSONBody + +// PostComplianceRulesetsJSONRequestBody defines body for PostComplianceRulesets for application/json ContentType. +type PostComplianceRulesetsJSONRequestBody PostComplianceRulesetsJSONBody + +// PostComplianceRulesetJSONRequestBody defines body for PostComplianceRuleset for application/json ContentType. +type PostComplianceRulesetJSONRequestBody PostComplianceRulesetJSONBody + +// PutComplianceRulesetJSONRequestBody defines body for PutComplianceRuleset for application/json ContentType. +type PutComplianceRulesetJSONRequestBody PutComplianceRulesetJSONBody + +// PostComplianceRulesetVariablesJSONRequestBody defines body for PostComplianceRulesetVariables for application/json ContentType. +type PostComplianceRulesetVariablesJSONRequestBody PostComplianceRulesetVariablesJSONBody + +// PostComplianceRulesetVariableJSONRequestBody defines body for PostComplianceRulesetVariable for application/json ContentType. +type PostComplianceRulesetVariableJSONRequestBody PostComplianceRulesetVariableJSONBody + +// PutComplianceRulesetVariableJSONRequestBody defines body for PutComplianceRulesetVariable for application/json ContentType. +type PutComplianceRulesetVariableJSONRequestBody PutComplianceRulesetVariableJSONBody + +// DeleteComplianceRulesetsNodesJSONRequestBody defines body for DeleteComplianceRulesetsNodes for application/json ContentType. +type DeleteComplianceRulesetsNodesJSONRequestBody DeleteComplianceRulesetsNodesJSONBody + +// PostComplianceRulesetsNodesJSONRequestBody defines body for PostComplianceRulesetsNodes for application/json ContentType. +type PostComplianceRulesetsNodesJSONRequestBody PostComplianceRulesetsNodesJSONBody + +// DeleteComplianceRulesetsPublicationsJSONRequestBody defines body for DeleteComplianceRulesetsPublications for application/json ContentType. +type DeleteComplianceRulesetsPublicationsJSONRequestBody DeleteComplianceRulesetsPublicationsJSONBody + +// PostComplianceRulesetsPublicationsJSONRequestBody defines body for PostComplianceRulesetsPublications for application/json ContentType. +type PostComplianceRulesetsPublicationsJSONRequestBody PostComplianceRulesetsPublicationsJSONBody + +// DeleteComplianceRulesetsResponsiblesJSONRequestBody defines body for DeleteComplianceRulesetsResponsibles for application/json ContentType. +type DeleteComplianceRulesetsResponsiblesJSONRequestBody DeleteComplianceRulesetsResponsiblesJSONBody + +// PostComplianceRulesetsResponsiblesJSONRequestBody defines body for PostComplianceRulesetsResponsibles for application/json ContentType. +type PostComplianceRulesetsResponsiblesJSONRequestBody PostComplianceRulesetsResponsiblesJSONBody + +// DeleteComplianceRulesetsServicesJSONRequestBody defines body for DeleteComplianceRulesetsServices for application/json ContentType. +type DeleteComplianceRulesetsServicesJSONRequestBody DeleteComplianceRulesetsServicesJSONBody + +// PostComplianceRulesetsServicesJSONRequestBody defines body for PostComplianceRulesetsServices for application/json ContentType. +type PostComplianceRulesetsServicesJSONRequestBody PostComplianceRulesetsServicesJSONBody + +// PostComplianceRulesetsVariablesJSONRequestBody defines body for PostComplianceRulesetsVariables for application/json ContentType. +type PostComplianceRulesetsVariablesJSONRequestBody PostComplianceRulesetsVariablesJSONBody + +// DeleteComplianceStatusJSONRequestBody defines body for DeleteComplianceStatus for application/json ContentType. +type DeleteComplianceStatusJSONRequestBody DeleteComplianceStatusJSONBody + +// DeleteDisksJSONRequestBody defines body for DeleteDisks for application/json ContentType. +type DeleteDisksJSONRequestBody DeleteDisksJSONBody + +// PostDisksJSONRequestBody defines body for PostDisks for application/json ContentType. +type PostDisksJSONRequestBody PostDisksJSONBody + +// DeleteFiltersJSONRequestBody defines body for DeleteFilters for application/json ContentType. +type DeleteFiltersJSONRequestBody DeleteFiltersJSONBody + +// PostFiltersJSONRequestBody defines body for PostFilters for application/json ContentType. +type PostFiltersJSONRequestBody PostFiltersJSONBody + +// PostFilterJSONRequestBody defines body for PostFilter for application/json ContentType. +type PostFilterJSONRequestBody PostFilterJSONBody + +// DeleteFiltersetsJSONRequestBody defines body for DeleteFiltersets for application/json ContentType. +type DeleteFiltersetsJSONRequestBody DeleteFiltersetsJSONBody + +// PostFiltersetsJSONRequestBody defines body for PostFiltersets for application/json ContentType. +type PostFiltersetsJSONRequestBody PostFiltersetsJSONBody + +// PostFiltersetJSONRequestBody defines body for PostFilterset for application/json ContentType. +type PostFiltersetJSONRequestBody PostFiltersetJSONBody + +// PostFiltersetFilterJSONRequestBody defines body for PostFiltersetFilter for application/json ContentType. +type PostFiltersetFilterJSONRequestBody PostFiltersetFilterJSONBody + +// PostFiltersetFiltersetJSONRequestBody defines body for PostFiltersetFilterset for application/json ContentType. +type PostFiltersetFiltersetJSONRequestBody PostFiltersetFiltersetJSONBody + +// DeleteFiltersetsFiltersJSONRequestBody defines body for DeleteFiltersetsFilters for application/json ContentType. +type DeleteFiltersetsFiltersJSONRequestBody DeleteFiltersetsFiltersJSONBody + +// PostFiltersetsFiltersJSONRequestBody defines body for PostFiltersetsFilters for application/json ContentType. +type PostFiltersetsFiltersJSONRequestBody PostFiltersetsFiltersJSONBody + +// DeleteFiltersetsFiltersetsJSONRequestBody defines body for DeleteFiltersetsFiltersets for application/json ContentType. +type DeleteFiltersetsFiltersetsJSONRequestBody DeleteFiltersetsFiltersetsJSONBody + +// PostFiltersetsFiltersetsJSONRequestBody defines body for PostFiltersetsFiltersets for application/json ContentType. +type PostFiltersetsFiltersetsJSONRequestBody PostFiltersetsFiltersetsJSONBody + +// PutFormOutputResultsJSONRequestBody defines body for PutFormOutputResults for application/json ContentType. +type PutFormOutputResultsJSONRequestBody PutFormOutputResultsJSONBody + +// DeleteFormsJSONRequestBody defines body for DeleteForms for application/json ContentType. +type DeleteFormsJSONRequestBody DeleteFormsJSONBody + +// PostFormsJSONRequestBody defines body for PostForms for application/json ContentType. +type PostFormsJSONRequestBody PostFormsJSONBody + +// PostFormJSONRequestBody defines body for PostForm for application/json ContentType. +type PostFormJSONRequestBody PostFormJSONBody + +// PutFormJSONRequestBody defines body for PutForm for application/json ContentType. +type PutFormJSONRequestBody PutFormJSONBody + +// DeleteFormsPublicationsJSONRequestBody defines body for DeleteFormsPublications for application/json ContentType. +type DeleteFormsPublicationsJSONRequestBody DeleteFormsPublicationsJSONBody + +// PostFormsPublicationsJSONRequestBody defines body for PostFormsPublications for application/json ContentType. +type PostFormsPublicationsJSONRequestBody PostFormsPublicationsJSONBody + +// DeleteFormsResponsiblesJSONRequestBody defines body for DeleteFormsResponsibles for application/json ContentType. +type DeleteFormsResponsiblesJSONRequestBody DeleteFormsResponsiblesJSONBody + +// PostFormsResponsiblesJSONRequestBody defines body for PostFormsResponsibles for application/json ContentType. +type PostFormsResponsiblesJSONRequestBody PostFormsResponsiblesJSONBody + +// DeleteGroupsJSONRequestBody defines body for DeleteGroups for application/json ContentType. +type DeleteGroupsJSONRequestBody DeleteGroupsJSONBody + +// PostGroupsJSONRequestBody defines body for PostGroups for application/json ContentType. +type PostGroupsJSONRequestBody PostGroupsJSONBody + +// PostGroupJSONRequestBody defines body for PostGroup for application/json ContentType. +type PostGroupJSONRequestBody PostGroupJSONBody + +// DeleteGroupHiddenMenuEntriesJSONRequestBody defines body for DeleteGroupHiddenMenuEntries for application/json ContentType. +type DeleteGroupHiddenMenuEntriesJSONRequestBody DeleteGroupHiddenMenuEntriesJSONBody + +// PostGroupHiddenMenuEntriesJSONRequestBody defines body for PostGroupHiddenMenuEntries for application/json ContentType. +type PostGroupHiddenMenuEntriesJSONRequestBody PostGroupHiddenMenuEntriesJSONBody + +// DeleteIpsJSONRequestBody defines body for DeleteIps for application/json ContentType. +type DeleteIpsJSONRequestBody DeleteIpsJSONBody + +// PostLogsJSONRequestBody defines body for PostLogs for application/json ContentType. +type PostLogsJSONRequestBody PostLogsJSONBody + +// PostNetworksJSONRequestBody defines body for PostNetworks for application/json ContentType. +type PostNetworksJSONRequestBody PostNetworksJSONBody + +// PostNetworkSegmentsJSONRequestBody defines body for PostNetworkSegments for application/json ContentType. +type PostNetworkSegmentsJSONRequestBody PostNetworkSegmentsJSONBody + +// DeleteNodesJSONRequestBody defines body for DeleteNodes for application/json ContentType. +type DeleteNodesJSONRequestBody DeleteNodesJSONBody + +// PostNodesJSONRequestBody defines body for PostNodes for application/json ContentType. +type PostNodesJSONRequestBody PostNodesJSONBody + +// PostNodeJSONRequestBody defines body for PostNode for application/json ContentType. +type PostNodeJSONRequestBody PostNodeJSONBody + +// PostNodeComplianceModulesetJSONRequestBody defines body for PostNodeComplianceModuleset for application/json ContentType. +type PostNodeComplianceModulesetJSONRequestBody = PostNodeComplianceModulesetJSONBody + +// PostNodeComplianceRulesetJSONRequestBody defines body for PostNodeComplianceRuleset for application/json ContentType. +type PostNodeComplianceRulesetJSONRequestBody = PostNodeComplianceRulesetJSONBody + +// PostNodeSnoozeJSONRequestBody defines body for PostNodeSnooze for application/json ContentType. +type PostNodeSnoozeJSONRequestBody PostNodeSnoozeJSONBody + +// DeleteObsolescenceSettingsJSONRequestBody defines body for DeleteObsolescenceSettings for application/json ContentType. +type DeleteObsolescenceSettingsJSONRequestBody DeleteObsolescenceSettingsJSONBody + +// PostObsolescenceSettingsJSONRequestBody defines body for PostObsolescenceSettings for application/json ContentType. +type PostObsolescenceSettingsJSONRequestBody PostObsolescenceSettingsJSONBody + +// PostObsolescenceSettingJSONRequestBody defines body for PostObsolescenceSetting for application/json ContentType. +type PostObsolescenceSettingJSONRequestBody PostObsolescenceSettingJSONBody + +// DeleteServicesJSONRequestBody defines body for DeleteServices for application/json ContentType. +type DeleteServicesJSONRequestBody DeleteServicesJSONBody + +// PostServicesJSONRequestBody defines body for PostServices for application/json ContentType. +type PostServicesJSONRequestBody PostServicesJSONBody + +// PostServiceJSONRequestBody defines body for PostService for application/json ContentType. +type PostServiceJSONRequestBody PostServiceJSONBody + +// DeleteServicesInstancesJSONRequestBody defines body for DeleteServicesInstances for application/json ContentType. +type DeleteServicesInstancesJSONRequestBody DeleteServicesInstancesJSONBody + +// DeleteTagsJSONRequestBody defines body for DeleteTags for application/json ContentType. +type DeleteTagsJSONRequestBody DeleteTagsJSONBody + +// PostTagsJSONRequestBody defines body for PostTags for application/json ContentType. +type PostTagsJSONRequestBody PostTagsJSONBody + +// DeleteTagsNodesJSONRequestBody defines body for DeleteTagsNodes for application/json ContentType. +type DeleteTagsNodesJSONRequestBody DeleteTagsNodesJSONBody + +// PostTagsNodesJSONRequestBody defines body for PostTagsNodes for application/json ContentType. +type PostTagsNodesJSONRequestBody PostTagsNodesJSONBody + +// DeleteTagsServicesJSONRequestBody defines body for DeleteTagsServices for application/json ContentType. +type DeleteTagsServicesJSONRequestBody DeleteTagsServicesJSONBody + +// PostTagsServicesJSONRequestBody defines body for PostTagsServices for application/json ContentType. +type PostTagsServicesJSONRequestBody PostTagsServicesJSONBody + +// PostTagJSONRequestBody defines body for PostTag for application/json ContentType. +type PostTagJSONRequestBody PostTagJSONBody + +// PostTagNodeJSONRequestBody defines body for PostTagNode for application/json ContentType. +type PostTagNodeJSONRequestBody PostTagNodeJSONBody + +// PostTagServiceJSONRequestBody defines body for PostTagService for application/json ContentType. +type PostTagServiceJSONRequestBody PostTagServiceJSONBody + +// PostUsersJSONRequestBody defines body for PostUsers for application/json ContentType. +type PostUsersJSONRequestBody PostUsersJSONBody + +// PostUserSelfPasswordJSONRequestBody defines body for PostUserSelfPassword for application/json ContentType. +type PostUserSelfPasswordJSONRequestBody PostUserSelfPasswordJSONBody + +// PostUserJSONRequestBody defines body for PostUser for application/json ContentType. +type PostUserJSONRequestBody PostUserJSONBody + +// PostUserPrefsJSONRequestBody defines body for PostUserPrefs for application/json ContentType. +type PostUserPrefsJSONRequestBody PostUserPrefsJSONBody + +// AsAlertListResponseData0 returns the union data inside the AlertListResponse_Data as a AlertListResponseData0 +func (t AlertListResponse_Data) AsAlertListResponseData0() (AlertListResponseData0, error) { + var body AlertListResponseData0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromAlertListResponseData0 overwrites any union data inside the AlertListResponse_Data as the provided AlertListResponseData0 +func (t *AlertListResponse_Data) FromAlertListResponseData0(v AlertListResponseData0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeAlertListResponseData0 performs a merge with any union data inside the AlertListResponse_Data, using the provided AlertListResponseData0 +func (t *AlertListResponse_Data) MergeAlertListResponseData0(v AlertListResponseData0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsAlertListResponseData1 returns the union data inside the AlertListResponse_Data as a AlertListResponseData1 +func (t AlertListResponse_Data) AsAlertListResponseData1() (AlertListResponseData1, error) { + var body AlertListResponseData1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromAlertListResponseData1 overwrites any union data inside the AlertListResponse_Data as the provided AlertListResponseData1 +func (t *AlertListResponse_Data) FromAlertListResponseData1(v AlertListResponseData1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeAlertListResponseData1 performs a merge with any union data inside the AlertListResponse_Data, using the provided AlertListResponseData1 +func (t *AlertListResponse_Data) MergeAlertListResponseData1(v AlertListResponseData1) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +func (t AlertListResponse_Data) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *AlertListResponse_Data) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsAppListResponseData0 returns the union data inside the AppListResponse_Data as a AppListResponseData0 +func (t AppListResponse_Data) AsAppListResponseData0() (AppListResponseData0, error) { + var body AppListResponseData0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromAppListResponseData0 overwrites any union data inside the AppListResponse_Data as the provided AppListResponseData0 +func (t *AppListResponse_Data) FromAppListResponseData0(v AppListResponseData0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeAppListResponseData0 performs a merge with any union data inside the AppListResponse_Data, using the provided AppListResponseData0 +func (t *AppListResponse_Data) MergeAppListResponseData0(v AppListResponseData0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsAppListResponseData1 returns the union data inside the AppListResponse_Data as a AppListResponseData1 +func (t AppListResponse_Data) AsAppListResponseData1() (AppListResponseData1, error) { + var body AppListResponseData1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromAppListResponseData1 overwrites any union data inside the AppListResponse_Data as the provided AppListResponseData1 +func (t *AppListResponse_Data) FromAppListResponseData1(v AppListResponseData1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeAppListResponseData1 performs a merge with any union data inside the AppListResponse_Data, using the provided AppListResponseData1 +func (t *AppListResponse_Data) MergeAppListResponseData1(v AppListResponseData1) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +func (t AppListResponse_Data) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *AppListResponse_Data) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsComplianceLogListResponseData0 returns the union data inside the ComplianceLogListResponse_Data as a ComplianceLogListResponseData0 +func (t ComplianceLogListResponse_Data) AsComplianceLogListResponseData0() (ComplianceLogListResponseData0, error) { + var body ComplianceLogListResponseData0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromComplianceLogListResponseData0 overwrites any union data inside the ComplianceLogListResponse_Data as the provided ComplianceLogListResponseData0 +func (t *ComplianceLogListResponse_Data) FromComplianceLogListResponseData0(v ComplianceLogListResponseData0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeComplianceLogListResponseData0 performs a merge with any union data inside the ComplianceLogListResponse_Data, using the provided ComplianceLogListResponseData0 +func (t *ComplianceLogListResponse_Data) MergeComplianceLogListResponseData0(v ComplianceLogListResponseData0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsComplianceLogListResponseData1 returns the union data inside the ComplianceLogListResponse_Data as a ComplianceLogListResponseData1 +func (t ComplianceLogListResponse_Data) AsComplianceLogListResponseData1() (ComplianceLogListResponseData1, error) { + var body ComplianceLogListResponseData1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromComplianceLogListResponseData1 overwrites any union data inside the ComplianceLogListResponse_Data as the provided ComplianceLogListResponseData1 +func (t *ComplianceLogListResponse_Data) FromComplianceLogListResponseData1(v ComplianceLogListResponseData1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeComplianceLogListResponseData1 performs a merge with any union data inside the ComplianceLogListResponse_Data, using the provided ComplianceLogListResponseData1 +func (t *ComplianceLogListResponse_Data) MergeComplianceLogListResponseData1(v ComplianceLogListResponseData1) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +func (t ComplianceLogListResponse_Data) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *ComplianceLogListResponse_Data) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsComplianceStatusListResponseData0 returns the union data inside the ComplianceStatusListResponse_Data as a ComplianceStatusListResponseData0 +func (t ComplianceStatusListResponse_Data) AsComplianceStatusListResponseData0() (ComplianceStatusListResponseData0, error) { + var body ComplianceStatusListResponseData0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromComplianceStatusListResponseData0 overwrites any union data inside the ComplianceStatusListResponse_Data as the provided ComplianceStatusListResponseData0 +func (t *ComplianceStatusListResponse_Data) FromComplianceStatusListResponseData0(v ComplianceStatusListResponseData0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeComplianceStatusListResponseData0 performs a merge with any union data inside the ComplianceStatusListResponse_Data, using the provided ComplianceStatusListResponseData0 +func (t *ComplianceStatusListResponse_Data) MergeComplianceStatusListResponseData0(v ComplianceStatusListResponseData0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsComplianceStatusListResponseData1 returns the union data inside the ComplianceStatusListResponse_Data as a ComplianceStatusListResponseData1 +func (t ComplianceStatusListResponse_Data) AsComplianceStatusListResponseData1() (ComplianceStatusListResponseData1, error) { + var body ComplianceStatusListResponseData1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromComplianceStatusListResponseData1 overwrites any union data inside the ComplianceStatusListResponse_Data as the provided ComplianceStatusListResponseData1 +func (t *ComplianceStatusListResponse_Data) FromComplianceStatusListResponseData1(v ComplianceStatusListResponseData1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeComplianceStatusListResponseData1 performs a merge with any union data inside the ComplianceStatusListResponse_Data, using the provided ComplianceStatusListResponseData1 +func (t *ComplianceStatusListResponse_Data) MergeComplianceStatusListResponseData1(v ComplianceStatusListResponseData1) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +func (t ComplianceStatusListResponse_Data) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *ComplianceStatusListResponse_Data) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsDiskListResponseData0 returns the union data inside the DiskListResponse_Data as a DiskListResponseData0 +func (t DiskListResponse_Data) AsDiskListResponseData0() (DiskListResponseData0, error) { + var body DiskListResponseData0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromDiskListResponseData0 overwrites any union data inside the DiskListResponse_Data as the provided DiskListResponseData0 +func (t *DiskListResponse_Data) FromDiskListResponseData0(v DiskListResponseData0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeDiskListResponseData0 performs a merge with any union data inside the DiskListResponse_Data, using the provided DiskListResponseData0 +func (t *DiskListResponse_Data) MergeDiskListResponseData0(v DiskListResponseData0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsDiskListResponseData1 returns the union data inside the DiskListResponse_Data as a DiskListResponseData1 +func (t DiskListResponse_Data) AsDiskListResponseData1() (DiskListResponseData1, error) { + var body DiskListResponseData1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromDiskListResponseData1 overwrites any union data inside the DiskListResponse_Data as the provided DiskListResponseData1 +func (t *DiskListResponse_Data) FromDiskListResponseData1(v DiskListResponseData1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeDiskListResponseData1 performs a merge with any union data inside the DiskListResponse_Data, using the provided DiskListResponseData1 +func (t *DiskListResponse_Data) MergeDiskListResponseData1(v DiskListResponseData1) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +func (t DiskListResponse_Data) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *DiskListResponse_Data) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsFilterListResponseData0 returns the union data inside the FilterListResponse_Data as a FilterListResponseData0 +func (t FilterListResponse_Data) AsFilterListResponseData0() (FilterListResponseData0, error) { + var body FilterListResponseData0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromFilterListResponseData0 overwrites any union data inside the FilterListResponse_Data as the provided FilterListResponseData0 +func (t *FilterListResponse_Data) FromFilterListResponseData0(v FilterListResponseData0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeFilterListResponseData0 performs a merge with any union data inside the FilterListResponse_Data, using the provided FilterListResponseData0 +func (t *FilterListResponse_Data) MergeFilterListResponseData0(v FilterListResponseData0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsFilterListResponseData1 returns the union data inside the FilterListResponse_Data as a FilterListResponseData1 +func (t FilterListResponse_Data) AsFilterListResponseData1() (FilterListResponseData1, error) { + var body FilterListResponseData1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromFilterListResponseData1 overwrites any union data inside the FilterListResponse_Data as the provided FilterListResponseData1 +func (t *FilterListResponse_Data) FromFilterListResponseData1(v FilterListResponseData1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeFilterListResponseData1 performs a merge with any union data inside the FilterListResponse_Data, using the provided FilterListResponseData1 +func (t *FilterListResponse_Data) MergeFilterListResponseData1(v FilterListResponseData1) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +func (t FilterListResponse_Data) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *FilterListResponse_Data) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsFiltersetFilterListResponseData0 returns the union data inside the FiltersetFilterListResponse_Data as a FiltersetFilterListResponseData0 +func (t FiltersetFilterListResponse_Data) AsFiltersetFilterListResponseData0() (FiltersetFilterListResponseData0, error) { + var body FiltersetFilterListResponseData0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromFiltersetFilterListResponseData0 overwrites any union data inside the FiltersetFilterListResponse_Data as the provided FiltersetFilterListResponseData0 +func (t *FiltersetFilterListResponse_Data) FromFiltersetFilterListResponseData0(v FiltersetFilterListResponseData0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeFiltersetFilterListResponseData0 performs a merge with any union data inside the FiltersetFilterListResponse_Data, using the provided FiltersetFilterListResponseData0 +func (t *FiltersetFilterListResponse_Data) MergeFiltersetFilterListResponseData0(v FiltersetFilterListResponseData0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsFiltersetFilterListResponseData1 returns the union data inside the FiltersetFilterListResponse_Data as a FiltersetFilterListResponseData1 +func (t FiltersetFilterListResponse_Data) AsFiltersetFilterListResponseData1() (FiltersetFilterListResponseData1, error) { + var body FiltersetFilterListResponseData1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromFiltersetFilterListResponseData1 overwrites any union data inside the FiltersetFilterListResponse_Data as the provided FiltersetFilterListResponseData1 +func (t *FiltersetFilterListResponse_Data) FromFiltersetFilterListResponseData1(v FiltersetFilterListResponseData1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeFiltersetFilterListResponseData1 performs a merge with any union data inside the FiltersetFilterListResponse_Data, using the provided FiltersetFilterListResponseData1 +func (t *FiltersetFilterListResponse_Data) MergeFiltersetFilterListResponseData1(v FiltersetFilterListResponseData1) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +func (t FiltersetFilterListResponse_Data) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *FiltersetFilterListResponse_Data) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsFiltersetListResponseData0 returns the union data inside the FiltersetListResponse_Data as a FiltersetListResponseData0 +func (t FiltersetListResponse_Data) AsFiltersetListResponseData0() (FiltersetListResponseData0, error) { + var body FiltersetListResponseData0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromFiltersetListResponseData0 overwrites any union data inside the FiltersetListResponse_Data as the provided FiltersetListResponseData0 +func (t *FiltersetListResponse_Data) FromFiltersetListResponseData0(v FiltersetListResponseData0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeFiltersetListResponseData0 performs a merge with any union data inside the FiltersetListResponse_Data, using the provided FiltersetListResponseData0 +func (t *FiltersetListResponse_Data) MergeFiltersetListResponseData0(v FiltersetListResponseData0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsFiltersetListResponseData1 returns the union data inside the FiltersetListResponse_Data as a FiltersetListResponseData1 +func (t FiltersetListResponse_Data) AsFiltersetListResponseData1() (FiltersetListResponseData1, error) { + var body FiltersetListResponseData1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromFiltersetListResponseData1 overwrites any union data inside the FiltersetListResponse_Data as the provided FiltersetListResponseData1 +func (t *FiltersetListResponse_Data) FromFiltersetListResponseData1(v FiltersetListResponseData1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeFiltersetListResponseData1 performs a merge with any union data inside the FiltersetListResponse_Data, using the provided FiltersetListResponseData1 +func (t *FiltersetListResponse_Data) MergeFiltersetListResponseData1(v FiltersetListResponseData1) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +func (t FiltersetListResponse_Data) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *FiltersetListResponse_Data) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsFormListResponseData0 returns the union data inside the FormListResponse_Data as a FormListResponseData0 +func (t FormListResponse_Data) AsFormListResponseData0() (FormListResponseData0, error) { + var body FormListResponseData0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromFormListResponseData0 overwrites any union data inside the FormListResponse_Data as the provided FormListResponseData0 +func (t *FormListResponse_Data) FromFormListResponseData0(v FormListResponseData0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeFormListResponseData0 performs a merge with any union data inside the FormListResponse_Data, using the provided FormListResponseData0 +func (t *FormListResponse_Data) MergeFormListResponseData0(v FormListResponseData0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsFormListResponseData1 returns the union data inside the FormListResponse_Data as a FormListResponseData1 +func (t FormListResponse_Data) AsFormListResponseData1() (FormListResponseData1, error) { + var body FormListResponseData1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromFormListResponseData1 overwrites any union data inside the FormListResponse_Data as the provided FormListResponseData1 +func (t *FormListResponse_Data) FromFormListResponseData1(v FormListResponseData1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeFormListResponseData1 performs a merge with any union data inside the FormListResponse_Data, using the provided FormListResponseData1 +func (t *FormListResponse_Data) MergeFormListResponseData1(v FormListResponseData1) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +func (t FormListResponse_Data) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *FormListResponse_Data) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsGroupListResponseData0 returns the union data inside the GroupListResponse_Data as a GroupListResponseData0 +func (t GroupListResponse_Data) AsGroupListResponseData0() (GroupListResponseData0, error) { + var body GroupListResponseData0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromGroupListResponseData0 overwrites any union data inside the GroupListResponse_Data as the provided GroupListResponseData0 +func (t *GroupListResponse_Data) FromGroupListResponseData0(v GroupListResponseData0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeGroupListResponseData0 performs a merge with any union data inside the GroupListResponse_Data, using the provided GroupListResponseData0 +func (t *GroupListResponse_Data) MergeGroupListResponseData0(v GroupListResponseData0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsGroupListResponseData1 returns the union data inside the GroupListResponse_Data as a GroupListResponseData1 +func (t GroupListResponse_Data) AsGroupListResponseData1() (GroupListResponseData1, error) { + var body GroupListResponseData1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromGroupListResponseData1 overwrites any union data inside the GroupListResponse_Data as the provided GroupListResponseData1 +func (t *GroupListResponse_Data) FromGroupListResponseData1(v GroupListResponseData1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeGroupListResponseData1 performs a merge with any union data inside the GroupListResponse_Data, using the provided GroupListResponseData1 +func (t *GroupListResponse_Data) MergeGroupListResponseData1(v GroupListResponseData1) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +func (t GroupListResponse_Data) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *GroupListResponse_Data) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsHbaListResponseData0 returns the union data inside the HbaListResponse_Data as a HbaListResponseData0 +func (t HbaListResponse_Data) AsHbaListResponseData0() (HbaListResponseData0, error) { + var body HbaListResponseData0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromHbaListResponseData0 overwrites any union data inside the HbaListResponse_Data as the provided HbaListResponseData0 +func (t *HbaListResponse_Data) FromHbaListResponseData0(v HbaListResponseData0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeHbaListResponseData0 performs a merge with any union data inside the HbaListResponse_Data, using the provided HbaListResponseData0 +func (t *HbaListResponse_Data) MergeHbaListResponseData0(v HbaListResponseData0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsHbaListResponseData1 returns the union data inside the HbaListResponse_Data as a HbaListResponseData1 +func (t HbaListResponse_Data) AsHbaListResponseData1() (HbaListResponseData1, error) { + var body HbaListResponseData1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromHbaListResponseData1 overwrites any union data inside the HbaListResponse_Data as the provided HbaListResponseData1 +func (t *HbaListResponse_Data) FromHbaListResponseData1(v HbaListResponseData1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeHbaListResponseData1 performs a merge with any union data inside the HbaListResponse_Data, using the provided HbaListResponseData1 +func (t *HbaListResponse_Data) MergeHbaListResponseData1(v HbaListResponseData1) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +func (t HbaListResponse_Data) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *HbaListResponse_Data) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsInstanceListResponseData0 returns the union data inside the InstanceListResponse_Data as a InstanceListResponseData0 +func (t InstanceListResponse_Data) AsInstanceListResponseData0() (InstanceListResponseData0, error) { + var body InstanceListResponseData0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromInstanceListResponseData0 overwrites any union data inside the InstanceListResponse_Data as the provided InstanceListResponseData0 +func (t *InstanceListResponse_Data) FromInstanceListResponseData0(v InstanceListResponseData0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeInstanceListResponseData0 performs a merge with any union data inside the InstanceListResponse_Data, using the provided InstanceListResponseData0 +func (t *InstanceListResponse_Data) MergeInstanceListResponseData0(v InstanceListResponseData0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsInstanceListResponseData1 returns the union data inside the InstanceListResponse_Data as a InstanceListResponseData1 +func (t InstanceListResponse_Data) AsInstanceListResponseData1() (InstanceListResponseData1, error) { + var body InstanceListResponseData1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromInstanceListResponseData1 overwrites any union data inside the InstanceListResponse_Data as the provided InstanceListResponseData1 +func (t *InstanceListResponse_Data) FromInstanceListResponseData1(v InstanceListResponseData1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeInstanceListResponseData1 performs a merge with any union data inside the InstanceListResponse_Data, using the provided InstanceListResponseData1 +func (t *InstanceListResponse_Data) MergeInstanceListResponseData1(v InstanceListResponseData1) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +func (t InstanceListResponse_Data) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *InstanceListResponse_Data) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsIpListResponseData0 returns the union data inside the IpListResponse_Data as a IpListResponseData0 +func (t IpListResponse_Data) AsIpListResponseData0() (IpListResponseData0, error) { + var body IpListResponseData0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromIpListResponseData0 overwrites any union data inside the IpListResponse_Data as the provided IpListResponseData0 +func (t *IpListResponse_Data) FromIpListResponseData0(v IpListResponseData0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeIpListResponseData0 performs a merge with any union data inside the IpListResponse_Data, using the provided IpListResponseData0 +func (t *IpListResponse_Data) MergeIpListResponseData0(v IpListResponseData0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsIpListResponseData1 returns the union data inside the IpListResponse_Data as a IpListResponseData1 +func (t IpListResponse_Data) AsIpListResponseData1() (IpListResponseData1, error) { + var body IpListResponseData1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromIpListResponseData1 overwrites any union data inside the IpListResponse_Data as the provided IpListResponseData1 +func (t *IpListResponse_Data) FromIpListResponseData1(v IpListResponseData1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeIpListResponseData1 performs a merge with any union data inside the IpListResponse_Data, using the provided IpListResponseData1 +func (t *IpListResponse_Data) MergeIpListResponseData1(v IpListResponseData1) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +func (t IpListResponse_Data) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *IpListResponse_Data) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsListResponseData0 returns the union data inside the ListResponse_Data as a ListResponseData0 +func (t ListResponse_Data) AsListResponseData0() (ListResponseData0, error) { + var body ListResponseData0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromListResponseData0 overwrites any union data inside the ListResponse_Data as the provided ListResponseData0 +func (t *ListResponse_Data) FromListResponseData0(v ListResponseData0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeListResponseData0 performs a merge with any union data inside the ListResponse_Data, using the provided ListResponseData0 +func (t *ListResponse_Data) MergeListResponseData0(v ListResponseData0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsListResponseData1 returns the union data inside the ListResponse_Data as a ListResponseData1 +func (t ListResponse_Data) AsListResponseData1() (ListResponseData1, error) { + var body ListResponseData1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromListResponseData1 overwrites any union data inside the ListResponse_Data as the provided ListResponseData1 +func (t *ListResponse_Data) FromListResponseData1(v ListResponseData1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeListResponseData1 performs a merge with any union data inside the ListResponse_Data, using the provided ListResponseData1 +func (t *ListResponse_Data) MergeListResponseData1(v ListResponseData1) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +func (t ListResponse_Data) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *ListResponse_Data) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsLogListResponseData0 returns the union data inside the LogListResponse_Data as a LogListResponseData0 +func (t LogListResponse_Data) AsLogListResponseData0() (LogListResponseData0, error) { + var body LogListResponseData0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromLogListResponseData0 overwrites any union data inside the LogListResponse_Data as the provided LogListResponseData0 +func (t *LogListResponse_Data) FromLogListResponseData0(v LogListResponseData0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeLogListResponseData0 performs a merge with any union data inside the LogListResponse_Data, using the provided LogListResponseData0 +func (t *LogListResponse_Data) MergeLogListResponseData0(v LogListResponseData0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsLogListResponseData1 returns the union data inside the LogListResponse_Data as a LogListResponseData1 +func (t LogListResponse_Data) AsLogListResponseData1() (LogListResponseData1, error) { + var body LogListResponseData1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromLogListResponseData1 overwrites any union data inside the LogListResponse_Data as the provided LogListResponseData1 +func (t *LogListResponse_Data) FromLogListResponseData1(v LogListResponseData1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeLogListResponseData1 performs a merge with any union data inside the LogListResponse_Data, using the provided LogListResponseData1 +func (t *LogListResponse_Data) MergeLogListResponseData1(v LogListResponseData1) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +func (t LogListResponse_Data) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *LogListResponse_Data) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsModulesetListResponseData0 returns the union data inside the ModulesetListResponse_Data as a ModulesetListResponseData0 +func (t ModulesetListResponse_Data) AsModulesetListResponseData0() (ModulesetListResponseData0, error) { + var body ModulesetListResponseData0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromModulesetListResponseData0 overwrites any union data inside the ModulesetListResponse_Data as the provided ModulesetListResponseData0 +func (t *ModulesetListResponse_Data) FromModulesetListResponseData0(v ModulesetListResponseData0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeModulesetListResponseData0 performs a merge with any union data inside the ModulesetListResponse_Data, using the provided ModulesetListResponseData0 +func (t *ModulesetListResponse_Data) MergeModulesetListResponseData0(v ModulesetListResponseData0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsModulesetListResponseData1 returns the union data inside the ModulesetListResponse_Data as a ModulesetListResponseData1 +func (t ModulesetListResponse_Data) AsModulesetListResponseData1() (ModulesetListResponseData1, error) { + var body ModulesetListResponseData1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromModulesetListResponseData1 overwrites any union data inside the ModulesetListResponse_Data as the provided ModulesetListResponseData1 +func (t *ModulesetListResponse_Data) FromModulesetListResponseData1(v ModulesetListResponseData1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeModulesetListResponseData1 performs a merge with any union data inside the ModulesetListResponse_Data, using the provided ModulesetListResponseData1 +func (t *ModulesetListResponse_Data) MergeModulesetListResponseData1(v ModulesetListResponseData1) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +func (t ModulesetListResponse_Data) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *ModulesetListResponse_Data) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsModulesetModuleListResponseData0 returns the union data inside the ModulesetModuleListResponse_Data as a ModulesetModuleListResponseData0 +func (t ModulesetModuleListResponse_Data) AsModulesetModuleListResponseData0() (ModulesetModuleListResponseData0, error) { + var body ModulesetModuleListResponseData0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromModulesetModuleListResponseData0 overwrites any union data inside the ModulesetModuleListResponse_Data as the provided ModulesetModuleListResponseData0 +func (t *ModulesetModuleListResponse_Data) FromModulesetModuleListResponseData0(v ModulesetModuleListResponseData0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeModulesetModuleListResponseData0 performs a merge with any union data inside the ModulesetModuleListResponse_Data, using the provided ModulesetModuleListResponseData0 +func (t *ModulesetModuleListResponse_Data) MergeModulesetModuleListResponseData0(v ModulesetModuleListResponseData0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsModulesetModuleListResponseData1 returns the union data inside the ModulesetModuleListResponse_Data as a ModulesetModuleListResponseData1 +func (t ModulesetModuleListResponse_Data) AsModulesetModuleListResponseData1() (ModulesetModuleListResponseData1, error) { + var body ModulesetModuleListResponseData1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromModulesetModuleListResponseData1 overwrites any union data inside the ModulesetModuleListResponse_Data as the provided ModulesetModuleListResponseData1 +func (t *ModulesetModuleListResponse_Data) FromModulesetModuleListResponseData1(v ModulesetModuleListResponseData1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeModulesetModuleListResponseData1 performs a merge with any union data inside the ModulesetModuleListResponse_Data, using the provided ModulesetModuleListResponseData1 +func (t *ModulesetModuleListResponse_Data) MergeModulesetModuleListResponseData1(v ModulesetModuleListResponseData1) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +func (t ModulesetModuleListResponse_Data) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *ModulesetModuleListResponse_Data) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsModulesetsModuleListResponseData0 returns the union data inside the ModulesetsModuleListResponse_Data as a ModulesetsModuleListResponseData0 +func (t ModulesetsModuleListResponse_Data) AsModulesetsModuleListResponseData0() (ModulesetsModuleListResponseData0, error) { + var body ModulesetsModuleListResponseData0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromModulesetsModuleListResponseData0 overwrites any union data inside the ModulesetsModuleListResponse_Data as the provided ModulesetsModuleListResponseData0 +func (t *ModulesetsModuleListResponse_Data) FromModulesetsModuleListResponseData0(v ModulesetsModuleListResponseData0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeModulesetsModuleListResponseData0 performs a merge with any union data inside the ModulesetsModuleListResponse_Data, using the provided ModulesetsModuleListResponseData0 +func (t *ModulesetsModuleListResponse_Data) MergeModulesetsModuleListResponseData0(v ModulesetsModuleListResponseData0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsModulesetsModuleListResponseData1 returns the union data inside the ModulesetsModuleListResponse_Data as a ModulesetsModuleListResponseData1 +func (t ModulesetsModuleListResponse_Data) AsModulesetsModuleListResponseData1() (ModulesetsModuleListResponseData1, error) { + var body ModulesetsModuleListResponseData1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromModulesetsModuleListResponseData1 overwrites any union data inside the ModulesetsModuleListResponse_Data as the provided ModulesetsModuleListResponseData1 +func (t *ModulesetsModuleListResponse_Data) FromModulesetsModuleListResponseData1(v ModulesetsModuleListResponseData1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeModulesetsModuleListResponseData1 performs a merge with any union data inside the ModulesetsModuleListResponse_Data, using the provided ModulesetsModuleListResponseData1 +func (t *ModulesetsModuleListResponse_Data) MergeModulesetsModuleListResponseData1(v ModulesetsModuleListResponseData1) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +func (t ModulesetsModuleListResponse_Data) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *ModulesetsModuleListResponse_Data) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsNodeHardwareListResponseData0 returns the union data inside the NodeHardwareListResponse_Data as a NodeHardwareListResponseData0 +func (t NodeHardwareListResponse_Data) AsNodeHardwareListResponseData0() (NodeHardwareListResponseData0, error) { + var body NodeHardwareListResponseData0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromNodeHardwareListResponseData0 overwrites any union data inside the NodeHardwareListResponse_Data as the provided NodeHardwareListResponseData0 +func (t *NodeHardwareListResponse_Data) FromNodeHardwareListResponseData0(v NodeHardwareListResponseData0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeNodeHardwareListResponseData0 performs a merge with any union data inside the NodeHardwareListResponse_Data, using the provided NodeHardwareListResponseData0 +func (t *NodeHardwareListResponse_Data) MergeNodeHardwareListResponseData0(v NodeHardwareListResponseData0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsNodeHardwareListResponseData1 returns the union data inside the NodeHardwareListResponse_Data as a NodeHardwareListResponseData1 +func (t NodeHardwareListResponse_Data) AsNodeHardwareListResponseData1() (NodeHardwareListResponseData1, error) { + var body NodeHardwareListResponseData1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromNodeHardwareListResponseData1 overwrites any union data inside the NodeHardwareListResponse_Data as the provided NodeHardwareListResponseData1 +func (t *NodeHardwareListResponse_Data) FromNodeHardwareListResponseData1(v NodeHardwareListResponseData1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeNodeHardwareListResponseData1 performs a merge with any union data inside the NodeHardwareListResponse_Data, using the provided NodeHardwareListResponseData1 +func (t *NodeHardwareListResponse_Data) MergeNodeHardwareListResponseData1(v NodeHardwareListResponseData1) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +func (t NodeHardwareListResponse_Data) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *NodeHardwareListResponse_Data) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsNodeListResponseData0 returns the union data inside the NodeListResponse_Data as a NodeListResponseData0 +func (t NodeListResponse_Data) AsNodeListResponseData0() (NodeListResponseData0, error) { + var body NodeListResponseData0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromNodeListResponseData0 overwrites any union data inside the NodeListResponse_Data as the provided NodeListResponseData0 +func (t *NodeListResponse_Data) FromNodeListResponseData0(v NodeListResponseData0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeNodeListResponseData0 performs a merge with any union data inside the NodeListResponse_Data, using the provided NodeListResponseData0 +func (t *NodeListResponse_Data) MergeNodeListResponseData0(v NodeListResponseData0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsNodeListResponseData1 returns the union data inside the NodeListResponse_Data as a NodeListResponseData1 +func (t NodeListResponse_Data) AsNodeListResponseData1() (NodeListResponseData1, error) { + var body NodeListResponseData1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromNodeListResponseData1 overwrites any union data inside the NodeListResponse_Data as the provided NodeListResponseData1 +func (t *NodeListResponse_Data) FromNodeListResponseData1(v NodeListResponseData1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeNodeListResponseData1 performs a merge with any union data inside the NodeListResponse_Data, using the provided NodeListResponseData1 +func (t *NodeListResponse_Data) MergeNodeListResponseData1(v NodeListResponseData1) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +func (t NodeListResponse_Data) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *NodeListResponse_Data) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsObsolescenceSettingListResponseData0 returns the union data inside the ObsolescenceSettingListResponse_Data as a ObsolescenceSettingListResponseData0 +func (t ObsolescenceSettingListResponse_Data) AsObsolescenceSettingListResponseData0() (ObsolescenceSettingListResponseData0, error) { + var body ObsolescenceSettingListResponseData0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromObsolescenceSettingListResponseData0 overwrites any union data inside the ObsolescenceSettingListResponse_Data as the provided ObsolescenceSettingListResponseData0 +func (t *ObsolescenceSettingListResponse_Data) FromObsolescenceSettingListResponseData0(v ObsolescenceSettingListResponseData0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeObsolescenceSettingListResponseData0 performs a merge with any union data inside the ObsolescenceSettingListResponse_Data, using the provided ObsolescenceSettingListResponseData0 +func (t *ObsolescenceSettingListResponse_Data) MergeObsolescenceSettingListResponseData0(v ObsolescenceSettingListResponseData0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsObsolescenceSettingListResponseData1 returns the union data inside the ObsolescenceSettingListResponse_Data as a ObsolescenceSettingListResponseData1 +func (t ObsolescenceSettingListResponse_Data) AsObsolescenceSettingListResponseData1() (ObsolescenceSettingListResponseData1, error) { + var body ObsolescenceSettingListResponseData1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromObsolescenceSettingListResponseData1 overwrites any union data inside the ObsolescenceSettingListResponse_Data as the provided ObsolescenceSettingListResponseData1 +func (t *ObsolescenceSettingListResponse_Data) FromObsolescenceSettingListResponseData1(v ObsolescenceSettingListResponseData1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeObsolescenceSettingListResponseData1 performs a merge with any union data inside the ObsolescenceSettingListResponse_Data, using the provided ObsolescenceSettingListResponseData1 +func (t *ObsolescenceSettingListResponse_Data) MergeObsolescenceSettingListResponseData1(v ObsolescenceSettingListResponseData1) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +func (t ObsolescenceSettingListResponse_Data) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *ObsolescenceSettingListResponse_Data) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsPackageListResponseData0 returns the union data inside the PackageListResponse_Data as a PackageListResponseData0 +func (t PackageListResponse_Data) AsPackageListResponseData0() (PackageListResponseData0, error) { + var body PackageListResponseData0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromPackageListResponseData0 overwrites any union data inside the PackageListResponse_Data as the provided PackageListResponseData0 +func (t *PackageListResponse_Data) FromPackageListResponseData0(v PackageListResponseData0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergePackageListResponseData0 performs a merge with any union data inside the PackageListResponse_Data, using the provided PackageListResponseData0 +func (t *PackageListResponse_Data) MergePackageListResponseData0(v PackageListResponseData0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsPackageListResponseData1 returns the union data inside the PackageListResponse_Data as a PackageListResponseData1 +func (t PackageListResponse_Data) AsPackageListResponseData1() (PackageListResponseData1, error) { + var body PackageListResponseData1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromPackageListResponseData1 overwrites any union data inside the PackageListResponse_Data as the provided PackageListResponseData1 +func (t *PackageListResponse_Data) FromPackageListResponseData1(v PackageListResponseData1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergePackageListResponseData1 performs a merge with any union data inside the PackageListResponse_Data, using the provided PackageListResponseData1 +func (t *PackageListResponse_Data) MergePackageListResponseData1(v PackageListResponseData1) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +func (t PackageListResponse_Data) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *PackageListResponse_Data) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsRulesetListResponseData0 returns the union data inside the RulesetListResponse_Data as a RulesetListResponseData0 +func (t RulesetListResponse_Data) AsRulesetListResponseData0() (RulesetListResponseData0, error) { + var body RulesetListResponseData0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromRulesetListResponseData0 overwrites any union data inside the RulesetListResponse_Data as the provided RulesetListResponseData0 +func (t *RulesetListResponse_Data) FromRulesetListResponseData0(v RulesetListResponseData0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeRulesetListResponseData0 performs a merge with any union data inside the RulesetListResponse_Data, using the provided RulesetListResponseData0 +func (t *RulesetListResponse_Data) MergeRulesetListResponseData0(v RulesetListResponseData0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsRulesetListResponseData1 returns the union data inside the RulesetListResponse_Data as a RulesetListResponseData1 +func (t RulesetListResponse_Data) AsRulesetListResponseData1() (RulesetListResponseData1, error) { + var body RulesetListResponseData1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromRulesetListResponseData1 overwrites any union data inside the RulesetListResponse_Data as the provided RulesetListResponseData1 +func (t *RulesetListResponse_Data) FromRulesetListResponseData1(v RulesetListResponseData1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeRulesetListResponseData1 performs a merge with any union data inside the RulesetListResponse_Data, using the provided RulesetListResponseData1 +func (t *RulesetListResponse_Data) MergeRulesetListResponseData1(v RulesetListResponseData1) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +func (t RulesetListResponse_Data) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *RulesetListResponse_Data) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsRulesetVariableListResponseData0 returns the union data inside the RulesetVariableListResponse_Data as a RulesetVariableListResponseData0 +func (t RulesetVariableListResponse_Data) AsRulesetVariableListResponseData0() (RulesetVariableListResponseData0, error) { + var body RulesetVariableListResponseData0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromRulesetVariableListResponseData0 overwrites any union data inside the RulesetVariableListResponse_Data as the provided RulesetVariableListResponseData0 +func (t *RulesetVariableListResponse_Data) FromRulesetVariableListResponseData0(v RulesetVariableListResponseData0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeRulesetVariableListResponseData0 performs a merge with any union data inside the RulesetVariableListResponse_Data, using the provided RulesetVariableListResponseData0 +func (t *RulesetVariableListResponse_Data) MergeRulesetVariableListResponseData0(v RulesetVariableListResponseData0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsRulesetVariableListResponseData1 returns the union data inside the RulesetVariableListResponse_Data as a RulesetVariableListResponseData1 +func (t RulesetVariableListResponse_Data) AsRulesetVariableListResponseData1() (RulesetVariableListResponseData1, error) { + var body RulesetVariableListResponseData1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromRulesetVariableListResponseData1 overwrites any union data inside the RulesetVariableListResponse_Data as the provided RulesetVariableListResponseData1 +func (t *RulesetVariableListResponse_Data) FromRulesetVariableListResponseData1(v RulesetVariableListResponseData1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeRulesetVariableListResponseData1 performs a merge with any union data inside the RulesetVariableListResponse_Data, using the provided RulesetVariableListResponseData1 +func (t *RulesetVariableListResponse_Data) MergeRulesetVariableListResponseData1(v RulesetVariableListResponseData1) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +func (t RulesetVariableListResponse_Data) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *RulesetVariableListResponse_Data) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsRulesetsVariableListResponseData0 returns the union data inside the RulesetsVariableListResponse_Data as a RulesetsVariableListResponseData0 +func (t RulesetsVariableListResponse_Data) AsRulesetsVariableListResponseData0() (RulesetsVariableListResponseData0, error) { + var body RulesetsVariableListResponseData0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromRulesetsVariableListResponseData0 overwrites any union data inside the RulesetsVariableListResponse_Data as the provided RulesetsVariableListResponseData0 +func (t *RulesetsVariableListResponse_Data) FromRulesetsVariableListResponseData0(v RulesetsVariableListResponseData0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeRulesetsVariableListResponseData0 performs a merge with any union data inside the RulesetsVariableListResponse_Data, using the provided RulesetsVariableListResponseData0 +func (t *RulesetsVariableListResponse_Data) MergeRulesetsVariableListResponseData0(v RulesetsVariableListResponseData0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsRulesetsVariableListResponseData1 returns the union data inside the RulesetsVariableListResponse_Data as a RulesetsVariableListResponseData1 +func (t RulesetsVariableListResponse_Data) AsRulesetsVariableListResponseData1() (RulesetsVariableListResponseData1, error) { + var body RulesetsVariableListResponseData1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromRulesetsVariableListResponseData1 overwrites any union data inside the RulesetsVariableListResponse_Data as the provided RulesetsVariableListResponseData1 +func (t *RulesetsVariableListResponse_Data) FromRulesetsVariableListResponseData1(v RulesetsVariableListResponseData1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeRulesetsVariableListResponseData1 performs a merge with any union data inside the RulesetsVariableListResponse_Data, using the provided RulesetsVariableListResponseData1 +func (t *RulesetsVariableListResponse_Data) MergeRulesetsVariableListResponseData1(v RulesetsVariableListResponseData1) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +func (t RulesetsVariableListResponse_Data) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *RulesetsVariableListResponse_Data) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsServiceListResponseData0 returns the union data inside the ServiceListResponse_Data as a ServiceListResponseData0 +func (t ServiceListResponse_Data) AsServiceListResponseData0() (ServiceListResponseData0, error) { + var body ServiceListResponseData0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromServiceListResponseData0 overwrites any union data inside the ServiceListResponse_Data as the provided ServiceListResponseData0 +func (t *ServiceListResponse_Data) FromServiceListResponseData0(v ServiceListResponseData0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeServiceListResponseData0 performs a merge with any union data inside the ServiceListResponse_Data, using the provided ServiceListResponseData0 +func (t *ServiceListResponse_Data) MergeServiceListResponseData0(v ServiceListResponseData0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsServiceListResponseData1 returns the union data inside the ServiceListResponse_Data as a ServiceListResponseData1 +func (t ServiceListResponse_Data) AsServiceListResponseData1() (ServiceListResponseData1, error) { + var body ServiceListResponseData1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromServiceListResponseData1 overwrites any union data inside the ServiceListResponse_Data as the provided ServiceListResponseData1 +func (t *ServiceListResponse_Data) FromServiceListResponseData1(v ServiceListResponseData1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeServiceListResponseData1 performs a merge with any union data inside the ServiceListResponse_Data, using the provided ServiceListResponseData1 +func (t *ServiceListResponse_Data) MergeServiceListResponseData1(v ServiceListResponseData1) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +func (t ServiceListResponse_Data) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *ServiceListResponse_Data) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsUserListResponseData0 returns the union data inside the UserListResponse_Data as a UserListResponseData0 +func (t UserListResponse_Data) AsUserListResponseData0() (UserListResponseData0, error) { + var body UserListResponseData0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromUserListResponseData0 overwrites any union data inside the UserListResponse_Data as the provided UserListResponseData0 +func (t *UserListResponse_Data) FromUserListResponseData0(v UserListResponseData0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeUserListResponseData0 performs a merge with any union data inside the UserListResponse_Data, using the provided UserListResponseData0 +func (t *UserListResponse_Data) MergeUserListResponseData0(v UserListResponseData0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsUserListResponseData1 returns the union data inside the UserListResponse_Data as a UserListResponseData1 +func (t UserListResponse_Data) AsUserListResponseData1() (UserListResponseData1, error) { + var body UserListResponseData1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromUserListResponseData1 overwrites any union data inside the UserListResponse_Data as the provided UserListResponseData1 +func (t *UserListResponse_Data) FromUserListResponseData1(v UserListResponseData1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeUserListResponseData1 performs a merge with any union data inside the UserListResponse_Data, using the provided UserListResponseData1 +func (t *UserListResponse_Data) MergeUserListResponseData1(v UserListResponseData1) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +func (t UserListResponse_Data) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *UserListResponse_Data) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsWorkflowListResponseData0 returns the union data inside the WorkflowListResponse_Data as a WorkflowListResponseData0 +func (t WorkflowListResponse_Data) AsWorkflowListResponseData0() (WorkflowListResponseData0, error) { + var body WorkflowListResponseData0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromWorkflowListResponseData0 overwrites any union data inside the WorkflowListResponse_Data as the provided WorkflowListResponseData0 +func (t *WorkflowListResponse_Data) FromWorkflowListResponseData0(v WorkflowListResponseData0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeWorkflowListResponseData0 performs a merge with any union data inside the WorkflowListResponse_Data, using the provided WorkflowListResponseData0 +func (t *WorkflowListResponse_Data) MergeWorkflowListResponseData0(v WorkflowListResponseData0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsWorkflowListResponseData1 returns the union data inside the WorkflowListResponse_Data as a WorkflowListResponseData1 +func (t WorkflowListResponse_Data) AsWorkflowListResponseData1() (WorkflowListResponseData1, error) { + var body WorkflowListResponseData1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromWorkflowListResponseData1 overwrites any union data inside the WorkflowListResponse_Data as the provided WorkflowListResponseData1 +func (t *WorkflowListResponse_Data) FromWorkflowListResponseData1(v WorkflowListResponseData1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeWorkflowListResponseData1 performs a merge with any union data inside the WorkflowListResponse_Data, using the provided WorkflowListResponseData1 +func (t *WorkflowListResponse_Data) MergeWorkflowListResponseData1(v WorkflowListResponseData1) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +func (t WorkflowListResponse_Data) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *WorkflowListResponse_Data) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsActionEnqueue returns the union data inside the PutActionsJSONBody as a ActionEnqueue +func (t PutActionsJSONBody) AsActionEnqueue() (ActionEnqueue, error) { + var body ActionEnqueue + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromActionEnqueue overwrites any union data inside the PutActionsJSONBody as the provided ActionEnqueue +func (t *PutActionsJSONBody) FromActionEnqueue(v ActionEnqueue) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeActionEnqueue performs a merge with any union data inside the PutActionsJSONBody, using the provided ActionEnqueue +func (t *PutActionsJSONBody) MergeActionEnqueue(v ActionEnqueue) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsPutActionsJSONBody1 returns the union data inside the PutActionsJSONBody as a PutActionsJSONBody1 +func (t PutActionsJSONBody) AsPutActionsJSONBody1() (PutActionsJSONBody1, error) { + var body PutActionsJSONBody1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromPutActionsJSONBody1 overwrites any union data inside the PutActionsJSONBody as the provided PutActionsJSONBody1 +func (t *PutActionsJSONBody) FromPutActionsJSONBody1(v PutActionsJSONBody1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergePutActionsJSONBody1 performs a merge with any union data inside the PutActionsJSONBody, using the provided PutActionsJSONBody1 +func (t *PutActionsJSONBody) MergePutActionsJSONBody1(v PutActionsJSONBody1) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +func (t PutActionsJSONBody) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} + +func (t *PutActionsJSONBody) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} + +// AsDeleteFormsJSONBody0 returns the union data inside the DeleteFormsJSONBody as a DeleteFormsJSONBody0 +func (t DeleteFormsJSONBody) AsDeleteFormsJSONBody0() (DeleteFormsJSONBody0, error) { + var body DeleteFormsJSONBody0 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromDeleteFormsJSONBody0 overwrites any union data inside the DeleteFormsJSONBody as the provided DeleteFormsJSONBody0 +func (t *DeleteFormsJSONBody) FromDeleteFormsJSONBody0(v DeleteFormsJSONBody0) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeDeleteFormsJSONBody0 performs a merge with any union data inside the DeleteFormsJSONBody, using the provided DeleteFormsJSONBody0 +func (t *DeleteFormsJSONBody) MergeDeleteFormsJSONBody0(v DeleteFormsJSONBody0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } + + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} + +// AsDeleteFormsJSONBody1 returns the union data inside the DeleteFormsJSONBody as a DeleteFormsJSONBody1 +func (t DeleteFormsJSONBody) AsDeleteFormsJSONBody1() (DeleteFormsJSONBody1, error) { + var body DeleteFormsJSONBody1 + err := json.Unmarshal(t.union, &body) + return body, err +} + +// FromDeleteFormsJSONBody1 overwrites any union data inside the DeleteFormsJSONBody as the provided DeleteFormsJSONBody1 +func (t *DeleteFormsJSONBody) FromDeleteFormsJSONBody1(v DeleteFormsJSONBody1) error { + b, err := json.Marshal(v) + t.union = b + return err +} + +// MergeDeleteFormsJSONBody1 performs a merge with any union data inside the DeleteFormsJSONBody, using the provided DeleteFormsJSONBody1 +func (t *DeleteFormsJSONBody) MergeDeleteFormsJSONBody1(v DeleteFormsJSONBody1) error { + b, err := json.Marshal(v) + if err != nil { + return err + } -// DeleteDisksJSONRequestBody defines body for DeleteDisks for application/json ContentType. -type DeleteDisksJSONRequestBody DeleteDisksJSONBody + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} -// PostDisksJSONRequestBody defines body for PostDisks for application/json ContentType. -type PostDisksJSONRequestBody PostDisksJSONBody +func (t DeleteFormsJSONBody) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} -// DeleteFiltersJSONRequestBody defines body for DeleteFilters for application/json ContentType. -type DeleteFiltersJSONRequestBody DeleteFiltersJSONBody +func (t *DeleteFormsJSONBody) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} -// PostFiltersJSONRequestBody defines body for PostFilters for application/json ContentType. -type PostFiltersJSONRequestBody PostFiltersJSONBody +// AsPostFormsJSONBody0 returns the union data inside the PostFormsJSONBody as a PostFormsJSONBody0 +func (t PostFormsJSONBody) AsPostFormsJSONBody0() (PostFormsJSONBody0, error) { + var body PostFormsJSONBody0 + err := json.Unmarshal(t.union, &body) + return body, err +} -// PostFilterJSONRequestBody defines body for PostFilter for application/json ContentType. -type PostFilterJSONRequestBody PostFilterJSONBody +// FromPostFormsJSONBody0 overwrites any union data inside the PostFormsJSONBody as the provided PostFormsJSONBody0 +func (t *PostFormsJSONBody) FromPostFormsJSONBody0(v PostFormsJSONBody0) error { + b, err := json.Marshal(v) + t.union = b + return err +} -// DeleteFiltersetsJSONRequestBody defines body for DeleteFiltersets for application/json ContentType. -type DeleteFiltersetsJSONRequestBody DeleteFiltersetsJSONBody +// MergePostFormsJSONBody0 performs a merge with any union data inside the PostFormsJSONBody, using the provided PostFormsJSONBody0 +func (t *PostFormsJSONBody) MergePostFormsJSONBody0(v PostFormsJSONBody0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } -// PostFiltersetsJSONRequestBody defines body for PostFiltersets for application/json ContentType. -type PostFiltersetsJSONRequestBody PostFiltersetsJSONBody + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} -// PostFiltersetJSONRequestBody defines body for PostFilterset for application/json ContentType. -type PostFiltersetJSONRequestBody PostFiltersetJSONBody +// AsPostFormsJSONBody1 returns the union data inside the PostFormsJSONBody as a PostFormsJSONBody1 +func (t PostFormsJSONBody) AsPostFormsJSONBody1() (PostFormsJSONBody1, error) { + var body PostFormsJSONBody1 + err := json.Unmarshal(t.union, &body) + return body, err +} -// PostFiltersetFilterJSONRequestBody defines body for PostFiltersetFilter for application/json ContentType. -type PostFiltersetFilterJSONRequestBody PostFiltersetFilterJSONBody +// FromPostFormsJSONBody1 overwrites any union data inside the PostFormsJSONBody as the provided PostFormsJSONBody1 +func (t *PostFormsJSONBody) FromPostFormsJSONBody1(v PostFormsJSONBody1) error { + b, err := json.Marshal(v) + t.union = b + return err +} -// PostFiltersetFiltersetJSONRequestBody defines body for PostFiltersetFilterset for application/json ContentType. -type PostFiltersetFiltersetJSONRequestBody PostFiltersetFiltersetJSONBody +// MergePostFormsJSONBody1 performs a merge with any union data inside the PostFormsJSONBody, using the provided PostFormsJSONBody1 +func (t *PostFormsJSONBody) MergePostFormsJSONBody1(v PostFormsJSONBody1) error { + b, err := json.Marshal(v) + if err != nil { + return err + } -// DeleteFiltersetsFiltersJSONRequestBody defines body for DeleteFiltersetsFilters for application/json ContentType. -type DeleteFiltersetsFiltersJSONRequestBody DeleteFiltersetsFiltersJSONBody + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} -// PostFiltersetsFiltersJSONRequestBody defines body for PostFiltersetsFilters for application/json ContentType. -type PostFiltersetsFiltersJSONRequestBody PostFiltersetsFiltersJSONBody +func (t PostFormsJSONBody) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} -// DeleteFiltersetsFiltersetsJSONRequestBody defines body for DeleteFiltersetsFiltersets for application/json ContentType. -type DeleteFiltersetsFiltersetsJSONRequestBody DeleteFiltersetsFiltersetsJSONBody +func (t *PostFormsJSONBody) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} -// PostFiltersetsFiltersetsJSONRequestBody defines body for PostFiltersetsFiltersets for application/json ContentType. -type PostFiltersetsFiltersetsJSONRequestBody PostFiltersetsFiltersetsJSONBody +// AsDeleteFormsPublicationsJSONBody0 returns the union data inside the DeleteFormsPublicationsJSONBody as a DeleteFormsPublicationsJSONBody0 +func (t DeleteFormsPublicationsJSONBody) AsDeleteFormsPublicationsJSONBody0() (DeleteFormsPublicationsJSONBody0, error) { + var body DeleteFormsPublicationsJSONBody0 + err := json.Unmarshal(t.union, &body) + return body, err +} -// DeleteGroupsJSONRequestBody defines body for DeleteGroups for application/json ContentType. -type DeleteGroupsJSONRequestBody DeleteGroupsJSONBody +// FromDeleteFormsPublicationsJSONBody0 overwrites any union data inside the DeleteFormsPublicationsJSONBody as the provided DeleteFormsPublicationsJSONBody0 +func (t *DeleteFormsPublicationsJSONBody) FromDeleteFormsPublicationsJSONBody0(v DeleteFormsPublicationsJSONBody0) error { + b, err := json.Marshal(v) + t.union = b + return err +} -// PostGroupsJSONRequestBody defines body for PostGroups for application/json ContentType. -type PostGroupsJSONRequestBody PostGroupsJSONBody +// MergeDeleteFormsPublicationsJSONBody0 performs a merge with any union data inside the DeleteFormsPublicationsJSONBody, using the provided DeleteFormsPublicationsJSONBody0 +func (t *DeleteFormsPublicationsJSONBody) MergeDeleteFormsPublicationsJSONBody0(v DeleteFormsPublicationsJSONBody0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } -// PostGroupJSONRequestBody defines body for PostGroup for application/json ContentType. -type PostGroupJSONRequestBody PostGroupJSONBody + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} -// DeleteGroupHiddenMenuEntriesJSONRequestBody defines body for DeleteGroupHiddenMenuEntries for application/json ContentType. -type DeleteGroupHiddenMenuEntriesJSONRequestBody DeleteGroupHiddenMenuEntriesJSONBody +// AsDeleteFormsPublicationsJSONBody1 returns the union data inside the DeleteFormsPublicationsJSONBody as a DeleteFormsPublicationsJSONBody1 +func (t DeleteFormsPublicationsJSONBody) AsDeleteFormsPublicationsJSONBody1() (DeleteFormsPublicationsJSONBody1, error) { + var body DeleteFormsPublicationsJSONBody1 + err := json.Unmarshal(t.union, &body) + return body, err +} -// PostGroupHiddenMenuEntriesJSONRequestBody defines body for PostGroupHiddenMenuEntries for application/json ContentType. -type PostGroupHiddenMenuEntriesJSONRequestBody PostGroupHiddenMenuEntriesJSONBody +// FromDeleteFormsPublicationsJSONBody1 overwrites any union data inside the DeleteFormsPublicationsJSONBody as the provided DeleteFormsPublicationsJSONBody1 +func (t *DeleteFormsPublicationsJSONBody) FromDeleteFormsPublicationsJSONBody1(v DeleteFormsPublicationsJSONBody1) error { + b, err := json.Marshal(v) + t.union = b + return err +} -// DeleteIpsJSONRequestBody defines body for DeleteIps for application/json ContentType. -type DeleteIpsJSONRequestBody DeleteIpsJSONBody +// MergeDeleteFormsPublicationsJSONBody1 performs a merge with any union data inside the DeleteFormsPublicationsJSONBody, using the provided DeleteFormsPublicationsJSONBody1 +func (t *DeleteFormsPublicationsJSONBody) MergeDeleteFormsPublicationsJSONBody1(v DeleteFormsPublicationsJSONBody1) error { + b, err := json.Marshal(v) + if err != nil { + return err + } -// PostLogsJSONRequestBody defines body for PostLogs for application/json ContentType. -type PostLogsJSONRequestBody PostLogsJSONBody + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} -// DeleteNodesJSONRequestBody defines body for DeleteNodes for application/json ContentType. -type DeleteNodesJSONRequestBody DeleteNodesJSONBody +func (t DeleteFormsPublicationsJSONBody) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} -// PostNodesJSONRequestBody defines body for PostNodes for application/json ContentType. -type PostNodesJSONRequestBody PostNodesJSONBody +func (t *DeleteFormsPublicationsJSONBody) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} -// PostNodeJSONRequestBody defines body for PostNode for application/json ContentType. -type PostNodeJSONRequestBody PostNodeJSONBody +// AsPostFormsPublicationsJSONBody0 returns the union data inside the PostFormsPublicationsJSONBody as a PostFormsPublicationsJSONBody0 +func (t PostFormsPublicationsJSONBody) AsPostFormsPublicationsJSONBody0() (PostFormsPublicationsJSONBody0, error) { + var body PostFormsPublicationsJSONBody0 + err := json.Unmarshal(t.union, &body) + return body, err +} -// PostNodeComplianceModulesetJSONRequestBody defines body for PostNodeComplianceModuleset for application/json ContentType. -type PostNodeComplianceModulesetJSONRequestBody = PostNodeComplianceModulesetJSONBody +// FromPostFormsPublicationsJSONBody0 overwrites any union data inside the PostFormsPublicationsJSONBody as the provided PostFormsPublicationsJSONBody0 +func (t *PostFormsPublicationsJSONBody) FromPostFormsPublicationsJSONBody0(v PostFormsPublicationsJSONBody0) error { + b, err := json.Marshal(v) + t.union = b + return err +} -// PostNodeComplianceRulesetJSONRequestBody defines body for PostNodeComplianceRuleset for application/json ContentType. -type PostNodeComplianceRulesetJSONRequestBody = PostNodeComplianceRulesetJSONBody +// MergePostFormsPublicationsJSONBody0 performs a merge with any union data inside the PostFormsPublicationsJSONBody, using the provided PostFormsPublicationsJSONBody0 +func (t *PostFormsPublicationsJSONBody) MergePostFormsPublicationsJSONBody0(v PostFormsPublicationsJSONBody0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } -// PostNodeSnoozeJSONRequestBody defines body for PostNodeSnooze for application/json ContentType. -type PostNodeSnoozeJSONRequestBody PostNodeSnoozeJSONBody + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} -// DeleteObsolescenceSettingsJSONRequestBody defines body for DeleteObsolescenceSettings for application/json ContentType. -type DeleteObsolescenceSettingsJSONRequestBody DeleteObsolescenceSettingsJSONBody +// AsPostFormsPublicationsJSONBody1 returns the union data inside the PostFormsPublicationsJSONBody as a PostFormsPublicationsJSONBody1 +func (t PostFormsPublicationsJSONBody) AsPostFormsPublicationsJSONBody1() (PostFormsPublicationsJSONBody1, error) { + var body PostFormsPublicationsJSONBody1 + err := json.Unmarshal(t.union, &body) + return body, err +} -// PostObsolescenceSettingsJSONRequestBody defines body for PostObsolescenceSettings for application/json ContentType. -type PostObsolescenceSettingsJSONRequestBody PostObsolescenceSettingsJSONBody +// FromPostFormsPublicationsJSONBody1 overwrites any union data inside the PostFormsPublicationsJSONBody as the provided PostFormsPublicationsJSONBody1 +func (t *PostFormsPublicationsJSONBody) FromPostFormsPublicationsJSONBody1(v PostFormsPublicationsJSONBody1) error { + b, err := json.Marshal(v) + t.union = b + return err +} -// PostObsolescenceSettingJSONRequestBody defines body for PostObsolescenceSetting for application/json ContentType. -type PostObsolescenceSettingJSONRequestBody PostObsolescenceSettingJSONBody +// MergePostFormsPublicationsJSONBody1 performs a merge with any union data inside the PostFormsPublicationsJSONBody, using the provided PostFormsPublicationsJSONBody1 +func (t *PostFormsPublicationsJSONBody) MergePostFormsPublicationsJSONBody1(v PostFormsPublicationsJSONBody1) error { + b, err := json.Marshal(v) + if err != nil { + return err + } -// DeleteServicesJSONRequestBody defines body for DeleteServices for application/json ContentType. -type DeleteServicesJSONRequestBody DeleteServicesJSONBody + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} -// PostServicesJSONRequestBody defines body for PostServices for application/json ContentType. -type PostServicesJSONRequestBody PostServicesJSONBody +func (t PostFormsPublicationsJSONBody) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} -// PostServiceJSONRequestBody defines body for PostService for application/json ContentType. -type PostServiceJSONRequestBody PostServiceJSONBody +func (t *PostFormsPublicationsJSONBody) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} -// DeleteServicesInstancesJSONRequestBody defines body for DeleteServicesInstances for application/json ContentType. -type DeleteServicesInstancesJSONRequestBody DeleteServicesInstancesJSONBody +// AsDeleteFormsResponsiblesJSONBody0 returns the union data inside the DeleteFormsResponsiblesJSONBody as a DeleteFormsResponsiblesJSONBody0 +func (t DeleteFormsResponsiblesJSONBody) AsDeleteFormsResponsiblesJSONBody0() (DeleteFormsResponsiblesJSONBody0, error) { + var body DeleteFormsResponsiblesJSONBody0 + err := json.Unmarshal(t.union, &body) + return body, err +} -// DeleteTagsJSONRequestBody defines body for DeleteTags for application/json ContentType. -type DeleteTagsJSONRequestBody DeleteTagsJSONBody +// FromDeleteFormsResponsiblesJSONBody0 overwrites any union data inside the DeleteFormsResponsiblesJSONBody as the provided DeleteFormsResponsiblesJSONBody0 +func (t *DeleteFormsResponsiblesJSONBody) FromDeleteFormsResponsiblesJSONBody0(v DeleteFormsResponsiblesJSONBody0) error { + b, err := json.Marshal(v) + t.union = b + return err +} -// PostTagsJSONRequestBody defines body for PostTags for application/json ContentType. -type PostTagsJSONRequestBody PostTagsJSONBody +// MergeDeleteFormsResponsiblesJSONBody0 performs a merge with any union data inside the DeleteFormsResponsiblesJSONBody, using the provided DeleteFormsResponsiblesJSONBody0 +func (t *DeleteFormsResponsiblesJSONBody) MergeDeleteFormsResponsiblesJSONBody0(v DeleteFormsResponsiblesJSONBody0) error { + b, err := json.Marshal(v) + if err != nil { + return err + } -// DeleteTagsNodesJSONRequestBody defines body for DeleteTagsNodes for application/json ContentType. -type DeleteTagsNodesJSONRequestBody DeleteTagsNodesJSONBody + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} -// PostTagsNodesJSONRequestBody defines body for PostTagsNodes for application/json ContentType. -type PostTagsNodesJSONRequestBody PostTagsNodesJSONBody +// AsDeleteFormsResponsiblesJSONBody1 returns the union data inside the DeleteFormsResponsiblesJSONBody as a DeleteFormsResponsiblesJSONBody1 +func (t DeleteFormsResponsiblesJSONBody) AsDeleteFormsResponsiblesJSONBody1() (DeleteFormsResponsiblesJSONBody1, error) { + var body DeleteFormsResponsiblesJSONBody1 + err := json.Unmarshal(t.union, &body) + return body, err +} -// DeleteTagsServicesJSONRequestBody defines body for DeleteTagsServices for application/json ContentType. -type DeleteTagsServicesJSONRequestBody DeleteTagsServicesJSONBody +// FromDeleteFormsResponsiblesJSONBody1 overwrites any union data inside the DeleteFormsResponsiblesJSONBody as the provided DeleteFormsResponsiblesJSONBody1 +func (t *DeleteFormsResponsiblesJSONBody) FromDeleteFormsResponsiblesJSONBody1(v DeleteFormsResponsiblesJSONBody1) error { + b, err := json.Marshal(v) + t.union = b + return err +} -// PostTagsServicesJSONRequestBody defines body for PostTagsServices for application/json ContentType. -type PostTagsServicesJSONRequestBody PostTagsServicesJSONBody +// MergeDeleteFormsResponsiblesJSONBody1 performs a merge with any union data inside the DeleteFormsResponsiblesJSONBody, using the provided DeleteFormsResponsiblesJSONBody1 +func (t *DeleteFormsResponsiblesJSONBody) MergeDeleteFormsResponsiblesJSONBody1(v DeleteFormsResponsiblesJSONBody1) error { + b, err := json.Marshal(v) + if err != nil { + return err + } -// PostTagJSONRequestBody defines body for PostTag for application/json ContentType. -type PostTagJSONRequestBody PostTagJSONBody + merged, err := runtime.JSONMerge(t.union, b) + t.union = merged + return err +} -// PostTagNodeJSONRequestBody defines body for PostTagNode for application/json ContentType. -type PostTagNodeJSONRequestBody PostTagNodeJSONBody +func (t DeleteFormsResponsiblesJSONBody) MarshalJSON() ([]byte, error) { + b, err := t.union.MarshalJSON() + return b, err +} -// PostTagServiceJSONRequestBody defines body for PostTagService for application/json ContentType. -type PostTagServiceJSONRequestBody PostTagServiceJSONBody +func (t *DeleteFormsResponsiblesJSONBody) UnmarshalJSON(b []byte) error { + err := t.union.UnmarshalJSON(b) + return err +} -// AsListResponseData0 returns the union data inside the ListResponse_Data as a ListResponseData0 -func (t ListResponse_Data) AsListResponseData0() (ListResponseData0, error) { - var body ListResponseData0 +// AsPostFormsResponsiblesJSONBody0 returns the union data inside the PostFormsResponsiblesJSONBody as a PostFormsResponsiblesJSONBody0 +func (t PostFormsResponsiblesJSONBody) AsPostFormsResponsiblesJSONBody0() (PostFormsResponsiblesJSONBody0, error) { + var body PostFormsResponsiblesJSONBody0 err := json.Unmarshal(t.union, &body) return body, err } -// FromListResponseData0 overwrites any union data inside the ListResponse_Data as the provided ListResponseData0 -func (t *ListResponse_Data) FromListResponseData0(v ListResponseData0) error { +// FromPostFormsResponsiblesJSONBody0 overwrites any union data inside the PostFormsResponsiblesJSONBody as the provided PostFormsResponsiblesJSONBody0 +func (t *PostFormsResponsiblesJSONBody) FromPostFormsResponsiblesJSONBody0(v PostFormsResponsiblesJSONBody0) error { b, err := json.Marshal(v) t.union = b return err } -// MergeListResponseData0 performs a merge with any union data inside the ListResponse_Data, using the provided ListResponseData0 -func (t *ListResponse_Data) MergeListResponseData0(v ListResponseData0) error { +// MergePostFormsResponsiblesJSONBody0 performs a merge with any union data inside the PostFormsResponsiblesJSONBody, using the provided PostFormsResponsiblesJSONBody0 +func (t *PostFormsResponsiblesJSONBody) MergePostFormsResponsiblesJSONBody0(v PostFormsResponsiblesJSONBody0) error { b, err := json.Marshal(v) if err != nil { return err @@ -3151,22 +9495,22 @@ func (t *ListResponse_Data) MergeListResponseData0(v ListResponseData0) error { return err } -// AsListResponseData1 returns the union data inside the ListResponse_Data as a ListResponseData1 -func (t ListResponse_Data) AsListResponseData1() (ListResponseData1, error) { - var body ListResponseData1 +// AsPostFormsResponsiblesJSONBody1 returns the union data inside the PostFormsResponsiblesJSONBody as a PostFormsResponsiblesJSONBody1 +func (t PostFormsResponsiblesJSONBody) AsPostFormsResponsiblesJSONBody1() (PostFormsResponsiblesJSONBody1, error) { + var body PostFormsResponsiblesJSONBody1 err := json.Unmarshal(t.union, &body) return body, err } -// FromListResponseData1 overwrites any union data inside the ListResponse_Data as the provided ListResponseData1 -func (t *ListResponse_Data) FromListResponseData1(v ListResponseData1) error { +// FromPostFormsResponsiblesJSONBody1 overwrites any union data inside the PostFormsResponsiblesJSONBody as the provided PostFormsResponsiblesJSONBody1 +func (t *PostFormsResponsiblesJSONBody) FromPostFormsResponsiblesJSONBody1(v PostFormsResponsiblesJSONBody1) error { b, err := json.Marshal(v) t.union = b return err } -// MergeListResponseData1 performs a merge with any union data inside the ListResponse_Data, using the provided ListResponseData1 -func (t *ListResponse_Data) MergeListResponseData1(v ListResponseData1) error { +// MergePostFormsResponsiblesJSONBody1 performs a merge with any union data inside the PostFormsResponsiblesJSONBody, using the provided PostFormsResponsiblesJSONBody1 +func (t *PostFormsResponsiblesJSONBody) MergePostFormsResponsiblesJSONBody1(v PostFormsResponsiblesJSONBody1) error { b, err := json.Marshal(v) if err != nil { return err @@ -3177,12 +9521,12 @@ func (t *ListResponse_Data) MergeListResponseData1(v ListResponseData1) error { return err } -func (t ListResponse_Data) MarshalJSON() ([]byte, error) { +func (t PostFormsResponsiblesJSONBody) MarshalJSON() ([]byte, error) { b, err := t.union.MarshalJSON() return b, err } -func (t *ListResponse_Data) UnmarshalJSON(b []byte) error { +func (t *PostFormsResponsiblesJSONBody) UnmarshalJSON(b []byte) error { err := t.union.UnmarshalJSON(b) return err } diff --git a/server/handlers/compliance_attachments.go b/server/handlers/compliance_attachments.go new file mode 100644 index 00000000..c1bf6678 --- /dev/null +++ b/server/handlers/compliance_attachments.go @@ -0,0 +1,263 @@ +package serverhandlers + +import ( + "context" + "fmt" + "net/http" + "strconv" + + "github.com/labstack/echo/v4" + + "github.com/opensvc/oc3/cdb" + "github.com/opensvc/oc3/server" +) + +// compObjectNodes answers with the nodes a compliance object is attached to, or +// its candidate nodes. +func (a *Api) compObjectNodes(c echo.Context, name string, k cdb.CompKind, objID int64, candidates bool, params listEndpointParams) error { + return a.handleList(c, name, "node", params, func(ctx context.Context, p cdb.ListParams) ([]map[string]any, error) { + return a.ODB.GetCompObjectNodes(ctx, k, objID, candidates, p) + }) +} + +// compObjectServices answers with the services a compliance object is attached +// to, or its candidate services. +func (a *Api) compObjectServices(c echo.Context, name string, k cdb.CompKind, objID int64, slave *bool, candidates bool, params listEndpointParams) error { + isSlave := slave != nil && *slave + return a.handleList(c, name, "service", params, func(ctx context.Context, p cdb.ListParams) ([]map[string]any, error) { + return a.ODB.GetCompObjectServices(ctx, k, objID, isSlave, candidates, p) + }) +} + +// publishedRuleset resolves a ruleset the caller may read: published to one of +// their groups or to Everybody. +func (a *Api) publishedRuleset(c echo.Context, rsetID string) (int64, error) { + ctx := c.Request().Context() + id, err := a.resolveRuleset(ctx, rsetID) + if err == nil { + err = a.requireRulesetPublished(ctx, c, id) + } + return id, err +} + +// GetComplianceRulesetNodes handles GET /compliance/rulesets/{rset_id}/nodes. +func (a *Api) GetComplianceRulesetNodes(c echo.Context, rsetId string, params server.GetComplianceRulesetNodesParams) error { + id, err := a.publishedRuleset(c, rsetId) + if err != nil { + return httpProblem(c, err) + } + return a.compObjectNodes(c, "GetComplianceRulesetNodes", cdb.CompRulesetKind, id, false, + listParams(params.Props, params.Limit, params.Offset, params.Meta, params.Stats, params.Orderby, params.Groupby, params.Filter)) +} + +// GetComplianceRulesetCandidateNodes handles GET /compliance/rulesets/{rset_id}/candidate_nodes. +func (a *Api) GetComplianceRulesetCandidateNodes(c echo.Context, rsetId string, params server.GetComplianceRulesetCandidateNodesParams) error { + id, err := a.publishedRuleset(c, rsetId) + if err != nil { + return httpProblem(c, err) + } + return a.compObjectNodes(c, "GetComplianceRulesetCandidateNodes", cdb.CompRulesetKind, id, true, + listParams(params.Props, params.Limit, params.Offset, params.Meta, params.Stats, params.Orderby, params.Groupby, params.Filter)) +} + +// GetComplianceRulesetServices handles GET /compliance/rulesets/{rset_id}/services. +func (a *Api) GetComplianceRulesetServices(c echo.Context, rsetId string, params server.GetComplianceRulesetServicesParams) error { + id, err := a.publishedRuleset(c, rsetId) + if err != nil { + return httpProblem(c, err) + } + return a.compObjectServices(c, "GetComplianceRulesetServices", cdb.CompRulesetKind, id, params.Slave, false, + listParams(params.Props, params.Limit, params.Offset, params.Meta, params.Stats, params.Orderby, params.Groupby, params.Filter)) +} + +// GetComplianceRulesetCandidateServices handles GET /compliance/rulesets/{rset_id}/candidate_services. +func (a *Api) GetComplianceRulesetCandidateServices(c echo.Context, rsetId string, params server.GetComplianceRulesetCandidateServicesParams) error { + id, err := a.publishedRuleset(c, rsetId) + if err != nil { + return httpProblem(c, err) + } + return a.compObjectServices(c, "GetComplianceRulesetCandidateServices", cdb.CompRulesetKind, id, params.Slave, true, + listParams(params.Props, params.Limit, params.Offset, params.Meta, params.Stats, params.Orderby, params.Groupby, params.Filter)) +} + +// compAttachBody reads the bulk attachment forms: the object by id or name, the +// node or service, and for a service whether it is the encapsulated one (slave, +// or encap as the historical ruleset examples post it). +type compAttachBody struct { + obj, target string + slave bool +} + +func readCompAttachBody(c echo.Context, idKey, nameKey, targetKey string) (compAttachBody, error) { + entry, err := oneEntry(c) + if err != nil { + return compAttachBody{}, err + } + var b compAttachBody + target, ok := entry[targetKey] + if !ok { + return b, httpErrorf(http.StatusBadRequest, "'%s' must be specified", targetKey) + } + b.target = fmt.Sprint(target) + if v, ok := entry[idKey]; ok { + b.obj = fmt.Sprint(v) + } else if v, ok := entry[nameKey]; ok { + b.obj = fmt.Sprint(v) + } else { + return b, httpErrorf(http.StatusBadRequest, "Either '%s' or '%s' must be specified", idKey, nameKey) + } + for _, key := range []string{"slave", "encap"} { + if v, ok := entry[key]; ok { + flag, err := compBool(key, v) + if err != nil { + return b, err + } + b.slave = flag == "T" + } + } + return b, nil +} + +// rulesetsNodes attaches or detaches a ruleset named in the body to a node, as +// POST and DELETE /nodes/{node_id}/compliance/rulesets/{rset_id} do. +func (a *Api) rulesetsNodes(c echo.Context, attach bool) error { + b, err := readCompAttachBody(c, "ruleset_id", "ruleset_name", "node_id") + if err != nil { + return httpProblem(c, err) + } + id, err := a.resolveRuleset(c.Request().Context(), b.obj) + if err != nil { + return httpProblem(c, err) + } + if attach { + return a.PostNodeComplianceRuleset(c, b.target, strconv.FormatInt(id, 10)) + } + return a.DeleteNodeComplianceRuleset(c, b.target, strconv.FormatInt(id, 10)) +} + +// PostComplianceRulesetsNodes handles POST /compliance/rulesets_nodes. +func (a *Api) PostComplianceRulesetsNodes(c echo.Context) error { return a.rulesetsNodes(c, true) } + +// DeleteComplianceRulesetsNodes handles DELETE /compliance/rulesets_nodes. +func (a *Api) DeleteComplianceRulesetsNodes(c echo.Context) error { return a.rulesetsNodes(c, false) } + +// rulesetsServices attaches or detaches a ruleset named in the body to a +// service, as POST and DELETE /services/{svc_id}/compliance/rulesets/{rset_id} do. +func (a *Api) rulesetsServices(c echo.Context, attach bool) error { + b, err := readCompAttachBody(c, "ruleset_id", "ruleset_name", "svc_id") + if err != nil { + return httpProblem(c, err) + } + id, err := a.resolveRuleset(c.Request().Context(), b.obj) + if err != nil { + return httpProblem(c, err) + } + slave := b.slave + if attach { + return a.PostServiceComplianceRuleset(c, b.target, strconv.FormatInt(id, 10), server.PostServiceComplianceRulesetParams{Slave: &slave}) + } + return a.DeleteServiceComplianceRuleset(c, b.target, strconv.FormatInt(id, 10), server.DeleteServiceComplianceRulesetParams{Slave: &slave}) +} + +// PostComplianceRulesetsServices handles POST /compliance/rulesets_services. +func (a *Api) PostComplianceRulesetsServices(c echo.Context) error { + return a.rulesetsServices(c, true) +} + +// DeleteComplianceRulesetsServices handles DELETE /compliance/rulesets_services. +func (a *Api) DeleteComplianceRulesetsServices(c echo.Context) error { + return a.rulesetsServices(c, false) +} + +// GetComplianceModulesetNodes handles GET /compliance/modulesets/{modset_id}/nodes. +func (a *Api) GetComplianceModulesetNodes(c echo.Context, modsetId string, params server.GetComplianceModulesetNodesParams) error { + id, err := a.publishedModuleset(c, modsetId) + if err != nil { + return httpProblem(c, err) + } + return a.compObjectNodes(c, "GetComplianceModulesetNodes", cdb.CompModulesetKind, id, false, + listParams(params.Props, params.Limit, params.Offset, params.Meta, params.Stats, params.Orderby, params.Groupby, params.Filter)) +} + +// GetComplianceModulesetCandidateNodes handles GET /compliance/modulesets/{modset_id}/candidate_nodes. +func (a *Api) GetComplianceModulesetCandidateNodes(c echo.Context, modsetId string, params server.GetComplianceModulesetCandidateNodesParams) error { + id, err := a.publishedModuleset(c, modsetId) + if err != nil { + return httpProblem(c, err) + } + return a.compObjectNodes(c, "GetComplianceModulesetCandidateNodes", cdb.CompModulesetKind, id, true, + listParams(params.Props, params.Limit, params.Offset, params.Meta, params.Stats, params.Orderby, params.Groupby, params.Filter)) +} + +// GetComplianceModulesetServices handles GET /compliance/modulesets/{modset_id}/services. +func (a *Api) GetComplianceModulesetServices(c echo.Context, modsetId string, params server.GetComplianceModulesetServicesParams) error { + id, err := a.publishedModuleset(c, modsetId) + if err != nil { + return httpProblem(c, err) + } + return a.compObjectServices(c, "GetComplianceModulesetServices", cdb.CompModulesetKind, id, params.Slave, false, + listParams(params.Props, params.Limit, params.Offset, params.Meta, params.Stats, params.Orderby, params.Groupby, params.Filter)) +} + +// GetComplianceModulesetCandidateServices handles GET /compliance/modulesets/{modset_id}/candidate_services. +func (a *Api) GetComplianceModulesetCandidateServices(c echo.Context, modsetId string, params server.GetComplianceModulesetCandidateServicesParams) error { + id, err := a.publishedModuleset(c, modsetId) + if err != nil { + return httpProblem(c, err) + } + return a.compObjectServices(c, "GetComplianceModulesetCandidateServices", cdb.CompModulesetKind, id, params.Slave, true, + listParams(params.Props, params.Limit, params.Offset, params.Meta, params.Stats, params.Orderby, params.Groupby, params.Filter)) +} + +// modulesetsNodes attaches or detaches a moduleset named in the body to a node, +// as POST and DELETE /nodes/{node_id}/compliance/modulesets/{mset_id} do. +func (a *Api) modulesetsNodes(c echo.Context, attach bool) error { + b, err := readCompAttachBody(c, "modset_id", "modset_name", "node_id") + if err != nil { + return httpProblem(c, err) + } + id, err := a.resolveModuleset(c.Request().Context(), b.obj) + if err != nil { + return httpProblem(c, err) + } + if attach { + return a.PostNodeComplianceModuleset(c, b.target, strconv.FormatInt(id, 10)) + } + return a.DeleteNodeComplianceModuleset(c, b.target, strconv.FormatInt(id, 10)) +} + +// PostComplianceModulesetsNodes handles POST /compliance/modulesets_nodes. +func (a *Api) PostComplianceModulesetsNodes(c echo.Context) error { return a.modulesetsNodes(c, true) } + +// DeleteComplianceModulesetsNodes handles DELETE /compliance/modulesets_nodes. +func (a *Api) DeleteComplianceModulesetsNodes(c echo.Context) error { + return a.modulesetsNodes(c, false) +} + +// modulesetsServices attaches or detaches a moduleset named in the body to a +// service, as POST and DELETE /services/{svc_id}/compliance/modulesets/{mset_id} do. +func (a *Api) modulesetsServices(c echo.Context, attach bool) error { + b, err := readCompAttachBody(c, "modset_id", "modset_name", "svc_id") + if err != nil { + return httpProblem(c, err) + } + id, err := a.resolveModuleset(c.Request().Context(), b.obj) + if err != nil { + return httpProblem(c, err) + } + slave := b.slave + if attach { + return a.PostServiceComplianceModuleset(c, b.target, strconv.FormatInt(id, 10), server.PostServiceComplianceModulesetParams{Slave: &slave}) + } + return a.DeleteServiceComplianceModuleset(c, b.target, strconv.FormatInt(id, 10), server.DeleteServiceComplianceModulesetParams{Slave: &slave}) +} + +// PostComplianceModulesetsServices handles POST /compliance/modulesets_services. +func (a *Api) PostComplianceModulesetsServices(c echo.Context) error { + return a.modulesetsServices(c, true) +} + +// DeleteComplianceModulesetsServices handles DELETE /compliance/modulesets_services. +func (a *Api) DeleteComplianceModulesetsServices(c echo.Context) error { + return a.modulesetsServices(c, false) +} diff --git a/server/handlers/compliance_common.go b/server/handlers/compliance_common.go new file mode 100644 index 00000000..cccc54e9 --- /dev/null +++ b/server/handlers/compliance_common.go @@ -0,0 +1,129 @@ +package serverhandlers + +import ( + "context" + "encoding/json" + "errors" + "fmt" + "net/http" + "strings" + + "github.com/labstack/echo/v4" + + "github.com/opensvc/oc3/cdb" + "github.com/opensvc/oc3/util/echolog" +) + +// checkCompManager refuses a caller without the CompManager privilege, as +// check_privilege("CompManager") and @auth.requires_membership('CompManager') +// do. Unlike requireCompManager, it returns the refusal as an httpError rather +// than writing it. +func checkCompManager(c echo.Context) error { + if !IsAuthByUser(c) { + return httpErrorf(http.StatusUnauthorized, "user authentication required") + } + if !IsCompManager(c) { + return httpErrorf(http.StatusForbidden, "CompManager privilege required") + } + return nil +} + +// compDesignerError turns the errors of the compliance designer queries into +// HTTP statuses: 404 for a missing object, 409 for a name already taken, 400 +// for unusable data, 403 for a refused change, 500 otherwise. +func compDesignerError(c echo.Context, name string, err error) error { + switch { + case errors.Is(err, cdb.ErrCompNotFound): + return httpErrorf(http.StatusNotFound, "%s", err.Error()) + case errors.Is(err, cdb.ErrCompConflict): + return httpErrorf(http.StatusConflict, "%s", strings.TrimPrefix(err.Error(), cdb.ErrCompConflict.Error()+": ")) + case errors.Is(err, cdb.ErrCompInvalid): + return httpErrorf(http.StatusBadRequest, "%s", strings.TrimPrefix(err.Error(), cdb.ErrCompInvalid.Error()+": ")) + case errors.Is(err, cdb.ErrCompForbidden): + return httpErrorf(http.StatusForbidden, "%s", strings.TrimPrefix(err.Error(), cdb.ErrCompForbidden.Error()+": ")) + } + return httpInternal(echolog.GetLogHandler(c, name), "cannot "+name, err) +} + +// resolveRuleset returns the id of a ruleset given by id or by name: 404 when +// there is none. +func (a *Api) resolveRuleset(ctx context.Context, idOrName string) (int64, error) { + id, found, err := a.ODB.CompRulesetID(ctx, idOrName) + if err != nil { + return 0, err + } + if !found { + return 0, httpErrorf(http.StatusNotFound, "ruleset %s not found", idOrName) + } + return id, nil +} + +// compBool reads a boolean property the way the historical collector accepted +// it, a JSON boolean or "T", "F", "true", "false", "yes", "no", "1", "0", and +// stores it as its "T" or "F" varchar(1). +func compBool(key string, v any) (string, error) { + switch t := v.(type) { + case bool: + if t { + return "T", nil + } + return "F", nil + case string: + switch strings.ToLower(strings.TrimSpace(t)) { + case "t", "true", "yes", "y", "1": + return "T", nil + case "f", "false", "no", "n", "0": + return "F", nil + } + case float64: + if t == 1 { + return "T", nil + } else if t == 0 { + return "F", nil + } + } + return "", httpErrorf(http.StatusBadRequest, "invalid %s value %v: a boolean is expected", key, v) +} + +// compString reads a string property, trimmed; an empty one is refused when +// required. +func compString(key string, v any, required bool) (string, error) { + s, ok := v.(string) + if !ok { + if v == nil && !required { + return "", nil + } + return "", httpErrorf(http.StatusBadRequest, "invalid %s value %v: a string is expected", key, v) + } + s = strings.TrimSpace(s) + if s == "" && required { + return "", httpErrorf(http.StatusBadRequest, "the '%s' key is mandatory", key) + } + return s, nil +} + +// compOneOf checks a value against the accepted ones. +func compOneOf(key, v string, accepted ...string) error { + for _, a := range accepted { + if v == a { + return nil + } + } + return httpErrorf(http.StatusBadRequest, "invalid %s value %q: expected one of %s", key, v, strings.Join(accepted, ", ")) +} + +// compInfo answers with an informational message, as the historical handlers' +// dict(info=...). +func compInfo(c echo.Context, format string, args ...any) error { + return c.JSON(http.StatusOK, map[string]string{"info": fmt.Sprintf(format, args...)}) +} + +// compJSON renders the properties of a change for the log, as the historical +// collector logs str(vars). +func compJSON(v any) string { + b, err := json.Marshal(v) + if err != nil { + return fmt.Sprint(v) + } + return string(b) +} diff --git a/server/handlers/compliance_import.go b/server/handlers/compliance_import.go new file mode 100644 index 00000000..95a71496 --- /dev/null +++ b/server/handlers/compliance_import.go @@ -0,0 +1,124 @@ +package serverhandlers + +import ( + "context" + "database/sql" + "encoding/json" + "net/http" + + "github.com/labstack/echo/v4" + + "github.com/opensvc/oc3/cdb" + "github.com/opensvc/oc3/util/echolog" +) + +// GetComplianceRulesetsExport handles GET /compliance/rulesets/export, as the +// historical rest_get_compliance_rulesets_export: the rulesets published to the +// caller, their descendants and their filtersets, in the format of +// POST /compliance/import. +func (a *Api) GetComplianceRulesetsExport(c echo.Context) error { + ctx := c.Request().Context() + ids, err := a.ODB.CompPublishedIDs(ctx, cdb.CompRulesetKind, UserGroupsFromContext(c), IsManager(c)) + if err != nil { + return httpProblem(c, compDesignerError(c, "GetComplianceRulesetsExport", err)) + } + return a.rulesetsExport(c, "GetComplianceRulesetsExport", ids) +} + +// GetComplianceRulesetExport handles GET /compliance/rulesets/{rset_id}/export: +// a ruleset published to the caller, with its descendants and its filterset. +func (a *Api) GetComplianceRulesetExport(c echo.Context, rsetId string) error { + id, err := a.publishedRuleset(c, rsetId) + if err != nil { + return httpProblem(c, err) + } + return a.rulesetsExport(c, "GetComplianceRulesetExport", []int64{id}) +} + +func (a *Api) rulesetsExport(c echo.Context, name string, ids []int64) error { + data, err := a.ODB.ExportCompRulesets(c.Request().Context(), ids) + if err != nil { + return httpProblem(c, compDesignerError(c, name, err)) + } + return c.JSON(http.StatusOK, data) +} + +// GetComplianceModulesetsExport handles GET /compliance/modulesets/export, as +// the historical rest_get_compliance_modulesets_export: the modulesets published +// to the caller, their descendants, and the rulesets and filtersets they use. +func (a *Api) GetComplianceModulesetsExport(c echo.Context) error { + ctx := c.Request().Context() + ids, err := a.ODB.CompPublishedIDs(ctx, cdb.CompModulesetKind, UserGroupsFromContext(c), IsManager(c)) + if err != nil { + return httpProblem(c, compDesignerError(c, "GetComplianceModulesetsExport", err)) + } + return a.modulesetsExport(c, "GetComplianceModulesetsExport", ids) +} + +// GetComplianceModulesetExport handles GET /compliance/modulesets/{modset_id}/export: +// a moduleset published to the caller, with its descendants and their rulesets. +func (a *Api) GetComplianceModulesetExport(c echo.Context, modsetId string) error { + id, err := a.publishedModuleset(c, modsetId) + if err != nil { + return httpProblem(c, err) + } + return a.modulesetsExport(c, "GetComplianceModulesetExport", []int64{id}) +} + +func (a *Api) modulesetsExport(c echo.Context, name string, ids []int64) error { + data, err := a.ODB.ExportCompModulesets(c.Request().Context(), ids) + if err != nil { + return httpProblem(c, compDesignerError(c, name, err)) + } + return c.JSON(http.StatusOK, data) +} + +// PostComplianceImport handles POST /compliance/import, as the historical +// rest_post_compliance_import: the filters, filtersets, rulesets and modulesets +// of an export are created, or reused when they exist by name, and their +// relations added. Unlike the historical import, it requires the CompManager +// privilege, adds to an existing ruleset or moduleset only when the caller is +// responsible for it, and applies all or nothing. +func (a *Api) PostComplianceImport(c echo.Context) error { + const name = "PostComplianceImport" + if err := checkCompManager(c); err != nil { + return httpProblem(c, err) + } + var data cdb.CompImportData + if err := json.NewDecoder(c.Request().Body).Decode(&data); err != nil { + return httpProblem(c, httpErrorf(http.StatusBadRequest, "invalid request body: %s", err)) + } + ctx := c.Request().Context() + caller, err := a.formCaller(ctx, c) + if err != nil { + return httpProblem(c, compDesignerError(c, name, err)) + } + groupID, err := a.ODB.DefaultGroupOrManager(ctx, authUserID(c)) + if err != nil { + return httpProblem(c, compDesignerError(c, name, err)) + } + log := echolog.GetLogHandler(c, name) + tx, markSuccess, endTx, err := a.ODB.BeginTxWithControl(ctx, log, &sql.TxOptions{}) + if err != nil { + return httpProblem(c, httpInternal(log, "cannot start transaction", err)) + } + groups, isManager := UserGroupsFromContext(c), IsManager(c) + messages, err := tx.ImportCompliance(ctx, data, cdb.CompImporter{ + Author: caller.name, + GroupID: groupID, + Responsible: func(ctx context.Context, k cdb.CompKind, id int64) (bool, error) { + return tx.CompObjectResponsible(ctx, k, id, groups, isManager) + }, + }) + if err == nil { + markSuccess() + } + endTx() + if err != nil { + return httpProblem(c, compDesignerError(c, name, err)) + } + a.compLog(c, "compliance.import", "imported compliance designer data (%(n)s items)", + map[string]any{"n": len(messages)}, "", "") + a.afterRulesetChange(c, true) + return c.JSON(http.StatusOK, map[string][]string{"info": messages}) +} diff --git a/server/handlers/compliance_modules.go b/server/handlers/compliance_modules.go new file mode 100644 index 00000000..c6bbccea --- /dev/null +++ b/server/handlers/compliance_modules.go @@ -0,0 +1,219 @@ +package serverhandlers + +import ( + "context" + "net/http" + "strconv" + + "github.com/labstack/echo/v4" + + "github.com/opensvc/oc3/cdb" + "github.com/opensvc/oc3/server" +) + +// resolveModulesetModule returns the ids of a moduleset and of one of its +// modules, each given by id or by name. +func (a *Api) resolveModulesetModule(ctx context.Context, modsetID, modID string) (int64, int64, error) { + mid, err := a.resolveModuleset(ctx, modsetID) + if err != nil { + return 0, 0, err + } + id, found, err := a.ODB.CompModulesetModuleID(ctx, mid, modID) + if err != nil { + return 0, 0, err + } + if !found { + return 0, 0, httpErrorf(http.StatusNotFound, "module %s not found", modID) + } + return mid, id, nil +} + +// moduleFields checks the settable properties of a module. +func moduleFields(entry map[string]any) (map[string]any, error) { + fields := map[string]any{} + for k, v := range entry { + switch k { + case "modset_mod_name": + name, err := compString(k, v, true) + if err != nil { + return nil, err + } + fields[k] = name + case "autofix": + flag, err := compBool(k, v) + if err != nil { + return nil, err + } + fields[k] = flag + case "id", "modset_id", "modset_mod_author", "modset_mod_updated": + default: + return nil, httpErrorf(http.StatusBadRequest, "unknown module property %s", k) + } + } + return fields, nil +} + +// GetComplianceModulesetModules handles GET /compliance/modulesets/{modset_id}/modules: +// the modules of a moduleset published to the caller. +func (a *Api) GetComplianceModulesetModules(c echo.Context, modsetId string, params server.GetComplianceModulesetModulesParams) error { + mid, err := a.publishedModuleset(c, modsetId) + if err != nil { + return httpProblem(c, err) + } + return a.handleList(c, "GetComplianceModulesetModules", "moduleset_module", + listParams(params.Props, params.Limit, params.Offset, params.Meta, params.Stats, params.Orderby, params.Groupby, params.Filter), + func(ctx context.Context, p cdb.ListParams) ([]map[string]any, error) { + return a.ODB.GetComplianceModulesetModules(ctx, mid, nil, p) + }) +} + +// GetComplianceModulesetsModules handles GET /compliance/modulesets_modules. +func (a *Api) GetComplianceModulesetsModules(c echo.Context, params server.GetComplianceModulesetsModulesParams) error { + return a.handleList(c, "GetComplianceModulesetsModules", "modulesets_module", + listParams(params.Props, params.Limit, params.Offset, params.Meta, params.Stats, params.Orderby, params.Groupby, params.Filter), + func(ctx context.Context, p cdb.ListParams) ([]map[string]any, error) { + return a.ODB.GetComplianceModulesetsModules(ctx, p) + }) +} + +// GetComplianceModulesetModule handles GET /compliance/modulesets/{modset_id}/modules/{mod_id}. +func (a *Api) GetComplianceModulesetModule(c echo.Context, modsetId, modId string, params server.GetComplianceModulesetModuleParams) error { + ctx := c.Request().Context() + mid, id, err := a.resolveModulesetModule(ctx, modsetId, modId) + if err == nil { + err = a.requireModulesetPublished(ctx, c, mid) + } + if err != nil { + return httpProblem(c, err) + } + return a.moduleResponse(c, mid, id, params.Props) +} + +func (a *Api) moduleResponse(c echo.Context, mid, id int64, props *server.InQueryProps) error { + return a.handleItem(c, "GetComplianceModulesetModule", "moduleset_module", "id", strconv.FormatInt(id, 10), listEndpointParams{ + props: props, + }, func(ctx context.Context, p cdb.ListParams) ([]map[string]any, error) { + return a.ODB.GetComplianceModulesetModules(ctx, mid, &id, p) + }) +} + +// PostComplianceModulesetModules handles POST /compliance/modulesets/{modset_id}/modules, +// as the historical rest_post_compliance_moduleset_modules: a module named +// modset_mod_name is created, by a CompManager responsible for the moduleset. +func (a *Api) PostComplianceModulesetModules(c echo.Context, modsetId string) error { + entry, err := oneEntry(c) + if err != nil { + return httpProblem(c, err) + } + ctx := c.Request().Context() + mid, err := a.resolveModuleset(ctx, modsetId) + if err == nil { + err = checkCompManager(c) + } + if err == nil { + err = a.requireModulesetResponsible(ctx, c, mid) + } + if err != nil { + return httpProblem(c, err) + } + fields, err := moduleFields(entry) + if err != nil { + return httpProblem(c, err) + } + name, ok := fields["modset_mod_name"].(string) + if !ok { + return httpProblem(c, httpErrorf(http.StatusBadRequest, "modset_mod_name is mandatory in the posted data")) + } + if _, found, err := a.ODB.CompModulesetModuleID(ctx, mid, name); err != nil { + return httpProblem(c, compDesignerError(c, "PostComplianceModulesetModules", err)) + } else if found { + return httpProblem(c, httpErrorf(http.StatusConflict, "this module name already exists")) + } + caller, err := a.formCaller(ctx, c) + if err != nil { + return httpProblem(c, compDesignerError(c, "PostComplianceModulesetModules", err)) + } + id, err := a.ODB.CreateCompModulesetModule(ctx, mid, fields, caller.name) + if err != nil { + return httpProblem(c, compDesignerError(c, "PostComplianceModulesetModules", err)) + } + fields["modset_id"] = mid + a.compLog(c, "compliance.moduleset.module.create", "properties %(data)s", map[string]any{"data": compJSON(fields)}, "", "") + a.afterRulesetChange(c, false) + return a.moduleResponse(c, mid, id, nil) +} + +// PostComplianceModulesetModule handles POST +// /compliance/modulesets/{modset_id}/modules/{mod_id}: a change of the module +// name or autofix flag, by a CompManager responsible for the moduleset. +func (a *Api) PostComplianceModulesetModule(c echo.Context, modsetId, modId string) error { + entry, err := oneEntry(c) + if err != nil { + return httpProblem(c, err) + } + ctx := c.Request().Context() + mid, id, err := a.resolveModulesetModule(ctx, modsetId, modId) + if err == nil { + err = checkCompManager(c) + } + if err == nil { + err = a.requireModulesetResponsible(ctx, c, mid) + } + if err != nil { + return httpProblem(c, err) + } + fields, err := moduleFields(entry) + if err != nil { + return httpProblem(c, err) + } + if name, ok := fields["modset_mod_name"].(string); ok { + if other, found, err := a.ODB.CompModulesetModuleID(ctx, mid, name); err != nil { + return httpProblem(c, compDesignerError(c, "PostComplianceModulesetModule", err)) + } else if found && other != id { + return httpProblem(c, httpErrorf(http.StatusConflict, "this module name already exists")) + } + } + caller, err := a.formCaller(ctx, c) + if err != nil { + return httpProblem(c, compDesignerError(c, "PostComplianceModulesetModule", err)) + } + if err := a.ODB.UpdateCompModulesetModule(ctx, id, fields, caller.name); err != nil { + return httpProblem(c, compDesignerError(c, "PostComplianceModulesetModule", err)) + } + fields["id"] = id + a.compLog(c, "compliance.moduleset.module.change", "changed properties %(data)s", map[string]any{"data": compJSON(fields)}, "", "") + a.afterRulesetChange(c, false) + return a.moduleResponse(c, mid, id, nil) +} + +// DeleteComplianceModulesetModule handles DELETE +// /compliance/modulesets/{modset_id}/modules/{mod_id}, by a CompManager +// responsible for the moduleset, as the historical handler describes it. +func (a *Api) DeleteComplianceModulesetModule(c echo.Context, modsetId, modId string) error { + ctx := c.Request().Context() + mid, id, err := a.resolveModulesetModule(ctx, modsetId, modId) + if err == nil { + err = checkCompManager(c) + } + if err == nil { + err = a.requireModulesetResponsible(ctx, c, mid) + } + if err != nil { + return httpProblem(c, err) + } + name, err := a.ODB.CompModulesetModuleName(ctx, id) + if err != nil { + return httpProblem(c, compDesignerError(c, "DeleteComplianceModulesetModule", err)) + } + modset, err := a.ODB.CompObjectName(ctx, cdb.CompModulesetKind, mid) + if err != nil { + return httpProblem(c, compDesignerError(c, "DeleteComplianceModulesetModule", err)) + } + if err := a.ODB.DeleteCompModulesetModule(ctx, id); err != nil { + return httpProblem(c, compDesignerError(c, "DeleteComplianceModulesetModule", err)) + } + a.compLog(c, "compliance.moduleset.module.delete", "deleted module %(mod_name)s from moduleset %(modset_name)s", + map[string]any{"mod_name": name, "modset_name": modset}, "", "") + a.afterRulesetChange(c, false) + return compInfo(c, "module deleted") +} diff --git a/server/handlers/compliance_moduleset_links.go b/server/handlers/compliance_moduleset_links.go new file mode 100644 index 00000000..636e5275 --- /dev/null +++ b/server/handlers/compliance_moduleset_links.go @@ -0,0 +1,163 @@ +package serverhandlers + +import ( + "net/http" + + "github.com/labstack/echo/v4" + + "github.com/opensvc/oc3/cdb" +) + +// modulesetParent resolves the moduleset a composition change applies to, with +// its name, and checks the caller is a CompManager responsible for it. +func (a *Api) modulesetParent(c echo.Context, modsetID string) (int64, string, error) { + ctx := c.Request().Context() + id, err := a.resolveModuleset(ctx, modsetID) + if err == nil { + err = checkCompManager(c) + } + if err == nil { + err = a.requireModulesetResponsible(ctx, c, id) + } + if err != nil { + return 0, "", err + } + name, err := a.ODB.CompObjectName(ctx, cdb.CompModulesetKind, id) + if err != nil { + return 0, "", compDesignerError(c, "read the moduleset name", err) + } + return id, name, nil +} + +// PostComplianceModulesetModuleset handles POST +// /compliance/modulesets/{modset_id}/modulesets/{child_modset_id}, as the +// historical attach_moduleset_to_moduleset(): by a CompManager responsible for +// the parent, a moduleset published to them becomes a child of another, unless +// that would close a loop. +func (a *Api) PostComplianceModulesetModuleset(c echo.Context, modsetId, childModsetId string) error { + ctx := c.Request().Context() + parent, parentName, err := a.modulesetParent(c, modsetId) + if err != nil { + return httpProblem(c, err) + } + child, err := a.publishedModuleset(c, childModsetId) + if err != nil { + return httpProblem(c, err) + } + if parent == child { + return httpProblem(c, httpErrorf(http.StatusBadRequest, "abort action to avoid introducing a recursion loop")) + } + if attached, err := a.ODB.CompModulesetChildAttached(ctx, parent, child); err != nil { + return httpProblem(c, compDesignerError(c, "PostComplianceModulesetModuleset", err)) + } else if attached { + return compInfo(c, "already attached") + } + if loop, err := a.ODB.CompModulesetLoop(ctx, child, parent); err != nil { + return httpProblem(c, compDesignerError(c, "PostComplianceModulesetModuleset", err)) + } else if loop { + return httpProblem(c, httpErrorf(http.StatusConflict, "the parent moduleset is already a child of the encapsulated moduleset. abort encapsulation not to cause infinite recursion")) + } + childName, err := a.ODB.CompObjectName(ctx, cdb.CompModulesetKind, child) + if err != nil { + return httpProblem(c, compDesignerError(c, "PostComplianceModulesetModuleset", err)) + } + if err := a.ODB.AttachCompModulesetChild(ctx, parent, child); err != nil { + return httpProblem(c, compDesignerError(c, "PostComplianceModulesetModuleset", err)) + } + a.compLog(c, "compliance.moduleset.moduleset.attach", "attached moduleset %(child_modset_name)s to moduleset %(parent_modset_name)s", + map[string]any{"child_modset_name": childName, "parent_modset_name": parentName}, "", "") + a.afterRulesetChange(c, false) + return compInfo(c, "moduleset attached") +} + +// DeleteComplianceModulesetModuleset handles DELETE +// /compliance/modulesets/{modset_id}/modulesets/{child_modset_id}, as the +// historical detach_moduleset_from_moduleset(), by a CompManager responsible for +// the parent. +func (a *Api) DeleteComplianceModulesetModuleset(c echo.Context, modsetId, childModsetId string) error { + ctx := c.Request().Context() + parent, parentName, err := a.modulesetParent(c, modsetId) + if err != nil { + return httpProblem(c, err) + } + child, err := a.resolveModuleset(ctx, childModsetId) + if err != nil { + return httpProblem(c, err) + } + childName, err := a.ODB.CompObjectName(ctx, cdb.CompModulesetKind, child) + if err != nil { + return httpProblem(c, compDesignerError(c, "DeleteComplianceModulesetModuleset", err)) + } + if err := a.ODB.DetachCompModulesetChild(ctx, parent, child); err != nil { + return httpProblem(c, compDesignerError(c, "DeleteComplianceModulesetModuleset", err)) + } + a.compLog(c, "compliance.moduleset.detach", "detach moduleset %(child_modset_name)s from moduleset %(parent_modset_name)s", + map[string]any{"child_modset_name": childName, "parent_modset_name": parentName}, "", "") + a.afterRulesetChange(c, false) + return compInfo(c, "moduleset detached") +} + +// PostComplianceModulesetRuleset handles POST +// /compliance/modulesets/{modset_id}/rulesets/{rset_id}, as the historical +// attach_ruleset_to_moduleset(): by a CompManager responsible for the moduleset, +// a ruleset published to them adds its variables to the modules' environment. +func (a *Api) PostComplianceModulesetRuleset(c echo.Context, modsetId, rsetId string) error { + ctx := c.Request().Context() + modset, modsetName, err := a.modulesetParent(c, modsetId) + if err != nil { + return httpProblem(c, err) + } + rset, err := a.resolveRuleset(ctx, rsetId) + if err == nil { + err = a.requireRulesetPublished(ctx, c, rset) + } + if err != nil { + return httpProblem(c, err) + } + if attached, err := a.ODB.CompModulesetRulesetAttached(ctx, modset, rset); err != nil { + return httpProblem(c, compDesignerError(c, "PostComplianceModulesetRuleset", err)) + } else if attached { + return compInfo(c, "already attached") + } + names, err := a.rulesetNames(c, rset) + if err != nil { + return httpProblem(c, err) + } + if err := a.ODB.AttachCompModulesetRuleset(ctx, modset, rset); err != nil { + return httpProblem(c, compDesignerError(c, "PostComplianceModulesetRuleset", err)) + } + a.compLog(c, "compliance.moduleset.ruleset.attach", "attach ruleset %(rset_name)s to moduleset %(modset_name)s", + map[string]any{"rset_name": names[0], "modset_name": modsetName}, "", "") + a.afterRulesetChange(c, false) + return compInfo(c, "ruleset attached") +} + +// DeleteComplianceModulesetRuleset handles DELETE +// /compliance/modulesets/{modset_id}/rulesets/{rset_id}, as the historical +// detach_ruleset_from_moduleset(): by a CompManager responsible for the +// moduleset, the ruleset being published to them. +func (a *Api) DeleteComplianceModulesetRuleset(c echo.Context, modsetId, rsetId string) error { + ctx := c.Request().Context() + modset, modsetName, err := a.modulesetParent(c, modsetId) + if err != nil { + return httpProblem(c, err) + } + rset, err := a.resolveRuleset(ctx, rsetId) + if err == nil { + err = a.requireRulesetPublished(ctx, c, rset) + } + if err != nil { + return httpProblem(c, err) + } + names, err := a.rulesetNames(c, rset) + if err != nil { + return httpProblem(c, err) + } + if err := a.ODB.DetachCompModulesetRuleset(ctx, modset, rset); err != nil { + return httpProblem(c, compDesignerError(c, "DeleteComplianceModulesetRuleset", err)) + } + a.compLog(c, "compliance.ruleset.detach", "detach ruleset %(rset_name)s from moduleset %(modset_name)s", + map[string]any{"rset_name": names[0], "modset_name": modsetName}, "", "") + a.afterRulesetChange(c, false) + return compInfo(c, "ruleset detached") +} diff --git a/server/handlers/compliance_modulesets.go b/server/handlers/compliance_modulesets.go new file mode 100644 index 00000000..94a0d889 --- /dev/null +++ b/server/handlers/compliance_modulesets.go @@ -0,0 +1,294 @@ +package serverhandlers + +import ( + "context" + "fmt" + "net/http" + "strconv" + + "github.com/labstack/echo/v4" + + "github.com/opensvc/oc3/cdb" + "github.com/opensvc/oc3/server" +) + +// resolveModuleset returns the id of a moduleset given by id or by name: 404 when +// there is none. +func (a *Api) resolveModuleset(ctx context.Context, idOrName string) (int64, error) { + id, found, err := a.ODB.CompModulesetID(ctx, idOrName) + if err != nil { + return 0, err + } + if !found { + return 0, httpErrorf(http.StatusNotFound, "moduleset %s not found", idOrName) + } + return id, nil +} + +// requireModulesetResponsible refuses a caller none of whose groups is +// responsible for the moduleset. +func (a *Api) requireModulesetResponsible(ctx context.Context, c echo.Context, id int64) error { + ok, err := a.ODB.CompObjectResponsible(ctx, cdb.CompModulesetKind, id, UserGroupsFromContext(c), IsManager(c)) + if err != nil { + return compDesignerError(c, "check the moduleset responsibility", err) + } + if !ok { + return httpErrorf(http.StatusForbidden, "you are not responsible for this moduleset") + } + return nil +} + +// requireModulesetPublished refuses a caller the moduleset is not published to. +func (a *Api) requireModulesetPublished(ctx context.Context, c echo.Context, id int64) error { + ok, err := a.ODB.CompObjectPublished(ctx, cdb.CompModulesetKind, id, UserGroupsFromContext(c), IsManager(c)) + if err != nil { + return compDesignerError(c, "check the moduleset publication", err) + } + if !ok { + return httpErrorf(http.StatusForbidden, "you are not member of one of the moduleset publication groups") + } + return nil +} + +// publishedModuleset resolves a moduleset the caller may read. +func (a *Api) publishedModuleset(c echo.Context, modsetID string) (int64, error) { + ctx := c.Request().Context() + id, err := a.resolveModuleset(ctx, modsetID) + if err == nil { + err = a.requireModulesetPublished(ctx, c, id) + } + return id, err +} + +// GetComplianceModulesets handles GET /compliance/modulesets, as the historical +// rest_get_compliance_modulesets: the modulesets published to the caller's groups. +func (a *Api) GetComplianceModulesets(c echo.Context, params server.GetComplianceModulesetsParams) error { + return a.handleList(c, "GetComplianceModulesets", "moduleset", + listParams(params.Props, params.Limit, params.Offset, params.Meta, params.Stats, params.Orderby, params.Groupby, params.Filter), + func(ctx context.Context, p cdb.ListParams) ([]map[string]any, error) { + return a.ODB.GetComplianceModulesets(ctx, nil, p) + }) +} + +// GetComplianceModuleset handles GET /compliance/modulesets/{modset_id}. +func (a *Api) GetComplianceModuleset(c echo.Context, modsetId string, params server.GetComplianceModulesetParams) error { + id, err := a.resolveModuleset(c.Request().Context(), modsetId) + if err != nil { + return httpProblem(c, err) + } + return a.modulesetResponse(c, id, params.Props) +} + +func (a *Api) modulesetResponse(c echo.Context, id int64, props *server.InQueryProps) error { + return a.handleItem(c, "GetComplianceModuleset", "moduleset", "id", strconv.FormatInt(id, 10), listEndpointParams{ + props: props, + }, func(ctx context.Context, p cdb.ListParams) ([]map[string]any, error) { + return a.ODB.GetComplianceModulesets(ctx, &id, p) + }) +} + +// PostComplianceModulesets handles POST /compliance/modulesets, as the historical +// create_moduleset(): a moduleset named modset_name, authored by the caller, +// published to and under the responsibility of their default group. +func (a *Api) PostComplianceModulesets(c echo.Context) error { + entry, err := oneEntry(c) + if err != nil { + return httpProblem(c, err) + } + name, err := compString("modset_name", entry["modset_name"], true) + if err != nil { + return httpProblem(c, err) + } + ctx := c.Request().Context() + if err := checkCompManager(c); err != nil { + return httpProblem(c, err) + } + if _, found, err := a.ODB.CompModulesetID(ctx, name); err != nil { + return httpProblem(c, compDesignerError(c, "PostComplianceModulesets", err)) + } else if found { + return httpProblem(c, httpErrorf(http.StatusConflict, "a moduleset named '%s' already exists", name)) + } + caller, err := a.formCaller(ctx, c) + if err != nil { + return httpProblem(c, compDesignerError(c, "PostComplianceModulesets", err)) + } + groupID, err := a.ODB.DefaultGroupOrManager(ctx, authUserID(c)) + if err != nil { + return httpProblem(c, compDesignerError(c, "PostComplianceModulesets", err)) + } + id, err := a.ODB.CreateCompModuleset(ctx, name, caller.name, groupID) + if err != nil { + return httpProblem(c, compDesignerError(c, "PostComplianceModulesets", err)) + } + a.afterRulesetChange(c, false) + a.compLog(c, "compliance.moduleset.add", "added moduleset %(modset_name)s", map[string]any{"modset_name": name}, "", "") + return a.modulesetResponse(c, id, nil) +} + +// PostComplianceModuleset handles POST /compliance/modulesets/{modset_id}, as the +// historical rest_post_compliance_moduleset: a renaming, by a CompManager +// responsible for the moduleset, recording the update date. +func (a *Api) PostComplianceModuleset(c echo.Context, modsetId string) error { + entry, err := oneEntry(c) + if err != nil { + return httpProblem(c, err) + } + ctx := c.Request().Context() + id, err := a.resolveModuleset(ctx, modsetId) + if err == nil { + err = checkCompManager(c) + } + if err == nil { + err = a.requireModulesetResponsible(ctx, c, id) + } + if err != nil { + return httpProblem(c, err) + } + var name string + for k, v := range entry { + switch k { + case "modset_name": + if name, err = compString(k, v, true); err != nil { + return httpProblem(c, err) + } + case "id", "modset_author", "modset_updated": + default: + return httpProblem(c, httpErrorf(http.StatusBadRequest, "unknown moduleset property %s", k)) + } + } + if name == "" { + return compInfo(c, "No fields to update") + } + if other, found, err := a.ODB.CompModulesetID(ctx, name); err != nil { + return httpProblem(c, compDesignerError(c, "PostComplianceModuleset", err)) + } else if found && other != id { + return httpProblem(c, httpErrorf(http.StatusConflict, "a moduleset named '%s' already exists", name)) + } + if err := a.ODB.RenameCompModuleset(ctx, id, name); err != nil { + return httpProblem(c, compDesignerError(c, "PostComplianceModuleset", err)) + } + a.afterRulesetChange(c, false) + a.compLog(c, "compliance.moduleset.change", "update properties %(data)s", map[string]any{"data": compJSON(map[string]any{"modset_name": name})}, "", "") + return a.modulesetResponse(c, id, nil) +} + +// PutComplianceModuleset handles PUT /compliance/modulesets/{modset_id}, the +// special actions on a moduleset, as the historical rest_put_compliance_moduleset: +// clone. +func (a *Api) PutComplianceModuleset(c echo.Context, modsetId string) error { + entry, err := oneEntry(c) + if err != nil { + return httpProblem(c, err) + } + ctx := c.Request().Context() + id, err := a.resolveModuleset(ctx, modsetId) + if err != nil { + return httpProblem(c, err) + } + if action, _ := entry["action"].(string); action != "clone" { + return httpProblem(c, httpErrorf(http.StatusBadRequest, "unsupported action %q", action)) + } + if err := checkCompManager(c); err != nil { + return httpProblem(c, err) + } + caller, err := a.formCaller(ctx, c) + if err != nil { + return httpProblem(c, compDesignerError(c, "PutComplianceModuleset", err)) + } + groupID, err := a.ODB.DefaultGroupOrManager(ctx, authUserID(c)) + if err != nil { + return httpProblem(c, compDesignerError(c, "PutComplianceModuleset", err)) + } + name, err := a.ODB.CompObjectName(ctx, cdb.CompModulesetKind, id) + if err != nil { + return httpProblem(c, compDesignerError(c, "PutComplianceModuleset", err)) + } + _, cloneName, err := a.ODB.CloneCompModuleset(ctx, id, caller.name, groupID) + if err != nil { + return httpProblem(c, compDesignerError(c, "PutComplianceModuleset", err)) + } + a.afterRulesetChange(c, false) + a.compLog(c, "compliance.moduleset.clone", "cloned moduleset %(o)s from %(n)s", map[string]any{"n": name, "o": cloneName}, "", "") + return compInfo(c, "clone done. new moduleset name %s", cloneName) +} + +// DeleteComplianceModuleset handles DELETE /compliance/modulesets/{modset_id}. +func (a *Api) DeleteComplianceModuleset(c echo.Context, modsetId string) error { + id, err := a.resolveModuleset(c.Request().Context(), modsetId) + if err != nil { + return httpProblem(c, err) + } + return a.deleteModuleset(c, id) +} + +// DeleteComplianceModulesets handles DELETE /compliance/modulesets, the bulk +// form naming the moduleset by the id key of the body. +func (a *Api) DeleteComplianceModulesets(c echo.Context) error { + entry, err := oneEntry(c) + if err != nil { + return httpProblem(c, err) + } + raw, ok := entry["id"] + if !ok { + return httpProblem(c, httpErrorf(http.StatusBadRequest, "The 'id' key is mandatory")) + } + id, err := a.resolveModuleset(c.Request().Context(), fmt.Sprint(raw)) + if err != nil { + return httpProblem(c, err) + } + return a.deleteModuleset(c, id) +} + +// deleteModuleset deletes a moduleset and all its relations, as +// delete_moduleset(): by a CompManager whose group is responsible for it. +func (a *Api) deleteModuleset(c echo.Context, id int64) error { + ctx := c.Request().Context() + if err := checkCompManager(c); err != nil { + return httpProblem(c, err) + } + if err := a.requireModulesetResponsible(ctx, c, id); err != nil { + return httpProblem(c, err) + } + name, err := a.ODB.CompObjectName(ctx, cdb.CompModulesetKind, id) + if err != nil { + return httpProblem(c, compDesignerError(c, "DeleteComplianceModuleset", err)) + } + if err := a.ODB.DeleteCompModuleset(ctx, id); err != nil { + return httpProblem(c, compDesignerError(c, "DeleteComplianceModuleset", err)) + } + a.afterRulesetChange(c, false) + a.compLog(c, "compliance.moduleset.delete", "deleted moduleset %(modset_name)s", map[string]any{"modset_name": name}, "", "") + return compInfo(c, "Moduleset %d deleted", id) +} + +// GetComplianceModulesetUsage handles GET /compliance/modulesets/{modset_id}/usage, +// as the historical rest_get_compliance_moduleset_usage: the modulesets holding +// it as a child. +func (a *Api) GetComplianceModulesetUsage(c echo.Context, modsetId string) error { + id, err := a.publishedModuleset(c, modsetId) + if err != nil { + return httpProblem(c, err) + } + usage, err := a.ODB.CompModulesetUsage(c.Request().Context(), id) + if err != nil { + return httpProblem(c, compDesignerError(c, "GetComplianceModulesetUsage", err)) + } + return c.JSON(http.StatusOK, map[string]any{"data": usage}) +} + +// GetComplianceModulesetAmIResponsible handles GET +// /compliance/modulesets/{modset_id}/am_i_responsible. +func (a *Api) GetComplianceModulesetAmIResponsible(c echo.Context, modsetId string) error { + ctx := c.Request().Context() + id, found, err := a.ODB.CompModulesetID(ctx, modsetId) + if err != nil { + return httpProblem(c, compDesignerError(c, "GetComplianceModulesetAmIResponsible", err)) + } + ok := false + if found { + if ok, err = a.ODB.CompObjectResponsible(ctx, cdb.CompModulesetKind, id, UserGroupsFromContext(c), IsManager(c)); err != nil { + return httpProblem(c, compDesignerError(c, "GetComplianceModulesetAmIResponsible", err)) + } + } + return c.JSON(http.StatusOK, map[string]bool{"data": ok}) +} diff --git a/server/handlers/compliance_ruleset_links.go b/server/handlers/compliance_ruleset_links.go new file mode 100644 index 00000000..9e22cebb --- /dev/null +++ b/server/handlers/compliance_ruleset_links.go @@ -0,0 +1,179 @@ +package serverhandlers + +import ( + "net/http" + + "github.com/labstack/echo/v4" +) + +// PostComplianceRulesetRuleset handles POST +// /compliance/rulesets/{rset_id}/rulesets/{child_rset_id}, as the historical +// attach_ruleset_to_ruleset(): by a CompManager responsible for the parent, a +// ruleset becomes a child of another, unless that would close a loop. +func (a *Api) PostComplianceRulesetRuleset(c echo.Context, rsetId, childRsetId string) error { + ctx := c.Request().Context() + parent, err := a.resolveRuleset(ctx, rsetId) + if err != nil { + return httpProblem(c, err) + } + child, err := a.resolveRuleset(ctx, childRsetId) + if err != nil { + return httpProblem(c, err) + } + if err := checkCompManager(c); err != nil { + return httpProblem(c, err) + } + if parent == child { + return httpProblem(c, httpErrorf(http.StatusBadRequest, "abort action to avoid introducing a recursion loop")) + } + if err := a.requireRulesetResponsible(ctx, c, parent); err != nil { + return httpProblem(c, err) + } + if attached, err := a.ODB.CompRulesetChildAttached(ctx, parent, child); err != nil { + return httpProblem(c, compDesignerError(c, "PostComplianceRulesetRuleset", err)) + } else if attached { + return httpProblem(c, httpErrorf(http.StatusConflict, "ruleset already attached")) + } + if loop, err := a.ODB.CompRulesetLoop(ctx, child, parent); err != nil { + return httpProblem(c, compDesignerError(c, "PostComplianceRulesetRuleset", err)) + } else if loop { + return httpProblem(c, httpErrorf(http.StatusConflict, "the parent ruleset is already a child of the encapsulated ruleset. abort encapsulation not to cause infinite recursion")) + } + names, err := a.rulesetNames(c, parent, child) + if err != nil { + return httpProblem(c, err) + } + if err := a.ODB.AttachCompRulesetChild(ctx, parent, child); err != nil { + return httpProblem(c, compDesignerError(c, "PostComplianceRulesetRuleset", err)) + } + a.afterRulesetChange(c, true) + a.compLog(c, "compliance.ruleset.attach", "attach ruleset %(rset_name)s to %(dst_rset_name)s", + map[string]any{"rset_name": names[1], "dst_rset_name": names[0]}, "", "") + return compInfo(c, "ruleset attached") +} + +// DeleteComplianceRulesetRuleset handles DELETE +// /compliance/rulesets/{rset_id}/rulesets/{child_rset_id}, as the historical +// detach_ruleset_from_ruleset(): by a CompManager responsible for the parent, the +// child being published to them. +func (a *Api) DeleteComplianceRulesetRuleset(c echo.Context, rsetId, childRsetId string) error { + ctx := c.Request().Context() + parent, err := a.resolveRuleset(ctx, rsetId) + if err != nil { + return httpProblem(c, err) + } + child, err := a.resolveRuleset(ctx, childRsetId) + if err != nil { + return httpProblem(c, err) + } + if err := checkCompManager(c); err != nil { + return httpProblem(c, err) + } + if err := a.requireRulesetResponsible(ctx, c, parent); err != nil { + return httpProblem(c, err) + } + if err := a.requireRulesetPublished(ctx, c, child); err != nil { + return httpProblem(c, err) + } + names, err := a.rulesetNames(c, parent, child) + if err != nil { + return httpProblem(c, err) + } + if err := a.ODB.DetachCompRulesetChild(ctx, parent, child); err != nil { + return httpProblem(c, compDesignerError(c, "DeleteComplianceRulesetRuleset", err)) + } + a.afterRulesetChange(c, true) + a.compLog(c, "compliance.ruleset.detach", "detach ruleset %(rset_name)s from %(parent_rset_name)s", + map[string]any{"rset_name": names[1], "parent_rset_name": names[0]}, "", "") + return compInfo(c, "ruleset detached") +} + +// rulesetNames returns the names of rulesets, for the logs. +func (a *Api) rulesetNames(c echo.Context, ids ...int64) ([]string, error) { + names := make([]string, len(ids)) + for i, id := range ids { + name, err := a.ODB.CompRulesetNameByID(c.Request().Context(), id) + if err != nil { + return nil, compDesignerError(c, "read the ruleset name", err) + } + names[i] = name + } + return names, nil +} + +// PostComplianceRulesetFilterset handles POST +// /compliance/rulesets/{rset_id}/filtersets/{fset_id}, as the historical +// attach_filterset_to_ruleset(): the filterset selecting the nodes and services a +// contextual ruleset applies to, replacing the previous one. +func (a *Api) PostComplianceRulesetFilterset(c echo.Context, rsetId, fsetId string) error { + ctx := c.Request().Context() + rid, err := a.resolveRuleset(ctx, rsetId) + if err != nil { + return httpProblem(c, err) + } + fid, fname, err := a.ODB.FiltersetByIDOrName(ctx, fsetId) + if err != nil { + return httpProblem(c, compDesignerError(c, "PostComplianceRulesetFilterset", err)) + } + if fid == 0 { + return httpProblem(c, httpErrorf(http.StatusNotFound, "filterset %s not found", fsetId)) + } + if err := checkCompManager(c); err != nil { + return httpProblem(c, err) + } + if err := a.requireRulesetResponsible(ctx, c, rid); err != nil { + return httpProblem(c, err) + } + if current, _, found, err := a.ODB.CompRulesetFilterset(ctx, rid); err != nil { + return httpProblem(c, compDesignerError(c, "PostComplianceRulesetFilterset", err)) + } else if found && current == int64(fid) { + return compInfo(c, "filterset attached") + } + names, err := a.rulesetNames(c, rid) + if err != nil { + return httpProblem(c, err) + } + if err := a.ODB.SetCompRulesetFilterset(ctx, rid, int64(fid)); err != nil { + return httpProblem(c, compDesignerError(c, "PostComplianceRulesetFilterset", err)) + } + a.afterRulesetChange(c, false) + a.compLog(c, "compliance.ruleset.change", "attach filterset %(fset_name)s to ruleset %(rset_name)s", + map[string]any{"rset_name": names[0], "fset_name": fname}, "", "") + return compInfo(c, "filterset attached") +} + +// DeleteComplianceRulesetFilterset handles DELETE +// /compliance/rulesets/{rset_id}/filtersets/{fset_id}, as the historical +// detach_filterset_from_ruleset(): the ruleset's filterset is removed, whichever +// it is. +func (a *Api) DeleteComplianceRulesetFilterset(c echo.Context, rsetId, fsetId string) error { + ctx := c.Request().Context() + rid, err := a.resolveRuleset(ctx, rsetId) + if err != nil { + return httpProblem(c, err) + } + if err := checkCompManager(c); err != nil { + return httpProblem(c, err) + } + if err := a.requireRulesetResponsible(ctx, c, rid); err != nil { + return httpProblem(c, err) + } + _, fname, found, err := a.ODB.CompRulesetFilterset(ctx, rid) + if err != nil { + return httpProblem(c, compDesignerError(c, "DeleteComplianceRulesetFilterset", err)) + } + if !found { + return httpProblem(c, httpErrorf(http.StatusNotFound, "filterset not found")) + } + names, err := a.rulesetNames(c, rid) + if err != nil { + return httpProblem(c, err) + } + if err := a.ODB.DeleteCompRulesetFilterset(ctx, rid); err != nil { + return httpProblem(c, compDesignerError(c, "DeleteComplianceRulesetFilterset", err)) + } + a.afterRulesetChange(c, false) + a.compLog(c, "compliance.filterset.detach", "detach filterset %(fset_name)s from ruleset %(rset_name)s", + map[string]any{"rset_name": names[0], "fset_name": fname}, "", "") + return compInfo(c, "filterset detached") +} diff --git a/server/handlers/compliance_rulesets.go b/server/handlers/compliance_rulesets.go new file mode 100644 index 00000000..723f6e0c --- /dev/null +++ b/server/handlers/compliance_rulesets.go @@ -0,0 +1,336 @@ +package serverhandlers + +import ( + "context" + "fmt" + "net/http" + "strconv" + + "github.com/labstack/echo/v4" + + "github.com/opensvc/oc3/cdb" + "github.com/opensvc/oc3/server" + "github.com/opensvc/oc3/util/echolog" +) + +// GetComplianceRulesets handles GET /compliance/rulesets, as the historical +// rest_get_compliance_rulesets: the rulesets published to the caller's groups. +func (a *Api) GetComplianceRulesets(c echo.Context, params server.GetComplianceRulesetsParams) error { + return a.handleList(c, "GetComplianceRulesets", "ruleset", listEndpointParams{ + props: params.Props, limit: params.Limit, offset: params.Offset, + meta: params.Meta, stats: params.Stats, orderby: params.Orderby, groupby: params.Groupby, + filter: params.Filter, + }, func(ctx context.Context, p cdb.ListParams) ([]map[string]any, error) { + return a.ODB.GetComplianceRulesets(ctx, nil, p) + }) +} + +// GetComplianceRuleset handles GET /compliance/rulesets/{rset_id}, the ruleset +// given by id or by name, when published to one of the caller's groups. +func (a *Api) GetComplianceRuleset(c echo.Context, rsetId string, params server.GetComplianceRulesetParams) error { + id, err := a.resolveRuleset(c.Request().Context(), rsetId) + if err != nil { + return httpProblem(c, err) + } + return a.rulesetResponse(c, id, params.Props) +} + +// rulesetResponse answers with a ruleset, as the historical handlers end with +// rest_get_compliance_ruleset().handler(id). +func (a *Api) rulesetResponse(c echo.Context, id int64, props *server.InQueryProps) error { + return a.handleItem(c, "GetComplianceRuleset", "ruleset", "id", strconv.FormatInt(id, 10), listEndpointParams{ + props: props, + }, func(ctx context.Context, p cdb.ListParams) ([]map[string]any, error) { + return a.ODB.GetComplianceRulesets(ctx, &id, p) + }) +} + +// PostComplianceRulesets handles POST /compliance/rulesets, as the historical +// rest_post_compliance_rulesets: a ruleset named ruleset_name is created, +// published to and under the responsibility of the caller's default group; when +// it exists, its other given properties are updated instead. +func (a *Api) PostComplianceRulesets(c echo.Context) error { + entries, _, err := decodeEntries(c) + if err != nil { + return httpProblem(c, httpErrorf(http.StatusBadRequest, "%s", err)) + } + if len(entries) != 1 { + return httpProblem(c, httpErrorf(http.StatusBadRequest, "one ruleset is expected")) + } + entry := entries[0] + ctx := c.Request().Context() + name, err := compString("ruleset_name", entry["ruleset_name"], true) + if err != nil { + return httpProblem(c, err) + } + if id, found, err := a.ODB.CompRulesetID(ctx, name); err != nil { + return httpProblem(c, compDesignerError(c, "PostComplianceRulesets", err)) + } else if found { + delete(entry, "ruleset_name") + if len(entry) == 0 { + return compInfo(c, "No fields to update") + } + return a.updateRuleset(c, id, entry) + } + if err := checkCompManager(c); err != nil { + return httpProblem(c, err) + } + rtype := "explicit" + if v, ok := entry["ruleset_type"]; ok { + if rtype, err = compString("ruleset_type", v, true); err != nil { + return httpProblem(c, err) + } + if err := compOneOf("ruleset_type", rtype, "explicit", "contextual"); err != nil { + return httpProblem(c, err) + } + } + public := "T" + if v, ok := entry["ruleset_public"]; ok { + if public, err = compBool("ruleset_public", v); err != nil { + return httpProblem(c, err) + } + } + groupID, err := a.ODB.DefaultGroupOrManager(ctx, authUserID(c)) + if err != nil { + return httpProblem(c, compDesignerError(c, "PostComplianceRulesets", err)) + } + id, err := a.ODB.CreateCompRuleset(ctx, name, rtype, public, groupID) + if err != nil { + return httpProblem(c, compDesignerError(c, "PostComplianceRulesets", err)) + } + a.afterRulesetChange(c, true) + a.compLog(c, "compliance.ruleset.add", "added ruleset %(rset_name)s", map[string]any{"rset_name": name}, "", "") + return a.rulesetResponse(c, id, nil) +} + +// PostComplianceRuleset handles POST /compliance/rulesets/{rset_id}, as the +// historical rest_post_compliance_ruleset: the given properties are updated, by a +// CompManager responsible for the ruleset. +func (a *Api) PostComplianceRuleset(c echo.Context, rsetId string) error { + entries, _, err := decodeEntries(c) + if err != nil { + return httpProblem(c, httpErrorf(http.StatusBadRequest, "%s", err)) + } + if len(entries) != 1 { + return httpProblem(c, httpErrorf(http.StatusBadRequest, "one set of properties is expected")) + } + id, err := a.resolveRuleset(c.Request().Context(), rsetId) + if err != nil { + return httpProblem(c, err) + } + return a.updateRuleset(c, id, entries[0]) +} + +// updateRuleset checks and applies a change of ruleset properties. +func (a *Api) updateRuleset(c echo.Context, id int64, entry map[string]any) error { + ctx := c.Request().Context() + if err := checkCompManager(c); err != nil { + return httpProblem(c, err) + } + if err := a.requireRulesetResponsible(ctx, c, id); err != nil { + return httpProblem(c, err) + } + fields := map[string]any{} + for k, v := range entry { + switch k { + case "ruleset_name": + name, err := compString(k, v, true) + if err != nil { + return httpProblem(c, err) + } + if other, found, err := a.ODB.CompRulesetID(ctx, name); err != nil { + return httpProblem(c, compDesignerError(c, "PostComplianceRuleset", err)) + } else if found && other != id { + return httpProblem(c, httpErrorf(http.StatusConflict, "a ruleset named '%s' already exists", name)) + } + fields[k] = name + case "ruleset_type": + rtype, err := compString(k, v, true) + if err != nil { + return httpProblem(c, err) + } + if err := compOneOf(k, rtype, "explicit", "contextual"); err != nil { + return httpProblem(c, err) + } + fields[k] = rtype + case "ruleset_public": + public, err := compBool(k, v) + if err != nil { + return httpProblem(c, err) + } + fields[k] = public + case "id": + default: + return httpProblem(c, httpErrorf(http.StatusBadRequest, "unknown ruleset property %s", k)) + } + } + if len(fields) == 0 { + return compInfo(c, "No fields to update") + } + if err := a.ODB.UpdateCompRuleset(ctx, id, fields); err != nil { + return httpProblem(c, compDesignerError(c, "PostComplianceRuleset", err)) + } + // The chains name their rulesets: a renaming rewrites them. + _, renamed := fields["ruleset_name"] + a.afterRulesetChange(c, renamed) + a.compLog(c, "compliance.ruleset.change", "update properties %(data)s", map[string]any{"data": compJSON(fields)}, "", "") + return a.rulesetResponse(c, id, nil) +} + +// PutComplianceRuleset handles PUT /compliance/rulesets/{rset_id}, the special +// actions on a ruleset, as the historical rest_put_compliance_ruleset: clone. +func (a *Api) PutComplianceRuleset(c echo.Context, rsetId string) error { + entries, _, err := decodeEntries(c) + if err != nil || len(entries) != 1 { + return httpProblem(c, httpErrorf(http.StatusBadRequest, "an action is expected")) + } + ctx := c.Request().Context() + id, err := a.resolveRuleset(ctx, rsetId) + if err != nil { + return httpProblem(c, err) + } + action, _ := entries[0]["action"].(string) + if action != "clone" { + return httpProblem(c, httpErrorf(http.StatusBadRequest, "unsupported action %q", action)) + } + if err := checkCompManager(c); err != nil { + return httpProblem(c, err) + } + caller, err := a.formCaller(ctx, c) + if err != nil { + return httpProblem(c, compDesignerError(c, "PutComplianceRuleset", err)) + } + groupID, err := a.ODB.DefaultGroupOrManager(ctx, authUserID(c)) + if err != nil { + return httpProblem(c, compDesignerError(c, "PutComplianceRuleset", err)) + } + name, err := a.ODB.CompRulesetNameByID(ctx, id) + if err != nil { + return httpProblem(c, compDesignerError(c, "PutComplianceRuleset", err)) + } + _, cloneName, err := a.ODB.CloneCompRuleset(ctx, id, caller.name, groupID) + if err != nil { + return httpProblem(c, compDesignerError(c, "PutComplianceRuleset", err)) + } + a.afterRulesetChange(c, true) + a.compLog(c, "compliance.ruleset.clone", "cloned ruleset %(o)s from %(n)s", map[string]any{"n": name, "o": cloneName}, "", "") + return compInfo(c, "clone done. new ruleset name %s", cloneName) +} + +// DeleteComplianceRuleset handles DELETE /compliance/rulesets/{rset_id}. +func (a *Api) DeleteComplianceRuleset(c echo.Context, rsetId string) error { + id, err := a.resolveRuleset(c.Request().Context(), rsetId) + if err != nil { + return httpProblem(c, err) + } + return a.deleteRuleset(c, id) +} + +// DeleteComplianceRulesets handles DELETE /compliance/rulesets, the bulk form +// naming the ruleset by the id key of the body. +func (a *Api) DeleteComplianceRulesets(c echo.Context) error { + entries, _, err := decodeEntries(c) + if err != nil || len(entries) != 1 { + return httpProblem(c, httpErrorf(http.StatusBadRequest, "The 'id' key is mandatory")) + } + raw, ok := entries[0]["id"] + if !ok { + return httpProblem(c, httpErrorf(http.StatusBadRequest, "The 'id' key is mandatory")) + } + id, err := a.resolveRuleset(c.Request().Context(), fmt.Sprint(raw)) + if err != nil { + return httpProblem(c, err) + } + return a.deleteRuleset(c, id) +} + +// deleteRuleset deletes a ruleset and all its relations, as delete_ruleset(): by +// a CompManager whose group is responsible for it. +func (a *Api) deleteRuleset(c echo.Context, id int64) error { + ctx := c.Request().Context() + if err := checkCompManager(c); err != nil { + return httpProblem(c, err) + } + if err := a.requireRulesetResponsible(ctx, c, id); err != nil { + return httpProblem(c, err) + } + name, err := a.ODB.CompRulesetNameByID(ctx, id) + if err != nil { + return httpProblem(c, compDesignerError(c, "DeleteComplianceRuleset", err)) + } + if err := a.ODB.DeleteCompRuleset(ctx, id); err != nil { + return httpProblem(c, compDesignerError(c, "DeleteComplianceRuleset", err)) + } + a.afterRulesetChange(c, true) + a.compLog(c, "compliance.ruleset.delete", "deleted ruleset %(rset_name)s", map[string]any{"rset_name": name}, "", "") + return compInfo(c, "Ruleset %d deleted", id) +} + +// requireRulesetResponsible refuses a caller none of whose groups is responsible +// for the ruleset. +func (a *Api) requireRulesetResponsible(ctx context.Context, c echo.Context, id int64) error { + ok, err := a.ODB.CompRulesetResponsible(ctx, id, UserGroupsFromContext(c), IsManager(c)) + if err != nil { + return compDesignerError(c, "check the ruleset responsibility", err) + } + if !ok { + return httpErrorf(http.StatusForbidden, "you are not responsible for this ruleset") + } + return nil +} + +// afterRulesetChange rebuilds the ruleset chains when the hierarchy or the names +// changed, and announces the change. +func (a *Api) afterRulesetChange(c echo.Context, chains bool) { + ctx := c.Request().Context() + log := echolog.GetLogHandler(c, "compliance") + if chains { + if err := a.ODB.CompRulesetsChains(ctx); err != nil { + log.Error("cannot rebuild the ruleset chains", "error", err) + } + } + a.notifyChanges(log, ctx) +} + +// GetComplianceRulesetUsage handles GET /compliance/rulesets/{rset_id}/usage, as +// the historical rest_get_compliance_ruleset_usage: the modulesets and parent +// rulesets holding the ruleset, the nodes and services it is attached to. +func (a *Api) GetComplianceRulesetUsage(c echo.Context, rsetId string) error { + ctx := c.Request().Context() + id, found, err := a.ODB.CompRulesetID(ctx, rsetId) + if err != nil { + return httpProblem(c, compDesignerError(c, "GetComplianceRulesetUsage", err)) + } + if found { + found, err = a.ODB.CompRulesetVisible(ctx, id, UserGroupsFromContext(c), IsManager(c)) + if err != nil { + return httpProblem(c, compDesignerError(c, "GetComplianceRulesetUsage", err)) + } + } + if !found { + return httpProblem(c, httpErrorf(http.StatusNotFound, "ruleset not found or not visible to your groups")) + } + usage, err := a.ODB.CompRulesetUsage(ctx, id) + if err != nil { + return httpProblem(c, compDesignerError(c, "GetComplianceRulesetUsage", err)) + } + return c.JSON(http.StatusOK, map[string]any{"data": usage}) +} + +// GetComplianceRulesetAmIResponsible handles GET +// /compliance/rulesets/{rset_id}/am_i_responsible: whether one of the caller's +// groups is responsible for the ruleset. +func (a *Api) GetComplianceRulesetAmIResponsible(c echo.Context, rsetId string) error { + ctx := c.Request().Context() + id, found, err := a.ODB.CompRulesetID(ctx, rsetId) + if err != nil { + return httpProblem(c, compDesignerError(c, "GetComplianceRulesetAmIResponsible", err)) + } + ok := false + if found { + if ok, err = a.ODB.CompRulesetResponsible(ctx, id, UserGroupsFromContext(c), IsManager(c)); err != nil { + return httpProblem(c, compDesignerError(c, "GetComplianceRulesetAmIResponsible", err)) + } + } + return c.JSON(http.StatusOK, map[string]bool{"data": ok}) +} diff --git a/server/handlers/compliance_status.go b/server/handlers/compliance_status.go new file mode 100644 index 00000000..922af022 --- /dev/null +++ b/server/handlers/compliance_status.go @@ -0,0 +1,182 @@ +package serverhandlers + +import ( + "context" + "fmt" + "net/http" + "strconv" + + "github.com/google/uuid" + "github.com/labstack/echo/v4" + + "github.com/opensvc/oc3/cdb" + "github.com/opensvc/oc3/server" + "github.com/opensvc/oc3/util/echolog" + "github.com/opensvc/oc3/util/logkey" +) + +// parseCompID reads the integer id of a compliance record from a path. +func parseCompID(raw string) (int64, error) { + id, err := strconv.ParseInt(raw, 10, 64) + if err != nil { + return 0, httpErrorf(http.StatusBadRequest, "invalid id %q: an integer is expected", raw) + } + return id, nil +} + +// GetComplianceLogs handles GET /compliance/logs, as the historical +// rest_get_compliance_logs: the runs of the nodes the caller may see, of the +// nodes of the fset_id filterset when one is given. +func (a *Api) GetComplianceLogs(c echo.Context, params server.GetComplianceLogsParams) error { + var fsetNodeIDs []string + if params.FsetId != nil && *params.FsetId != "" { + ids, err := a.filtersetNodeIDs(c.Request().Context(), *params.FsetId) + if err != nil { + return httpProblem(c, err) + } + fsetNodeIDs = ids + } + return a.handleList(c, "GetComplianceLogs", "comp_log", listEndpointParams{ + props: params.Props, limit: params.Limit, offset: params.Offset, + meta: params.Meta, stats: params.Stats, orderby: params.Orderby, groupby: params.Groupby, + filter: params.Filter, + }, func(ctx context.Context, p cdb.ListParams) ([]map[string]any, error) { + return a.ODB.GetComplianceLogs(ctx, nil, fsetNodeIDs, p) + }) +} + +// filtersetNodeIDs resolves a filterset given by id or name to the ids of the +// nodes it selects, never nil: an empty selection matches no node. +func (a *Api) filtersetNodeIDs(ctx context.Context, ref string) ([]string, error) { + fsetID, _, err := a.ODB.FiltersetByIDOrName(ctx, ref) + if err != nil { + return nil, fmt.Errorf("filtersetNodeIDs: %w", err) + } + if fsetID == 0 { + return nil, httpErrorf(http.StatusNotFound, "fset %s does not exist", ref) + } + ids, err := a.ODB.ResolveFilterset(ctx, fsetID, "node_id") + if err != nil { + return nil, fmt.Errorf("filtersetNodeIDs: %w", err) + } + if ids == nil { + ids = []string{} + } + return ids, nil +} + +// GetComplianceLog handles GET /compliance/logs/{log_id}. +func (a *Api) GetComplianceLog(c echo.Context, logId string, params server.GetComplianceLogParams) error { + id, err := parseCompID(logId) + if err != nil { + return httpProblem(c, err) + } + return a.handleItem(c, "GetComplianceLog", "comp_log", "id", logId, listEndpointParams{ + props: params.Props, + }, func(ctx context.Context, p cdb.ListParams) ([]map[string]any, error) { + return a.ODB.GetComplianceLogs(ctx, &id, nil, p) + }) +} + +// GetComplianceStatus handles GET /compliance/status, as the historical +// rest_get_compliance_status: the last runs of the nodes the caller may see. +func (a *Api) GetComplianceStatus(c echo.Context, params server.GetComplianceStatusParams) error { + return a.handleList(c, "GetComplianceStatus", "comp_status", listEndpointParams{ + props: params.Props, limit: params.Limit, offset: params.Offset, + meta: params.Meta, stats: params.Stats, orderby: params.Orderby, groupby: params.Groupby, + filter: params.Filter, + }, func(ctx context.Context, p cdb.ListParams) ([]map[string]any, error) { + return a.ODB.GetComplianceStatus(ctx, nil, p) + }) +} + +// GetComplianceStatusRun handles GET /compliance/status/{status_id}. +func (a *Api) GetComplianceStatusRun(c echo.Context, statusId string, params server.GetComplianceStatusRunParams) error { + id, err := parseCompID(statusId) + if err != nil { + return httpProblem(c, err) + } + return a.handleItem(c, "GetComplianceStatusRun", "comp_status", "id", statusId, listEndpointParams{ + props: params.Props, + }, func(ctx context.Context, p cdb.ListParams) ([]map[string]any, error) { + return a.ODB.GetComplianceStatus(ctx, &id, p) + }) +} + +// DeleteComplianceStatusRun handles DELETE /compliance/status/{status_id}. +func (a *Api) DeleteComplianceStatusRun(c echo.Context, statusId string) error { + id, err := parseCompID(statusId) + if err != nil { + return httpProblem(c, err) + } + return a.deleteComplianceStatusRun(c, id) +} + +// DeleteComplianceStatus handles DELETE /compliance/status, the bulk form taking +// the id of the run in the body, as the historical rest_delete_compliance_status_runs. +func (a *Api) DeleteComplianceStatus(c echo.Context) error { + var body server.DeleteComplianceStatusJSONRequestBody + if err := c.Bind(&body); err != nil { + return JSONProblem(c, http.StatusBadRequest, err.Error()) + } + if body.Id == nil { + return JSONProblemf(c, http.StatusBadRequest, "The 'id' key is mandatory") + } + return a.deleteComplianceStatusRun(c, int64(*body.Id)) +} + +// deleteComplianceStatusRun deletes the last check run of a module-node-service +// tuple, as the historical rest_delete_compliance_status_run: the CompExec +// privilege and the responsibility of the node are required, and the deletion is +// logged. +func (a *Api) deleteComplianceStatusRun(c echo.Context, id int64) error { + log := echolog.GetLogHandler(c, "DeleteComplianceStatusRun") + ctx := c.Request().Context() + if !IsManager(c) && !HasGroup(c, "CompExec") { + return JSONProblemf(c, http.StatusForbidden, "the CompExec privilege is required") + } + groups := UserGroupsFromContext(c) + run, err := a.ODB.CompStatusRunVisible(ctx, id, groups, IsManager(c)) + if err != nil { + return httpProblem(c, httpInternal(log, "cannot read the run", err)) + } + if run == nil { + return c.JSON(http.StatusOK, map[string]string{"info": fmt.Sprintf("Run %d not found or you are not responsible for the node", id)}) + } + if run.NodeID != "" { + responsible, err := a.ODB.NodeResponsible(ctx, run.NodeID, groups, IsManager(c)) + if err != nil { + return httpProblem(c, httpInternal(log, "cannot check the node responsibility", err)) + } + if !responsible { + return JSONProblemf(c, http.StatusForbidden, "user is not responsible for node %s", run.NodeID) + } + } + if err := a.ODB.DeleteCompStatusRun(ctx, id); err != nil { + return httpProblem(c, httpInternal(log, "cannot delete the run", err)) + } + target := "node " + run.Nodename + if run.SvcID != "" { + target = "service " + run.Svcname + " on " + target + } + a.compLog(c, "compliance.status.delete", "deleted run module %(module)s on %(target)s", + map[string]any{"module": run.RunModule, "target": target}, run.NodeID, run.SvcID) + a.notifyChanges(log, ctx) + return c.JSON(http.StatusOK, map[string]string{"info": fmt.Sprintf("Run %d deleted", id)}) +} + +// compLog writes a compliance change to the collector log, as _log() does in the +// historical collector. +func (a *Api) compLog(c echo.Context, action, format string, dict map[string]any, nodeID, svcID string) { + userEmail, _ := c.Get(XUserEmail).(string) + entry := cdb.LogEntry{Action: action, User: userEmail, Fmt: format, Dict: dict, Level: "info"} + if id, err := uuid.Parse(nodeID); err == nil { + entry.NodeID = &id + } + if id, err := uuid.Parse(svcID); err == nil { + entry.SvcID = &id + } + if err := a.ODB.Log(c.Request().Context(), entry); err != nil { + echolog.GetLogHandler(c, action).Error("cannot write audit log", logkey.Error, err) + } +} diff --git a/server/handlers/compliance_teams.go b/server/handlers/compliance_teams.go new file mode 100644 index 00000000..672914e2 --- /dev/null +++ b/server/handlers/compliance_teams.go @@ -0,0 +1,265 @@ +package serverhandlers + +import ( + "context" + "fmt" + "net/http" + + "github.com/labstack/echo/v4" + + "github.com/opensvc/oc3/cdb" + "github.com/opensvc/oc3/server" +) + +// compTeamList answers with the publication or responsible groups of a +// compliance object; a non-manager sees only their own among them. +func (a *Api) compTeamList(c echo.Context, name string, k cdb.CompKind, objID int64, gtype string, params listEndpointParams) error { + return a.handleList(c, name, "auth_group", params, func(ctx context.Context, p cdb.ListParams) ([]map[string]any, error) { + return a.ODB.GetCompTeamGroups(ctx, k, objID, gtype, p) + }) +} + +// compTeamChange attaches or detaches a publication or responsible group of a +// compliance object, as attach_group_to_ruleset() and detach_group_from_ruleset() +// and their moduleset counterparts: by a CompManager responsible for the object. +// A non-manager may attach only one of their groups; Everybody may not be made +// responsible, nor be given the publication of a contextual ruleset. +func (a *Api) compTeamChange(c echo.Context, name string, k cdb.CompKind, objID int64, gtype, groupRef string, attach bool) error { + ctx := c.Request().Context() + if err := checkCompManager(c); err != nil { + return httpProblem(c, err) + } + if ok, err := a.ODB.CompObjectResponsible(ctx, k, objID, UserGroupsFromContext(c), IsManager(c)); err != nil { + return httpProblem(c, compDesignerError(c, name, err)) + } else if !ok { + return httpProblem(c, httpErrorf(http.StatusForbidden, "%s not found or not owned by you", k.Name)) + } + group, found, err := a.ODB.AuthGroupByIDOrRole(ctx, groupRef) + if err != nil { + return httpProblem(c, compDesignerError(c, name, err)) + } + if !found { + return httpProblem(c, httpErrorf(http.StatusNotFound, "group %s not found", groupRef)) + } + objName, err := a.ODB.CompObjectName(ctx, k, objID) + if err != nil { + return httpProblem(c, compDesignerError(c, name, err)) + } + dict := map[string]any{"gtype": gtype, "role": group.Role} + nameKey := "rset_name" + if k.Name == "moduleset" { + nameKey = "modset_name" + } + dict[nameKey] = objName + if !attach { + if err := a.ODB.DetachCompTeam(ctx, k, objID, gtype, group.ID); err != nil { + return httpProblem(c, compDesignerError(c, name, err)) + } + a.compLog(c, "compliance."+k.Name+".detach", "detach %(gtype)s group %(role)s from "+k.Name+" %("+nameKey+")s", dict, "", "") + a.afterRulesetChange(c, false) + return compInfo(c, "group detached") + } + if group.Role == "Everybody" { + if gtype == "responsible" { + return httpProblem(c, httpErrorf(http.StatusBadRequest, "Giving responsibility of a %s to Everybody is not allowed", k.Name)) + } + if k.Name == "ruleset" { + if contextual, err := a.rulesetIsContextual(ctx, objID); err != nil { + return httpProblem(c, compDesignerError(c, name, err)) + } else if contextual { + return httpProblem(c, httpErrorf(http.StatusBadRequest, "Publishing a contextual ruleset to Everybody is not allowed")) + } + } + } + if !IsManager(c) && !HasGroup(c, group.Role) { + return httpProblem(c, httpErrorf(http.StatusForbidden, "you can't attach a group you are not a member of")) + } + if attached, err := a.ODB.CompTeamAttached(ctx, k, objID, gtype, group.ID); err != nil { + return httpProblem(c, compDesignerError(c, name, err)) + } else if attached { + return compInfo(c, "%s group already attached", gtype) + } + if err := a.ODB.AttachCompTeam(ctx, k, objID, gtype, group.ID); err != nil { + return httpProblem(c, compDesignerError(c, name, err)) + } + a.compLog(c, "compliance."+k.Name+".change", "attach %(gtype)s group %(role)s to "+k.Name+" %("+nameKey+")s", dict, "", "") + a.afterRulesetChange(c, false) + return compInfo(c, "group attached") +} + +func (a *Api) rulesetIsContextual(ctx context.Context, id int64) (bool, error) { + return a.ODB.RulesetIsContextual(ctx, id) +} + +// compTeamBody reads the object and the group a bulk form names in its body. +func compTeamBody(c echo.Context, objKey string) (string, string, error) { + entry, err := oneEntry(c) + if err != nil { + return "", "", err + } + obj, ok := entry[objKey] + if !ok { + return "", "", httpErrorf(http.StatusBadRequest, "The '%s' key is mandatory", objKey) + } + group, ok := entry["group_id"] + if !ok { + return "", "", httpErrorf(http.StatusBadRequest, "The 'group_id' key is mandatory") + } + return fmt.Sprint(obj), fmt.Sprint(group), nil +} + +func listParams(props *server.InQueryProps, limit *server.InQueryLimit, offset *server.InQueryOffset, meta *server.InQueryMeta, stats *server.InQueryStats, orderby *server.InQueryOrderby, groupby *server.InQueryGroupby, filter *server.InQueryFilter) listEndpointParams { + return listEndpointParams{props: props, limit: limit, offset: offset, meta: meta, stats: stats, orderby: orderby, groupby: groupby, filter: filter} +} + +// GetComplianceRulesetPublications handles GET /compliance/rulesets/{rset_id}/publications. +func (a *Api) GetComplianceRulesetPublications(c echo.Context, rsetId string, params server.GetComplianceRulesetPublicationsParams) error { + id, err := a.resolveRuleset(c.Request().Context(), rsetId) + if err != nil { + return httpProblem(c, err) + } + return a.compTeamList(c, "GetComplianceRulesetPublications", cdb.CompRulesetKind, id, "publication", + listParams(params.Props, params.Limit, params.Offset, params.Meta, params.Stats, params.Orderby, params.Groupby, params.Filter)) +} + +// GetComplianceRulesetResponsibles handles GET /compliance/rulesets/{rset_id}/responsibles. +func (a *Api) GetComplianceRulesetResponsibles(c echo.Context, rsetId string, params server.GetComplianceRulesetResponsiblesParams) error { + id, err := a.resolveRuleset(c.Request().Context(), rsetId) + if err != nil { + return httpProblem(c, err) + } + return a.compTeamList(c, "GetComplianceRulesetResponsibles", cdb.CompRulesetKind, id, "responsible", + listParams(params.Props, params.Limit, params.Offset, params.Meta, params.Stats, params.Orderby, params.Groupby, params.Filter)) +} + +func (a *Api) rulesetTeamChange(c echo.Context, name, rsetRef, groupRef, gtype string, attach bool) error { + id, err := a.resolveRuleset(c.Request().Context(), rsetRef) + if err != nil { + return httpProblem(c, err) + } + return a.compTeamChange(c, name, cdb.CompRulesetKind, id, gtype, groupRef, attach) +} + +// PostComplianceRulesetPublication handles POST /compliance/rulesets/{rset_id}/publications/{group_id}. +func (a *Api) PostComplianceRulesetPublication(c echo.Context, rsetId, groupId string) error { + return a.rulesetTeamChange(c, "PostComplianceRulesetPublication", rsetId, groupId, "publication", true) +} + +// DeleteComplianceRulesetPublication handles DELETE /compliance/rulesets/{rset_id}/publications/{group_id}. +func (a *Api) DeleteComplianceRulesetPublication(c echo.Context, rsetId, groupId string) error { + return a.rulesetTeamChange(c, "DeleteComplianceRulesetPublication", rsetId, groupId, "publication", false) +} + +// PostComplianceRulesetResponsible handles POST /compliance/rulesets/{rset_id}/responsibles/{group_id}. +func (a *Api) PostComplianceRulesetResponsible(c echo.Context, rsetId, groupId string) error { + return a.rulesetTeamChange(c, "PostComplianceRulesetResponsible", rsetId, groupId, "responsible", true) +} + +// DeleteComplianceRulesetResponsible handles DELETE /compliance/rulesets/{rset_id}/responsibles/{group_id}. +func (a *Api) DeleteComplianceRulesetResponsible(c echo.Context, rsetId, groupId string) error { + return a.rulesetTeamChange(c, "DeleteComplianceRulesetResponsible", rsetId, groupId, "responsible", false) +} + +func (a *Api) rulesetsTeamBulk(c echo.Context, name, gtype string, attach bool) error { + rset, group, err := compTeamBody(c, "ruleset_id") + if err != nil { + return httpProblem(c, err) + } + return a.rulesetTeamChange(c, name, rset, group, gtype, attach) +} + +// PostComplianceRulesetsPublications handles POST /compliance/rulesets_publications. +func (a *Api) PostComplianceRulesetsPublications(c echo.Context) error { + return a.rulesetsTeamBulk(c, "PostComplianceRulesetsPublications", "publication", true) +} + +// DeleteComplianceRulesetsPublications handles DELETE /compliance/rulesets_publications. +func (a *Api) DeleteComplianceRulesetsPublications(c echo.Context) error { + return a.rulesetsTeamBulk(c, "DeleteComplianceRulesetsPublications", "publication", false) +} + +// PostComplianceRulesetsResponsibles handles POST /compliance/rulesets_responsibles. +func (a *Api) PostComplianceRulesetsResponsibles(c echo.Context) error { + return a.rulesetsTeamBulk(c, "PostComplianceRulesetsResponsibles", "responsible", true) +} + +// DeleteComplianceRulesetsResponsibles handles DELETE /compliance/rulesets_responsibles. +func (a *Api) DeleteComplianceRulesetsResponsibles(c echo.Context) error { + return a.rulesetsTeamBulk(c, "DeleteComplianceRulesetsResponsibles", "responsible", false) +} + +// GetComplianceModulesetPublications handles GET /compliance/modulesets/{modset_id}/publications. +func (a *Api) GetComplianceModulesetPublications(c echo.Context, modsetId string, params server.GetComplianceModulesetPublicationsParams) error { + id, err := a.resolveModuleset(c.Request().Context(), modsetId) + if err != nil { + return httpProblem(c, err) + } + return a.compTeamList(c, "GetComplianceModulesetPublications", cdb.CompModulesetKind, id, "publication", + listParams(params.Props, params.Limit, params.Offset, params.Meta, params.Stats, params.Orderby, params.Groupby, params.Filter)) +} + +// GetComplianceModulesetResponsibles handles GET /compliance/modulesets/{modset_id}/responsibles. +func (a *Api) GetComplianceModulesetResponsibles(c echo.Context, modsetId string, params server.GetComplianceModulesetResponsiblesParams) error { + id, err := a.resolveModuleset(c.Request().Context(), modsetId) + if err != nil { + return httpProblem(c, err) + } + return a.compTeamList(c, "GetComplianceModulesetResponsibles", cdb.CompModulesetKind, id, "responsible", + listParams(params.Props, params.Limit, params.Offset, params.Meta, params.Stats, params.Orderby, params.Groupby, params.Filter)) +} + +func (a *Api) modulesetTeamChange(c echo.Context, name, modsetRef, groupRef, gtype string, attach bool) error { + id, err := a.resolveModuleset(c.Request().Context(), modsetRef) + if err != nil { + return httpProblem(c, err) + } + return a.compTeamChange(c, name, cdb.CompModulesetKind, id, gtype, groupRef, attach) +} + +// PostComplianceModulesetPublication handles POST /compliance/modulesets/{modset_id}/publications/{group_id}. +func (a *Api) PostComplianceModulesetPublication(c echo.Context, modsetId, groupId string) error { + return a.modulesetTeamChange(c, "PostComplianceModulesetPublication", modsetId, groupId, "publication", true) +} + +// DeleteComplianceModulesetPublication handles DELETE /compliance/modulesets/{modset_id}/publications/{group_id}. +func (a *Api) DeleteComplianceModulesetPublication(c echo.Context, modsetId, groupId string) error { + return a.modulesetTeamChange(c, "DeleteComplianceModulesetPublication", modsetId, groupId, "publication", false) +} + +// PostComplianceModulesetResponsible handles POST /compliance/modulesets/{modset_id}/responsibles/{group_id}. +func (a *Api) PostComplianceModulesetResponsible(c echo.Context, modsetId, groupId string) error { + return a.modulesetTeamChange(c, "PostComplianceModulesetResponsible", modsetId, groupId, "responsible", true) +} + +// DeleteComplianceModulesetResponsible handles DELETE /compliance/modulesets/{modset_id}/responsibles/{group_id}. +func (a *Api) DeleteComplianceModulesetResponsible(c echo.Context, modsetId, groupId string) error { + return a.modulesetTeamChange(c, "DeleteComplianceModulesetResponsible", modsetId, groupId, "responsible", false) +} + +func (a *Api) modulesetsTeamBulk(c echo.Context, name, gtype string, attach bool) error { + modset, group, err := compTeamBody(c, "modset_id") + if err != nil { + return httpProblem(c, err) + } + return a.modulesetTeamChange(c, name, modset, group, gtype, attach) +} + +// PostComplianceModulesetsPublications handles POST /compliance/modulesets_publications. +func (a *Api) PostComplianceModulesetsPublications(c echo.Context) error { + return a.modulesetsTeamBulk(c, "PostComplianceModulesetsPublications", "publication", true) +} + +// DeleteComplianceModulesetsPublications handles DELETE /compliance/modulesets_publications. +func (a *Api) DeleteComplianceModulesetsPublications(c echo.Context) error { + return a.modulesetsTeamBulk(c, "DeleteComplianceModulesetsPublications", "publication", false) +} + +// PostComplianceModulesetsResponsibles handles POST /compliance/modulesets_responsibles. +func (a *Api) PostComplianceModulesetsResponsibles(c echo.Context) error { + return a.modulesetsTeamBulk(c, "PostComplianceModulesetsResponsibles", "responsible", true) +} + +// DeleteComplianceModulesetsResponsibles handles DELETE /compliance/modulesets_responsibles. +func (a *Api) DeleteComplianceModulesetsResponsibles(c echo.Context) error { + return a.modulesetsTeamBulk(c, "DeleteComplianceModulesetsResponsibles", "responsible", false) +} diff --git a/server/handlers/compliance_variables.go b/server/handlers/compliance_variables.go new file mode 100644 index 00000000..d84fa678 --- /dev/null +++ b/server/handlers/compliance_variables.go @@ -0,0 +1,372 @@ +package serverhandlers + +import ( + "context" + "encoding/json" + "fmt" + "net/http" + "strconv" + + "github.com/labstack/echo/v4" + + "github.com/opensvc/oc3/cdb" + "github.com/opensvc/oc3/server" +) + +// requireRulesetPublished refuses a caller the ruleset is not published to. +func (a *Api) requireRulesetPublished(ctx context.Context, c echo.Context, id int64) error { + ok, err := a.ODB.CompRulesetPublished(ctx, id, UserGroupsFromContext(c), IsManager(c)) + if err != nil { + return compDesignerError(c, "check the ruleset publication", err) + } + if !ok { + return httpErrorf(http.StatusForbidden, "you are not member of one of the ruleset publication groups") + } + return nil +} + +// resolveRulesetVariable returns the ids of a ruleset and of one of its +// variables, each given by id or by name. +func (a *Api) resolveRulesetVariable(ctx context.Context, rsetID, varID string) (int64, int64, error) { + rid, err := a.resolveRuleset(ctx, rsetID) + if err != nil { + return 0, 0, err + } + vid, found, err := a.ODB.CompRulesetVariableID(ctx, rid, varID) + if err != nil { + return 0, 0, err + } + if !found { + return 0, 0, httpErrorf(http.StatusNotFound, "variable %s not found", varID) + } + return rid, vid, nil +} + +// variableFields checks the settable properties of a variable. var_value may be +// given as a string, or as any JSON value, stored serialized. +func variableFields(entry map[string]any) (map[string]any, error) { + fields := map[string]any{} + for k, v := range entry { + switch k { + case "var_name": + name, err := compString(k, v, true) + if err != nil { + return nil, err + } + fields[k] = name + case "var_class": + class, err := compString(k, v, false) + if err != nil { + return nil, err + } + fields[k] = class + case "var_value": + if s, ok := v.(string); ok { + fields[k] = s + } else if v == nil { + fields[k] = nil + } else { + b, err := json.Marshal(v) + if err != nil { + return nil, httpErrorf(http.StatusBadRequest, "invalid var_value: %s", err) + } + fields[k] = string(b) + } + case "id", "ruleset_id", "ruleset_name", "var_author", "var_updated": + default: + return nil, httpErrorf(http.StatusBadRequest, "unknown variable property %s", k) + } + } + return fields, nil +} + +// GetComplianceRulesetVariables handles GET /compliance/rulesets/{rset_id}/variables: +// the variables of a ruleset published to the caller. +func (a *Api) GetComplianceRulesetVariables(c echo.Context, rsetId string, params server.GetComplianceRulesetVariablesParams) error { + ctx := c.Request().Context() + rid, err := a.resolveRuleset(ctx, rsetId) + if err == nil { + err = a.requireRulesetPublished(ctx, c, rid) + } + if err != nil { + return httpProblem(c, err) + } + return a.handleList(c, "GetComplianceRulesetVariables", "ruleset_variable", listEndpointParams{ + props: params.Props, limit: params.Limit, offset: params.Offset, + meta: params.Meta, stats: params.Stats, orderby: params.Orderby, groupby: params.Groupby, + filter: params.Filter, + }, func(ctx context.Context, p cdb.ListParams) ([]map[string]any, error) { + return a.ODB.GetComplianceRulesetVariables(ctx, rid, nil, p) + }) +} + +// GetComplianceRulesetVariable handles GET +// /compliance/rulesets/{rset_id}/variables/{var_id}. +func (a *Api) GetComplianceRulesetVariable(c echo.Context, rsetId, varId string, params server.GetComplianceRulesetVariableParams) error { + ctx := c.Request().Context() + rid, vid, err := a.resolveRulesetVariable(ctx, rsetId, varId) + if err == nil { + err = a.requireRulesetPublished(ctx, c, rid) + } + if err != nil { + return httpProblem(c, err) + } + return a.variableResponse(c, rid, vid, params.Props) +} + +func (a *Api) variableResponse(c echo.Context, rid, vid int64, props *server.InQueryProps) error { + return a.handleItem(c, "GetComplianceRulesetVariable", "ruleset_variable", "id", strconv.FormatInt(vid, 10), listEndpointParams{ + props: props, + }, func(ctx context.Context, p cdb.ListParams) ([]map[string]any, error) { + return a.ODB.GetComplianceRulesetVariables(ctx, rid, &vid, p) + }) +} + +// PostComplianceRulesetVariables handles POST /compliance/rulesets/{rset_id}/variables, +// as the historical rest_post_compliance_ruleset_variables: a variable named +// var_name is created, or updated when the ruleset has one of that name. +func (a *Api) PostComplianceRulesetVariables(c echo.Context, rsetId string) error { + entry, err := oneEntry(c) + if err != nil { + return httpProblem(c, err) + } + rid, err := a.resolveRuleset(c.Request().Context(), rsetId) + if err != nil { + return httpProblem(c, err) + } + return a.createOrUpdateVariable(c, rid, entry) +} + +// PostComplianceRulesetsVariables handles POST /compliance/rulesets_variables, +// GetComplianceRulesetsVariables handles GET /compliance/rulesets_variables. +func (a *Api) GetComplianceRulesetsVariables(c echo.Context, params server.GetComplianceRulesetsVariablesParams) error { + return a.handleList(c, "GetComplianceRulesetsVariables", "rulesets_variable", + listParams(params.Props, params.Limit, params.Offset, params.Meta, params.Stats, params.Orderby, params.Groupby, params.Filter), + func(ctx context.Context, p cdb.ListParams) ([]map[string]any, error) { + return a.ODB.GetComplianceRulesetsVariables(ctx, p) + }) +} + +// the form naming the ruleset by ruleset_id or ruleset_name in the body. +func (a *Api) PostComplianceRulesetsVariables(c echo.Context) error { + entry, err := oneEntry(c) + if err != nil { + return httpProblem(c, err) + } + ref, ok := entry["ruleset_id"] + if !ok { + ref, ok = entry["ruleset_name"] + } + if !ok { + return httpProblem(c, httpErrorf(http.StatusBadRequest, "The 'ruleset_id' or 'ruleset_name' is mandatory")) + } + rid, err := a.resolveRuleset(c.Request().Context(), fmt.Sprint(ref)) + if err != nil { + return httpProblem(c, err) + } + return a.createOrUpdateVariable(c, rid, entry) +} + +func (a *Api) createOrUpdateVariable(c echo.Context, rid int64, entry map[string]any) error { + ctx := c.Request().Context() + if err := checkCompManager(c); err != nil { + return httpProblem(c, err) + } + if err := a.requireRulesetResponsible(ctx, c, rid); err != nil { + return httpProblem(c, err) + } + fields, err := variableFields(entry) + if err != nil { + return httpProblem(c, err) + } + name, ok := fields["var_name"].(string) + if !ok { + return httpProblem(c, httpErrorf(http.StatusBadRequest, "var_name is mandatory in the posted data")) + } + if vid, found, err := a.ODB.CompRulesetVariableID(ctx, rid, name); err != nil { + return httpProblem(c, compDesignerError(c, "PostComplianceRulesetVariables", err)) + } else if found { + return a.updateVariable(c, rid, vid, fields) + } + caller, err := a.formCaller(ctx, c) + if err != nil { + return httpProblem(c, compDesignerError(c, "PostComplianceRulesetVariables", err)) + } + vid, err := a.ODB.CreateCompRulesetVariable(ctx, rid, fields, caller.name) + if err != nil { + return httpProblem(c, compDesignerError(c, "PostComplianceRulesetVariables", err)) + } + fields["ruleset_id"] = rid + a.compLog(c, "compliance.ruleset.variable.create", "properties %(data)s", map[string]any{"data": compJSON(fields)}, "", "") + a.afterRulesetChange(c, false) + return a.variableResponse(c, rid, vid, nil) +} + +// PostComplianceRulesetVariable handles POST +// /compliance/rulesets/{rset_id}/variables/{var_id}: a change of the variable +// properties, by a CompManager responsible for the ruleset. +func (a *Api) PostComplianceRulesetVariable(c echo.Context, rsetId, varId string) error { + entry, err := oneEntry(c) + if err != nil { + return httpProblem(c, err) + } + ctx := c.Request().Context() + rid, vid, err := a.resolveRulesetVariable(ctx, rsetId, varId) + if err == nil { + err = checkCompManager(c) + } + if err == nil { + err = a.requireRulesetResponsible(ctx, c, rid) + } + if err != nil { + return httpProblem(c, err) + } + fields, err := variableFields(entry) + if err != nil { + return httpProblem(c, err) + } + return a.updateVariable(c, rid, vid, fields) +} + +func (a *Api) updateVariable(c echo.Context, rid, vid int64, fields map[string]any) error { + ctx := c.Request().Context() + if name, ok := fields["var_name"].(string); ok { + if other, found, err := a.ODB.CompRulesetVariableID(ctx, rid, name); err != nil { + return httpProblem(c, compDesignerError(c, "PostComplianceRulesetVariable", err)) + } else if found && other != vid { + return httpProblem(c, httpErrorf(http.StatusConflict, "'var_name' already exist in the same ruleset")) + } + } + before, err := a.ODB.CompRulesetVariableByID(ctx, vid) + if err != nil { + return httpProblem(c, compDesignerError(c, "PostComplianceRulesetVariable", err)) + } + caller, err := a.formCaller(ctx, c) + if err != nil { + return httpProblem(c, compDesignerError(c, "PostComplianceRulesetVariable", err)) + } + if err := a.ODB.UpdateCompRulesetVariable(ctx, vid, fields, caller.name); err != nil { + return httpProblem(c, compDesignerError(c, "PostComplianceRulesetVariable", err)) + } + a.compLog(c, "compliance.ruleset.variable.change", "changed properties %(data)s", map[string]any{ + "data": compJSON(map[string]any{"ruleset": before.RulesetName, "variable": before.Name, "changes": fields}), + }, "", "") + a.afterRulesetChange(c, false) + return a.variableResponse(c, rid, vid, nil) +} + +// DeleteComplianceRulesetVariable handles DELETE +// /compliance/rulesets/{rset_id}/variables/{var_id}, by a CompManager responsible +// for the ruleset, as the historical handler describes it. +func (a *Api) DeleteComplianceRulesetVariable(c echo.Context, rsetId, varId string) error { + ctx := c.Request().Context() + rid, vid, err := a.resolveRulesetVariable(ctx, rsetId, varId) + if err == nil { + err = checkCompManager(c) + } + if err == nil { + err = a.requireRulesetResponsible(ctx, c, rid) + } + if err != nil { + return httpProblem(c, err) + } + v, err := a.ODB.CompRulesetVariableByID(ctx, vid) + if err != nil { + return httpProblem(c, compDesignerError(c, "DeleteComplianceRulesetVariable", err)) + } + if err := a.ODB.DeleteCompRulesetVariable(ctx, vid); err != nil { + return httpProblem(c, compDesignerError(c, "DeleteComplianceRulesetVariable", err)) + } + a.compLog(c, "compliance.ruleset.variable.delete", "deleted variable %(var_name)s from ruleset %(rset_name)s", + map[string]any{"var_name": v.Name, "rset_name": v.RulesetName}, "", "") + a.afterRulesetChange(c, false) + return compInfo(c, "variable deleted") +} + +// PutComplianceRulesetVariable handles PUT +// /compliance/rulesets/{rset_id}/variables/{var_id}, the special actions on a +// variable, as the historical rest_put_compliance_ruleset_variable: copy or move +// to dst_ruleset. A copy requires the source ruleset to be published to the +// caller, a move its responsibility; both the responsibility of the destination. +func (a *Api) PutComplianceRulesetVariable(c echo.Context, rsetId, varId string) error { + entry, err := oneEntry(c) + if err != nil { + return httpProblem(c, err) + } + ctx := c.Request().Context() + rid, vid, err := a.resolveRulesetVariable(ctx, rsetId, varId) + if err != nil { + return httpProblem(c, err) + } + action, _ := entry["action"].(string) + if action != "copy" && action != "move" { + return httpProblem(c, httpErrorf(http.StatusBadRequest, "unsupported action %q", action)) + } + dst, ok := entry["dst_ruleset"] + if !ok { + return httpProblem(c, httpErrorf(http.StatusBadRequest, "dst_ruleset not found in data")) + } + dstID, err := a.resolveRuleset(ctx, fmt.Sprint(dst)) + if err != nil { + return httpProblem(c, err) + } + if err := checkCompManager(c); err != nil { + return httpProblem(c, err) + } + if action == "copy" { + err = a.requireRulesetPublished(ctx, c, rid) + } else { + err = a.requireRulesetResponsible(ctx, c, rid) + } + if err == nil { + err = a.requireRulesetResponsible(ctx, c, dstID) + } + if err != nil { + return httpProblem(c, err) + } + v, err := a.ODB.CompRulesetVariableByID(ctx, vid) + if err != nil { + return httpProblem(c, compDesignerError(c, "PutComplianceRulesetVariable", err)) + } + // Names are unique in a ruleset: the historical handlers refuse a duplicate on + // creation and change, not on copy or move; refused here as well. + if _, found, err := a.ODB.CompRulesetVariableID(ctx, dstID, v.Name); err != nil { + return httpProblem(c, compDesignerError(c, "PutComplianceRulesetVariable", err)) + } else if found { + return httpProblem(c, httpErrorf(http.StatusConflict, "the destination ruleset already has a variable named %s", v.Name)) + } + dstName, err := a.ODB.CompRulesetNameByID(ctx, dstID) + if err != nil { + return httpProblem(c, compDesignerError(c, "PutComplianceRulesetVariable", err)) + } + dict := map[string]any{"rset_name": v.RulesetName, "dst_rset_name": dstName, "var_name": v.Name} + if action == "copy" { + caller, err := a.formCaller(ctx, c) + if err != nil { + return httpProblem(c, compDesignerError(c, "PutComplianceRulesetVariable", err)) + } + if _, err := a.ODB.CopyCompRulesetVariable(ctx, vid, dstID, caller.name); err != nil { + return httpProblem(c, compDesignerError(c, "PutComplianceRulesetVariable", err)) + } + a.compLog(c, "compliance.variable.copy", "copy variable %(var_name)s from ruleset %(rset_name)s to %(dst_rset_name)s", dict, "", "") + } else { + if err := a.ODB.MoveCompRulesetVariable(ctx, vid, dstID); err != nil { + return httpProblem(c, compDesignerError(c, "PutComplianceRulesetVariable", err)) + } + a.compLog(c, "compliance.variable.change", "move variable %(var_name)s from ruleset %(rset_name)s to %(dst_rset_name)s", dict, "", "") + } + a.afterRulesetChange(c, false) + return compInfo(c, "variable %s done", action) +} + +// oneEntry reads a body holding one object, JSON or form-encoded. +func oneEntry(c echo.Context) (map[string]any, error) { + entries, _, err := decodeEntries(c) + if err != nil { + return nil, httpErrorf(http.StatusBadRequest, "%s", err) + } + if len(entries) != 1 { + return nil, httpErrorf(http.StatusBadRequest, "one object is expected in the body") + } + return entries[0], nil +} diff --git a/server/handlers/delete_tag.go b/server/handlers/delete_tag.go index 5c5a9941..07e5aa8d 100644 --- a/server/handlers/delete_tag.go +++ b/server/handlers/delete_tag.go @@ -84,10 +84,10 @@ func (a *Api) deleteTagCascade(c echo.Context, log *slog.Logger, ctx context.Con func requireTagManager(c echo.Context) error { if !IsAuthByUser(c) { - return JSONProblemf(c, http.StatusUnauthorized, "user authentication required") + return denyRequest(c, http.StatusUnauthorized, "user authentication required") } if !IsTagManager(c) { - return JSONProblemf(c, http.StatusForbidden, "TagManager privilege required") + return denyRequest(c, http.StatusForbidden, "TagManager privilege required") } return nil } diff --git a/server/handlers/forms.go b/server/handlers/forms.go new file mode 100644 index 00000000..d01c072e --- /dev/null +++ b/server/handlers/forms.go @@ -0,0 +1,367 @@ +package serverhandlers + +import ( + "context" + "encoding/json" + "fmt" + "log/slog" + "net/http" + "sort" + "strconv" + "strings" + "time" + + "github.com/labstack/echo/v4" + "gopkg.in/yaml.v3" + + "github.com/opensvc/oc3/cdb" + "github.com/opensvc/oc3/server" + "github.com/opensvc/oc3/util/echolog" +) + +// GetForms handles GET /forms: the forms published to the caller, all of them +// for a manager. +func (a *Api) GetForms(c echo.Context, params server.GetFormsParams) error { + return a.handleList(c, "GetForms", "form", listEndpointParams{ + props: params.Props, limit: params.Limit, offset: params.Offset, + meta: params.Meta, stats: params.Stats, orderby: params.Orderby, groupby: params.Groupby, + filter: params.Filter, virtual: formDefinitionProp, + }, func(ctx context.Context, p cdb.ListParams) ([]map[string]any, error) { + return a.ODB.GetForms(ctx, nil, p) + }) +} + +// GetForm handles GET /forms/{form_id}: as GET /forms for one id, empty rather +// than 404 when the form is not visible, as the historical line handler does. +func (a *Api) GetForm(c echo.Context, formId int, params server.GetFormParams) error { + id := int64(formId) + return a.handleList(c, "GetForm", "form", listEndpointParams{ + props: params.Props, limit: params.Limit, offset: params.Offset, + meta: params.Meta, stats: params.Stats, orderby: params.Orderby, groupby: params.Groupby, + filter: params.Filter, virtual: formDefinitionProp, + }, func(ctx context.Context, p cdb.ListParams) ([]map[string]any, error) { + return a.ODB.GetForms(ctx, &id, p) + }) +} + +// formResponse reads a form back with its default props, as the historical +// handlers answer a change with rest_get_form().handler(id). The caller has just +// written it: it is read without the publication filter. +func (a *Api) formResponse(ctx context.Context, formID int64) (map[string]any, error) { + items, err := a.defaultRows(ctx, "form", formDefinitionProp, func(ctx context.Context, p cdb.ListParams) ([]map[string]any, error) { + return a.ODB.GetForms(ctx, &formID, p) + }) + if err != nil { + return nil, err + } + return map[string]any{"data": items}, nil +} + +// formFields turns posted keys into forms columns: form_definition, a JSON +// document or its string form, becomes form_yaml, and a posted form_yaml must +// parse. Keys that are not columns are refused, where the historical collector +// failed on the database insert. +func formFields(entry map[string]any) (map[string]any, error) { + fields := map[string]any{} + keys := make([]string, 0, len(entry)) + for k := range entry { + keys = append(keys, k) + } + sort.Strings(keys) + var invalid []string + for _, k := range keys { + v := entry[k] + switch { + case k == "id": + // The path names the form; the historical handler drops the key too. + case k == "form_definition": + definition := v + if s, ok := v.(string); ok { + if err := json.Unmarshal([]byte(s), &definition); err != nil { + return nil, httpErrorf(http.StatusBadRequest, "invalid form_definition: %s", err) + } + } + b, err := yaml.Marshal(numbersAsValues(definition)) + if err != nil { + return nil, httpErrorf(http.StatusBadRequest, "invalid form_definition: %s", err) + } + fields["form_yaml"] = string(b) + case cdb.IsFormColumn(k): + s, _ := entryString(entry, k) + if v == nil { + fields[k] = nil + continue + } + if k == "form_yaml" { + if _, err := parseFormYaml(s); err != nil { + return nil, httpErrorf(http.StatusBadRequest, "invalid form_yaml: %s", err) + } + } + fields[k] = s + default: + invalid = append(invalid, k) + } + } + if len(invalid) > 0 { + return nil, httpErrorf(http.StatusBadRequest, "invalid properties: %s", strings.Join(invalid, ", ")) + } + return fields, nil +} + +// numbersAsValues converts the json.Number of a decoded body to plain numbers, +// so that the yaml encoder writes them as numbers and not as strings. +func numbersAsValues(v any) any { + switch t := v.(type) { + case json.Number: + if i, err := t.Int64(); err == nil { + return i + } + if f, err := t.Float64(); err == nil { + return f + } + return t.String() + case map[string]any: + for k, item := range t { + t[k] = numbersAsValues(item) + } + case []any: + for i, item := range t { + t[i] = numbersAsValues(item) + } + } + return v +} + +// PostForms handles POST /forms: create forms. +func (a *Api) PostForms(c echo.Context) error { + log := echolog.GetLogHandler(c, "PostForms") + ctx, cancel := context.WithTimeout(c.Request().Context(), a.SyncTimeout) + defer cancel() + if err := requireFormsManager(c); err != nil { + return httpProblem(c, err) + } + entries, isList, err := decodeEntries(c) + if err != nil { + return httpProblem(c, err) + } + caller, err := a.formCaller(ctx, c) + if err != nil { + return httpProblem(c, httpInternal(log, "cannot read the caller", err)) + } + defer a.formNotify(ctx, log) + return runEntries(c, entries, isList, func(entry map[string]any) (map[string]any, error) { + return a.createForm(ctx, c, log, caller, entry) + }) +} + +func (a *Api) createForm(ctx context.Context, c echo.Context, log *slog.Logger, caller formCaller, entry map[string]any) (map[string]any, error) { + name, ok := entryString(entry, "form_name") + if !ok || name == "" { + return nil, httpErrorf(http.StatusBadRequest, "Key 'form_name' is mandatory") + } + fields, err := formFields(entry) + if err != nil { + return nil, err + } + if _, exists, err := a.ODB.FormIDByName(ctx, name); err != nil { + return nil, httpInternal(log, "cannot check the form name", err) + } else if exists { + return nil, httpErrorf(http.StatusConflict, "a form named %s already exists", name) + } + fields["form_created"] = time.Now().Format(time.DateTime) + fields["form_author"] = caller.name + + id, err := a.ODB.InsertForm(ctx, fields) + if err != nil { + return nil, httpInternal(log, "cannot create the form", err) + } + + // The creator's default group is made responsible for the form and the form + // is published to it, as lib_forms_add_default_team_*() do. + if caller.id != 0 { + groupID, found, err := a.ODB.UserDefaultGroupID(ctx, caller.id) + if err != nil { + return nil, httpInternal(log, "cannot read the default group", err) + } + if found { + for _, table := range []cdb.FormTeamTable{cdb.FormResponsibles, cdb.FormPublications} { + if err := a.ODB.InsertFormTeam(ctx, table, id, groupID); err != nil { + return nil, httpInternal(log, "cannot link the form to the default group", err) + } + } + } + } + if yamlText, ok := fields["form_yaml"].(string); ok { + a.formCommit(log, id, yamlText, caller) + } + + a.formLog(ctx, c, log, "form.add", "Form %(form_name)s added", map[string]any{"form_name": name}) + return a.formResponse(ctx, id) +} + +// PostForm handles POST /forms/{form_id}: modify a form. +func (a *Api) PostForm(c echo.Context, formId int) error { + log := echolog.GetLogHandler(c, "PostForm") + ctx, cancel := context.WithTimeout(c.Request().Context(), a.SyncTimeout) + defer cancel() + if err := requireFormsManager(c); err != nil { + return httpProblem(c, err) + } + entries, isList, err := decodeEntries(c) + if err != nil { + return httpProblem(c, err) + } + if isList { + return JSONProblem(c, http.StatusBadRequest, "expecting an object") + } + result, err := a.updateForm(ctx, c, log, int64(formId), entries[0]) + if err != nil { + return httpProblem(c, err) + } + a.formNotify(ctx, log) + return c.JSON(http.StatusOK, result) +} + +func (a *Api) updateForm(ctx context.Context, c echo.Context, log *slog.Logger, id int64, entry map[string]any) (map[string]any, error) { + form, err := a.ODB.FormByID(ctx, id) + if err != nil { + return nil, httpInternal(log, "cannot read the form", err) + } + if form == nil { + return nil, httpErrorf(http.StatusNotFound, "Form %d not found", id) + } + fields, err := formFields(entry) + if err != nil { + return nil, err + } + if name, ok := fields["form_name"].(string); ok && name != form.Name { + if otherID, exists, err := a.ODB.FormIDByName(ctx, name); err != nil { + return nil, httpInternal(log, "cannot check the form name", err) + } else if exists && otherID != id { + return nil, httpErrorf(http.StatusConflict, "a form named %s already exists", name) + } + } + if err := a.ODB.UpdateForm(ctx, id, fields); err != nil { + return nil, httpInternal(log, "cannot update the form", err) + } + + d := map[string]any{"form_name": form.Name, "data": formChanges(form, fields)} + a.formLog(ctx, c, log, "form.change", "Form %(form_name)s change: %(data)s", d) + + if yamlText, ok := fields["form_yaml"].(string); ok && yamlText != "" { + caller, err := a.formCaller(ctx, c) + if err != nil { + return nil, httpInternal(log, "cannot read the caller", err) + } + a.formCommit(log, id, yamlText, caller) + } + + result, err := a.formResponse(ctx, id) + if err != nil { + return nil, httpInternal(log, "cannot read the form back", err) + } + result["info"] = pyFormat("Form %(form_name)s change: %(data)s", d) + return result, nil +} + +// formChanges describes a change as beautify_change() does: "key: old => new", +// for the changed columns, sorted. +func formChanges(form *cdb.Form, fields map[string]any) string { + current := map[string]string{ + "form_name": form.Name, "form_yaml": form.Yaml, "form_author": form.Author, + "form_created": form.Created, "form_type": form.Type, "form_folder": form.Folder, + } + keys := make([]string, 0, len(fields)) + for k := range fields { + keys = append(keys, k) + } + sort.Strings(keys) + var out []string + for _, k := range keys { + old, known := current[k] + if !known { + continue + } + value := "" + if fields[k] != nil { + value = fmt.Sprint(fields[k]) + } + if old != value { + out = append(out, fmt.Sprintf("%s: %s => %s", k, old, value)) + } + } + return strings.Join(out, ", ") +} + +// DeleteForm handles DELETE /forms/{form_id}. +func (a *Api) DeleteForm(c echo.Context, formId int) error { + log := echolog.GetLogHandler(c, "DeleteForm") + ctx, cancel := context.WithTimeout(c.Request().Context(), a.SyncTimeout) + defer cancel() + result, err := a.deleteForm(ctx, c, log, int64(formId)) + if err != nil { + return httpProblem(c, err) + } + a.formNotify(ctx, log) + return c.JSON(http.StatusOK, result) +} + +// DeleteForms handles DELETE /forms: the forms named by the 'id' key. +func (a *Api) DeleteForms(c echo.Context) error { + log := echolog.GetLogHandler(c, "DeleteForms") + ctx, cancel := context.WithTimeout(c.Request().Context(), a.SyncTimeout) + defer cancel() + entries, isList, err := decodeEntries(c) + if err != nil { + return httpProblem(c, err) + } + defer a.formNotify(ctx, log) + return runEntries(c, entries, isList, func(entry map[string]any) (map[string]any, error) { + s, ok := entryString(entry, "id") + if !ok { + return nil, httpErrorf(http.StatusBadRequest, "The 'id' key is mandatory") + } + id, err := parseFormID(s) + if err != nil { + return nil, err + } + return a.deleteForm(ctx, c, log, id) + }) +} + +func (a *Api) deleteForm(ctx context.Context, c echo.Context, log *slog.Logger, id int64) (map[string]any, error) { + if err := requireFormsManager(c); err != nil { + return nil, err + } + if err := a.requireFormResponsible(c, log, ctx, id); err != nil { + return nil, err + } + form, err := a.ODB.FormByID(ctx, id) + if err != nil { + return nil, httpInternal(log, "cannot read the form", err) + } + if form == nil { + return nil, httpErrorf(http.StatusNotFound, "Form %d not found", id) + } + if err := a.ODB.DeleteForm(ctx, id); err != nil { + return nil, httpInternal(log, "cannot delete the form", err) + } + d := map[string]any{"form_name": form.Name} + a.formLog(ctx, c, log, "form.del", "Form %(form_name)s deleted", d) + return map[string]any{"info": pyFormat("Form %(form_name)s deleted", d)}, nil +} + +// GetFormAmIResponsible handles GET /forms/{form_id}/am_i_responsible. +func (a *Api) GetFormAmIResponsible(c echo.Context, formId int) error { + log := echolog.GetLogHandler(c, "GetFormAmIResponsible") + ctx, cancel := context.WithTimeout(c.Request().Context(), a.SyncTimeout) + defer cancel() + ok, err := a.ODB.FormResponsible(ctx, int64(formId), UserGroupsFromContext(c), IsManager(c)) + if err != nil { + return httpProblem(c, httpInternal(log, "cannot check form responsibility", err)) + } + return c.JSON(http.StatusOK, map[string]bool{"data": ok}) +} + +// formIDString renders a form id as the historical messages print it. +func formIDString(id int64) string { return strconv.FormatInt(id, 10) } diff --git a/server/handlers/forms_common.go b/server/handlers/forms_common.go new file mode 100644 index 00000000..13bc3e5f --- /dev/null +++ b/server/handlers/forms_common.go @@ -0,0 +1,288 @@ +package serverhandlers + +import ( + "bytes" + "context" + "encoding/json" + "errors" + "fmt" + "io" + "log/slog" + "net/http" + "net/url" + "strconv" + "strings" + + "github.com/labstack/echo/v4" + "gopkg.in/yaml.v3" + + "github.com/opensvc/oc3/cdb" + "github.com/opensvc/oc3/util/logkey" +) + +// requireFormsManager refuses a caller without the FormsManager privilege, as +// check_privilege("FormsManager") does: a manager always passes. +func requireFormsManager(c echo.Context) error { + if !IsAuthByUser(c) { + return httpErrorf(http.StatusUnauthorized, "user authentication required") + } + if !IsManager(c) && !HasGroup(c, "FormsManager") { + return httpErrorf(http.StatusForbidden, "user has no FormsManager privilege") + } + return nil +} + +// formCaller is the authenticated user, as the forms record it. +type formCaller struct { + id int64 + name string // "First Last", as user_name() + email string +} + +// author returns "First Last ", as user_name(email=True). +func (fc formCaller) author() string { + if fc.email == "" { + return fc.name + } + return fc.name + " <" + fc.email + ">" +} + +func (a *Api) formCaller(ctx context.Context, c echo.Context) (formCaller, error) { + id := authUserID(c) + if id == nil { + if nodeID, _ := c.Get(XNodeID).(string); nodeID != "" { + return formCaller{name: "agent"}, nil + } + return formCaller{name: "Unknown"}, nil + } + name, email, err := a.ODB.UserName(ctx, *id) + if err != nil { + return formCaller{}, err + } + return formCaller{id: *id, name: name, email: email}, nil +} + +// decodeEntries reads a JSON body holding one object or a list of objects, as +// the historical collector's handlers accept both. isList tells which. A +// form-encoded body, as the historical examples post (curl -d key=value), is +// read as one object of strings. +func decodeEntries(c echo.Context) (entries []map[string]any, isList bool, err error) { + contentType := c.Request().Header.Get(echo.HeaderContentType) + if strings.HasPrefix(contentType, echo.MIMEApplicationForm) || strings.HasPrefix(contentType, echo.MIMEMultipartForm) { + values, err := formValues(c, contentType) + if err != nil { + return nil, false, httpErrorf(http.StatusBadRequest, "invalid request body: %s", err) + } + entry := make(map[string]any, len(values)) + for k, v := range values { + if len(v) > 0 { + entry[k] = v[0] + } + } + return []map[string]any{entry}, false, nil + } + var raw json.RawMessage + if err := json.NewDecoder(c.Request().Body).Decode(&raw); err != nil { + return nil, false, httpErrorf(http.StatusBadRequest, "invalid request body: %s", err) + } + decoder := json.NewDecoder(bytes.NewReader(raw)) + decoder.UseNumber() + if trimmed := bytes.TrimSpace(raw); len(trimmed) > 0 && trimmed[0] == '[' { + if err := decoder.Decode(&entries); err != nil { + return nil, true, httpErrorf(http.StatusBadRequest, "invalid request body: %s", err) + } + return entries, true, nil + } + var entry map[string]any + if err := decoder.Decode(&entry); err != nil { + return nil, false, httpErrorf(http.StatusBadRequest, "invalid request body: %s", err) + } + return []map[string]any{entry}, false, nil +} + +// formValues reads a form-encoded body. The standard library parses the body of +// POST, PUT and PATCH requests only, while the historical examples also send +// DELETE requests with curl -d, so an url-encoded body is read directly. +func formValues(c echo.Context, contentType string) (url.Values, error) { + if !strings.HasPrefix(contentType, echo.MIMEApplicationForm) { + return c.FormParams() + } + b, err := io.ReadAll(c.Request().Body) + if err != nil { + return nil, err + } + return url.ParseQuery(string(b)) +} + +// entryString reads a key of a decoded entry as a string, as posted form +// variables are. +func entryString(entry map[string]any, key string) (string, bool) { + v, ok := entry[key] + if !ok || v == nil { + return "", ok + } + switch t := v.(type) { + case string: + return t, true + case json.Number: + return t.String(), true + } + return fmt.Sprint(v), true +} + +// runEntries answers a request whose body is one entry or a list. One entry +// answers with its result or its problem; a list always answers 200 and merges +// the info, error and data keys of every entry, as handle_list() does. +func runEntries(c echo.Context, entries []map[string]any, isList bool, run func(entry map[string]any) (map[string]any, error)) error { + if !isList { + result, err := run(entries[0]) + if err != nil { + return httpProblem(c, err) + } + return c.JSON(http.StatusOK, result) + } + merged := map[string][]any{"info": {}, "error": {}, "data": {}} + for _, entry := range entries { + result, err := run(entry) + if err != nil { + status := http.StatusInternalServerError + var fe *httpError + if errors.As(err, &fe) { + status = fe.status + } + merged["error"] = append(merged["error"], fmt.Sprintf("%d %s: %s", status, http.StatusText(status), err.Error())) + continue + } + for _, key := range []string{"info", "error", "data"} { + value, ok := result[key] + if !ok { + continue + } + switch v := value.(type) { + case []any: + merged[key] = append(merged[key], v...) + case []map[string]any: + for _, item := range v { + merged[key] = append(merged[key], item) + } + case []string: + for _, item := range v { + merged[key] = append(merged[key], item) + } + default: + merged[key] = append(merged[key], v) + } + } + } + return c.JSON(http.StatusOK, merged) +} + +// parseFormYaml parses a form definition into JSON-ready values. +func parseFormYaml(s string) (any, error) { + var v any + if err := yaml.Unmarshal([]byte(s), &v); err != nil { + return nil, err + } + return jsonReady(v), nil +} + +// jsonReady converts the maps yaml decodes with non-string keys, which JSON +// cannot encode, keying them by their text. +func jsonReady(v any) any { + switch t := v.(type) { + case map[string]any: + for k, item := range t { + t[k] = jsonReady(item) + } + return t + case map[any]any: + out := make(map[string]any, len(t)) + for k, item := range t { + out[fmt.Sprint(k)] = jsonReady(item) + } + return out + case []any: + for i, item := range t { + t[i] = jsonReady(item) + } + return t + } + return v +} + +// formDefinitionProp computes form_definition from form_yaml, left out when the +// yaml does not parse, as mangle_form_data() does. +var formDefinitionProp = map[string]virtualProp{ + "form_definition": { + requires: []string{"form_yaml"}, + compute: func(item map[string]any) (any, bool) { + s, _ := item["form_yaml"].(string) + v, err := parseFormYaml(s) + if err != nil { + return nil, false + } + return v, true + }, + }, +} + +// parseFormID reads a form id given as a path segment or a body key. +func parseFormID(s string) (int64, error) { + id, err := strconv.ParseInt(s, 10, 64) + if err != nil { + return 0, httpErrorf(http.StatusBadRequest, "invalid form id %q", s) + } + return id, nil +} + +// requireFormResponsible refuses a caller not responsible for the form, as +// form_responsible() does, with its 404. +func (a *Api) requireFormResponsible(c echo.Context, log *slog.Logger, ctx context.Context, formID int64) error { + ok, err := a.ODB.FormResponsible(ctx, formID, UserGroupsFromContext(c), IsManager(c)) + if err != nil { + return httpInternal(log, "cannot check form responsibility", err) + } + if !ok { + return httpErrorf(http.StatusNotFound, "Form %d not found or you are not responsible", formID) + } + return nil +} + +// requireFormPublished refuses a caller the form is not published to, as +// form_published() does, with its 404. +func (a *Api) requireFormPublished(c echo.Context, log *slog.Logger, ctx context.Context, formID int64) error { + ok, err := a.ODB.FormVisible(ctx, formID, UserGroupsFromContext(c), IsManager(c)) + if err != nil { + return httpInternal(log, "cannot check form publication", err) + } + if !ok { + return httpErrorf(http.StatusNotFound, "Form %d not found or not published to you", formID) + } + return nil +} + +// formLog writes an audit log entry of a forms change. +func (a *Api) formLog(ctx context.Context, c echo.Context, log *slog.Logger, action, format string, dict map[string]any) { + userEmail, _ := c.Get(XUserEmail).(string) + if err := a.ODB.Log(ctx, cdb.LogEntry{Action: action, User: userEmail, Fmt: format, Dict: dict, Level: "info"}); err != nil { + log.Error("cannot write audit log", logkey.Error, err) + } +} + +// formNotify publishes the changes of a forms request to the messenger. +func (a *Api) formNotify(ctx context.Context, log *slog.Logger) { + if err := a.ODB.Session.NotifyChanges(ctx); err != nil { + log.Error("cannot notify changes", logkey.Error, err) + } +} + +// pyFormat renders a historical collector message, "%(key)s" placeholders +// filled from dict, for the info messages the answers carry. +func pyFormat(format string, dict map[string]any) string { + out := format + for k, v := range dict { + out = strings.ReplaceAll(out, "%("+k+")s", fmt.Sprint(v)) + out = strings.ReplaceAll(out, "%("+k+")d", fmt.Sprint(v)) + } + return out +} diff --git a/server/handlers/forms_engine.go b/server/handlers/forms_engine.go new file mode 100644 index 00000000..d8e84ffa --- /dev/null +++ b/server/handlers/forms_engine.go @@ -0,0 +1,297 @@ +package serverhandlers + +import ( + "encoding/json" + "fmt" + "sort" + "strconv" + "strings" +) + +// The functions of this file port the form data helpers of the historical +// collector (init/models/rest/lib_forms.py), keeping their semantics: form data +// is the object a form submission carries, keyed by input id. + +// formValueString returns the text of a submitted value when it is one; the +// historical conditions compare strings, a number never equals "1". +func formValueString(v any) (string, bool) { + s, ok := v.(string) + return s, ok +} + +// formValueText renders a submitted value as unicode(val) does, for the +// dereferencing of "#key" references. +func formValueText(v any) string { + switch t := v.(type) { + case nil: + return "None" + case string: + return t + case bool: + if t { + return "True" + } + return "False" + case json.Number: + return t.String() + case float64: + return strconv.FormatFloat(t, 'f', -1, 64) + } + b, err := json.Marshal(v) + if err != nil { + return fmt.Sprint(v) + } + return string(b) +} + +// formGetVal returns the value of a dotted key "a.b.c" in nested objects, as +// form_get_val() does. +func formGetVal(d any, key string) (any, error) { + parts := strings.Split(key, ".") + cur := d + for _, part := range parts { + m, ok := cur.(map[string]any) + if !ok { + return nil, fmt.Errorf("%s", part) + } + v, ok := m[part] + if !ok { + return nil, fmt.Errorf("%s", part) + } + cur = v + } + return cur, nil +} + +// formRestArgs splits a rest url into path elements, "#key" references +// replaced by their value, as form_rest_args() does: +// "/arrays/#id/diskgroups" gives [arrays 554 diskgroups]. +func formRestArgs(url string, d any) ([]string, error) { + var args []string + for _, s := range strings.Split(strings.TrimRight(url, "/"), "/") { + if s == "" { + continue + } + if strings.HasPrefix(s, "#") { + v, err := formGetVal(d, strings.TrimLeft(s, "#")) + if err != nil { + return nil, err + } + args = append(args, formValueText(v)) + continue + } + args = append(args, s) + } + return args, nil +} + +// formDereference replaces the "#key" references of s by the values of the +// data, nested keys as "#a.b", as form_dereference() does: keys are replaced +// longest name first, so that "#name" does not eat the start of "#names". +func formDereference(s string, data map[string]any, prefix string) string { + keys := make([]string, 0, len(data)) + for k := range data { + keys = append(keys, k) + } + sort.Sort(sort.Reverse(sort.StringSlice(keys))) + for _, k := range keys { + if sub, ok := data[k].(map[string]any); ok { + s = formDereference(s, sub, prefix+k+".") + continue + } + s = strings.ReplaceAll(s, "#"+prefix+k, formValueText(data[k])) + } + return s +} + +// formEmpty tells whether a submitted value counts as empty in a condition. +func formEmpty(d map[string]any, key string) bool { + v, ok := d[key] + if !ok || v == nil { + return true + } + s, isString := v.(string) + return isString && (s == "" || s == "undefined") +} + +// checkFormConditions evaluates an input condition: one condition, or a list of +// them that must all hold. +func checkFormConditions(cond any, d map[string]any) (bool, error) { + if list, ok := cond.([]any); ok { + for _, c := range list { + ok, err := checkFormCondition(c, d) + if err != nil || !ok { + return false, err + } + } + return true, nil + } + return checkFormCondition(cond, d) +} + +// checkFormCondition evaluates one "#var op value" condition, as +// check_condition() does: ==, !=, IN, NOT IN, > and <, "empty" standing for a +// missing or empty value. +func checkFormCondition(condAny any, d map[string]any) (bool, error) { + if condAny == nil { + return false, fmt.Errorf("malformed condition: None") + } + cond, ok := condAny.(string) + if !ok { + return false, fmt.Errorf("malformed condition: %v", condAny) + } + if cond == "" || cond == "none" { + return true, nil + } + getVarVal := func(op string) (string, string, error) { + parts := strings.SplitN(cond, op, 2) + if len(parts) != 2 { + return "", "", fmt.Errorf("malformed output condition: %s", cond) + } + v, val := strings.TrimSpace(parts[0]), strings.TrimSpace(parts[1]) + if !strings.HasPrefix(v, "#") || len(v) < 2 { + return "", "", fmt.Errorf("malformed output condition: %s", cond) + } + return v[1:], val, nil + } + if d == nil { + return false, fmt.Errorf("no form data") + } + switch { + case strings.Contains(cond, "=="): + v, val, err := getVarVal("==") + if err != nil { + return false, err + } + if val == "empty" { + return formEmpty(d, v), nil + } + s, isString := formValueString(d[v]) + return isString && s == val, nil + case strings.Contains(cond, "!="): + v, val, err := getVarVal("!=") + if err != nil { + return false, err + } + if val == "empty" { + return !formEmpty(d, v), nil + } + if _, ok := d[v]; !ok { + return true, nil + } + s, isString := formValueString(d[v]) + return !isString || s != val, nil + case strings.Contains(cond, " NOT IN "): + v, val, err := getVarVal("NOT IN") + if err != nil { + return false, err + } + if _, ok := d[v]; !ok { + return true, nil + } + s, isString := formValueString(d[v]) + return !isString || !containsString(strings.Split(val, ","), s), nil + case strings.Contains(cond, " IN "): + v, val, err := getVarVal("IN") + if err != nil { + return false, err + } + if _, ok := d[v]; !ok { + return false, nil + } + s, isString := formValueString(d[v]) + return isString && containsString(strings.Split(val, ","), s), nil + case strings.Contains(cond, " > "), strings.Contains(cond, " < "): + op := ">" + if !strings.Contains(cond, " > ") { + op = "<" + } + v, val, err := getVarVal(op) + if err != nil { + return false, err + } + ref, err := strconv.ParseFloat(val, 64) + if err != nil { + return false, nil + } + raw, ok := d[v] + if !ok { + return false, nil + } + f, err := strconv.ParseFloat(formValueText(raw), 64) + if err != nil { + return false, nil + } + if op == ">" { + return f > ref, nil + } + return f < ref, nil + } + return false, fmt.Errorf("operator is not supported in condition %s", cond) +} + +func containsString(list []string, s string) bool { + for _, item := range list { + if item == s { + return true + } + } + return false +} + +// checkInputCondition tells whether an input applies to the data. +func checkInputCondition(input map[string]any, d map[string]any) (bool, error) { + cond, ok := input["Condition"] + if !ok { + return true, nil + } + return checkFormConditions(cond, d) +} + +// checkOutputCondition tells whether an output runs for the data. A condition +// is only allowed on a dict-format output. +func checkOutputCondition(output map[string]any, d any) (bool, error) { + cond, ok := output["Condition"] + if !ok { + return true, nil + } + if output["Format"] != "dict" { + return false, fmt.Errorf("Output condition can only be set on dict-format output") + } + m, _ := d.(map[string]any) + return checkFormCondition(cond, m) +} + +// defString reads a string property of a form definition element. +func defString(m map[string]any, key string) string { + s, _ := m[key].(string) + return s +} + +// defBool reads a boolean property of a form definition element. +func defBool(m map[string]any, key string) bool { + switch t := m[key].(type) { + case bool: + return t + case string: + return t == "yes" || t == "true" || t == "True" + } + return false +} + +// defList reads a list property of a form definition element. +func defList(m map[string]any, key string) []any { + l, _ := m[key].([]any) + return l +} + +// defMaps reads a list of objects of a form definition element. +func defMaps(m map[string]any, key string) []map[string]any { + var out []map[string]any + for _, item := range defList(m, key) { + if sub, ok := item.(map[string]any); ok { + out = append(out, sub) + } + } + return out +} diff --git a/server/handlers/forms_engine_test.go b/server/handlers/forms_engine_test.go new file mode 100644 index 00000000..51705a65 --- /dev/null +++ b/server/handlers/forms_engine_test.go @@ -0,0 +1,133 @@ +package serverhandlers + +import ( + "encoding/json" + "reflect" + "testing" +) + +func TestCheckFormCondition(t *testing.T) { + d := map[string]any{ + "os": "linux", + "size": "12", + "count": json.Number("3"), + "blank": "", + "undef": "undefined", + } + cases := []struct { + cond string + want bool + }{ + {"", true}, + {"none", true}, + {"#os == linux", true}, + {"#os == aix", false}, + {"#missing == linux", false}, + {"#count == 3", false}, // a number never equals a string, as in python + {"#blank == empty", true}, + {"#undef == empty", true}, + {"#missing == empty", true}, + {"#os == empty", false}, + {"#os != aix", true}, + {"#os != linux", false}, + {"#missing != linux", true}, + {"#count != 3", true}, + {"#os != empty", true}, + {"#blank != empty", false}, + {"#os IN aix,linux", true}, + {"#os IN aix,sunos", false}, + {"#missing IN linux", false}, + {"#os NOT IN aix,sunos", true}, + {"#os NOT IN aix,linux", false}, + {"#missing NOT IN linux", true}, + {"#size > 10", true}, + {"#size > 12", false}, + {"#size < 13", true}, + {"#count > 2", true}, + {"#os > 2", false}, + } + for _, c := range cases { + got, err := checkFormCondition(c.cond, d) + if err != nil { + t.Errorf("%q: unexpected error %s", c.cond, err) + continue + } + if got != c.want { + t.Errorf("%q: got %v, want %v", c.cond, got, c.want) + } + } + for _, bad := range []any{nil, "os == linux", "#os ~ linux"} { + if _, err := checkFormCondition(bad, d); err == nil { + t.Errorf("%v: expected an error", bad) + } + } +} + +func TestCheckFormConditionsList(t *testing.T) { + d := map[string]any{"os": "linux", "arch": "x86_64"} + ok, err := checkFormConditions([]any{"#os == linux", "#arch == x86_64"}, d) + if err != nil || !ok { + t.Errorf("all conditions hold: got %v %v", ok, err) + } + ok, err = checkFormConditions([]any{"#os == linux", "#arch == ppc"}, d) + if err != nil || ok { + t.Errorf("one condition fails: got %v %v", ok, err) + } +} + +func TestFormDereference(t *testing.T) { + data := map[string]any{ + "name": "db1", + "names": "db1,db2", + "array": map[string]any{"id": json.Number("554")}, + } + got := formDereference("#names for #name on #array.id", data, "") + if want := "db1,db2 for db1 on 554"; got != want { + t.Errorf("got %q, want %q", got, want) + } +} + +func TestFormRestArgs(t *testing.T) { + data := map[string]any{"id": json.Number("554"), "dg": map[string]any{"id": "2525"}} + got, err := formRestArgs("/arrays/#id/diskgroups/#dg.id/quotas/", data) + if err != nil { + t.Fatal(err) + } + if want := []string{"arrays", "554", "diskgroups", "2525", "quotas"}; !reflect.DeepEqual(got, want) { + t.Errorf("got %v, want %v", got, want) + } + if _, err := formRestArgs("/arrays/#missing", data); err == nil { + t.Error("a missing reference must fail") + } +} + +func TestCheckOutputCondition(t *testing.T) { + d := map[string]any{"os": "linux"} + if _, err := checkOutputCondition(map[string]any{"Condition": "#os == linux"}, d); err == nil { + t.Error("a condition on a non-dict output must fail") + } + ok, err := checkOutputCondition(map[string]any{"Condition": "#os == linux", "Format": "dict"}, d) + if err != nil || !ok { + t.Errorf("got %v %v", ok, err) + } + ok, err = checkOutputCondition(map[string]any{}, d) + if err != nil || !ok { + t.Errorf("no condition: got %v %v", ok, err) + } +} + +func TestInternalForms(t *testing.T) { + for id := int64(-1); id >= -10; id-- { + f, ok := internalFormByID(id) + if !ok { + t.Errorf("internal form %d missing", id) + continue + } + if f.Name == "" || len(defMaps(f.Definition, "Outputs")) == 0 && id > -9 { + t.Errorf("internal form %d: incomplete %+v", id, f) + } + } + if _, ok := internalFormByID(-11); ok { + t.Error("internal form -11 must not exist") + } +} diff --git a/server/handlers/forms_git.go b/server/handlers/forms_git.go new file mode 100644 index 00000000..13b1ea44 --- /dev/null +++ b/server/handlers/forms_git.go @@ -0,0 +1,149 @@ +package serverhandlers + +import ( + "context" + "log/slog" + "net/http" + "strconv" + + "github.com/labstack/echo/v4" + "github.com/spf13/viper" + + "github.com/opensvc/oc3/server" + "github.com/opensvc/oc3/util/echolog" + "github.com/opensvc/oc3/util/git" + "github.com/opensvc/oc3/util/logkey" +) + +// formTrack is the git history of the form definitions: one repository per +// form, holding its yaml in a file named "forms", as the historical collector +// lays them out. +func formTrack() git.Track { + return git.Track{Dir: viper.GetString("server.directories.forms"), File: "forms"} +} + +// formCommit records a new form definition in its history. As the historical +// collector, a failed commit does not fail the change of the form: it is logged. +func (a *Api) formCommit(log *slog.Logger, formID int64, content string, caller formCaller) { + if err := formTrack().Commit(strconv.FormatInt(formID, 10), content, caller.author()); err != nil { + log.Error("cannot record the form revision", "form_id", formID, logkey.Error, err) + } +} + +// formRevisionsAllowed tells whether the caller may read the history of a form: +// the historical handlers answer an empty list rather than an error otherwise. +func (a *Api) formRevisionsAllowed(ctx context.Context, c echo.Context, log *slog.Logger, formID int64) (bool, error) { + ok, err := a.ODB.FormVisible(ctx, formID, UserGroupsFromContext(c), IsManager(c)) + if err != nil { + return false, httpInternal(log, "cannot check form publication", err) + } + return ok, nil +} + +// GetFormRevisions handles GET /forms/{form_id}/revisions. +func (a *Api) GetFormRevisions(c echo.Context, formId int) error { + log := echolog.GetLogHandler(c, "GetFormRevisions") + ctx := c.Request().Context() + allowed, err := a.formRevisionsAllowed(ctx, c, log, int64(formId)) + if err != nil { + return httpProblem(c, err) + } + if !allowed { + return c.JSON(http.StatusOK, []any{}) + } + revisions, err := formTrack().Timeline(strconv.Itoa(formId)) + if err != nil { + return httpProblem(c, httpInternal(log, "cannot read the form history", err)) + } + return c.JSON(http.StatusOK, map[string]any{"data": revisions}) +} + +// GetFormRevision handles GET /forms/{form_id}/revisions/{cid}. +func (a *Api) GetFormRevision(c echo.Context, formId int, cid string) error { + log := echolog.GetLogHandler(c, "GetFormRevision") + ctx := c.Request().Context() + if !git.ValidRev(cid) { + return JSONProblemf(c, http.StatusBadRequest, "invalid revision %q", cid) + } + allowed, err := a.formRevisionsAllowed(ctx, c, log, int64(formId)) + if err != nil { + return httpProblem(c, err) + } + if !allowed { + return c.JSON(http.StatusOK, []any{}) + } + blob, err := formTrack().At(strconv.Itoa(formId), cid) + if err != nil { + return httpProblem(c, httpErrorf(http.StatusNotFound, "revision %s not found", cid)) + } + if blob == nil { + return c.JSON(http.StatusOK, map[string]any{"data": ""}) + } + return c.JSON(http.StatusOK, map[string]any{"data": blob}) +} + +// GetFormDiff handles GET /forms/{form_id}/diff/{cid}: the change of a revision, +// or its differences with another. +func (a *Api) GetFormDiff(c echo.Context, formId int, cid string, params server.GetFormDiffParams) error { + log := echolog.GetLogHandler(c, "GetFormDiff") + ctx := c.Request().Context() + if !git.ValidRev(cid) || (params.Other != nil && *params.Other != "" && !git.ValidRev(*params.Other)) { + return JSONProblemf(c, http.StatusBadRequest, "invalid revision") + } + allowed, err := a.formRevisionsAllowed(ctx, c, log, int64(formId)) + if err != nil { + return httpProblem(c, err) + } + if !allowed { + return c.JSON(http.StatusOK, []any{}) + } + var out string + if params.Other != nil && *params.Other != "" { + out, err = formTrack().Diff(strconv.Itoa(formId), cid, *params.Other) + } else { + out, err = formTrack().Show(strconv.Itoa(formId), cid) + } + if err != nil { + return httpProblem(c, httpErrorf(http.StatusNotFound, "revision %s not found", cid)) + } + return c.JSON(http.StatusOK, map[string]any{"data": out}) +} + +// PostFormRollback handles POST /forms/{form_id}/rollback/{cid}: restore the +// definition of a revision, recorded as a new revision, and store it as the +// form yaml. +func (a *Api) PostFormRollback(c echo.Context, formId int, cid string) error { + log := echolog.GetLogHandler(c, "PostFormRollback") + ctx, cancel := context.WithTimeout(c.Request().Context(), a.SyncTimeout) + defer cancel() + if !git.ValidRev(cid) { + return JSONProblemf(c, http.StatusBadRequest, "invalid revision %q", cid) + } + if err := requireFormsManager(c); err != nil { + return httpProblem(c, err) + } + formID := int64(formId) + if err := a.requireFormResponsible(c, log, ctx, formID); err != nil { + return httpProblem(c, err) + } + caller, err := a.formCaller(ctx, c) + if err != nil { + return httpProblem(c, httpInternal(log, "cannot read the caller", err)) + } + track := formTrack() + id := strconv.Itoa(formId) + if err := track.Rollback(id, cid, caller.author()); err != nil { + log.Error("cannot roll the form back", "form_id", formId, "cid", cid, logkey.Error, err) + return httpProblem(c, httpErrorf(http.StatusNotFound, "cannot roll form %d back to %s", formId, cid)) + } + content, err := track.Read(id) + if err != nil { + return httpProblem(c, httpInternal(log, "cannot read the restored form", err)) + } + if err := a.ODB.UpdateForm(ctx, formID, map[string]any{"form_yaml": content}); err != nil { + return httpProblem(c, httpInternal(log, "cannot store the restored form", err)) + } + a.formNotify(ctx, log) + // The historical handler returns nothing. + return c.JSON(http.StatusOK, nil) +} diff --git a/server/handlers/forms_internal.json b/server/handlers/forms_internal.json new file mode 100644 index 00000000..c00f90cf --- /dev/null +++ b/server/handlers/forms_internal.json @@ -0,0 +1,686 @@ +[ + { + "id": -1, + "form_name": "internal_add_contextual_thresholds", + "form_folder": "/internal", + "form_type": "generic", + "form_definition": { + "Vertical": true, + "Outputs": [ + { + "Type": "json", + "Format": "dict", + "Dest": "rest", + "Function": "/checks/contextual_settings", + "Handler": "POST" + } + ], + "Inputs": [ + { + "Id": "chk_type", + "Label": "Type", + "LabelCss": "check16", + "Type": "string", + "Mandatory": true, + "Function": "/checks/live", + "Args": [ + "props = chk_type", + "groupby = chk_type", + "orderby = chk_type", + "meta = 0", + "limit = 0" + ], + "DisableAutoDefault": true + }, + { + "Id": "chk_instance", + "Label": "Instance regex", + "LabelCss": "check16", + "Type": "string", + "Mandatory": true + }, + { + "Id": "chk_low", + "Label": "Low threshold", + "LabelCss": "fa-step-backward", + "Type": "integer", + "Constraint": "match [0-9]*" + }, + { + "Id": "chk_high", + "Label": "High threshold", + "LabelCss": "fa-step-forward", + "Type": "integer", + "Constraint": "match [0-9]*" + }, + { + "Id": "fset_id", + "Label": "Filterset", + "LabelCss": "filter16", + "Type": "string", + "Mandatory": true, + "Function": "/filtersets", + "Args": [ + "props = id,fset_name", + "orderby = fset_name", + "meta = 0", + "limit = 0" + ], + "Value": "#id", + "Format": "#fset_name", + "DisableAutoDefault": true + } + ] + } + }, + { + "id": -2, + "form_name": "internal_add_dns_record", + "form_folder": "/internal", + "form_type": "generic", + "form_definition": { + "Outputs": [ + { + "Dest": "rest", + "Function": "/dns/records", + "Handler": "POST", + "Type": "json", + "Format": "dict" + } + ], + "Vertical": true, + "Css": "dns48", + "Inputs": [ + { + "Mandatory": true, + "DisplayModeLabel": "name", + "LabelCss": "dns16", + "Label": "Name", + "Type": "string", + "Id": "name" + }, + { + "Function": "/dns/domains", + "Mandatory": true, + "Format": "#name", + "Args": [ + "props = id,name", + "limit = 0", + "meta = 0", + "orderby = name" + ], + "Value": "#id", + "DisplayModeLabel": "zone", + "LabelCss": "dns16", + "Label": "Domain", + "Type": "string", + "Id": "domain_id" + }, + { + "Default": 120, + "Label": "TTL", + "DisplayModeLabel": "ttl", + "LabelCss": "dns16", + "Type": "integer", + "Id": "ttl" + }, + { + "Default": 0, + "Label": "Priority", + "DisplayModeLabel": "prio", + "LabelCss": "dns16", + "Type": "integer", + "Id": "prio" + }, + { + "Mandatory": true, + "Default": "A", + "Label": "Type", + "Candidates": [ + "A", + "AAAA", + "A6", + "CNAME", + "DNAME", + "DNSKEY", + "DS", + "HINFO", + "ISDN", + "KEY", + "LOC", + "MX", + "NAPTR", + "NS", + "NSEC", + "PTR", + "SOA", + "SRV", + "TXT" + ], + "LabelCss": "dns16", + "DisplayModeLabel": "type", + "Type": "string", + "Id": "type" + }, + { + "Function": "/networks", + "Mandatory": false, + "Format": "#name (#network/#netmask)", + "Args": [ + "props = id,name,network,netmask", + "limit = 0", + "meta = 0", + "orderby = name" + ], + "Value": "#id", + "DisplayModeLabel": "network", + "LabelCss": "net16", + "Label": "Network", + "Type": "string", + "Id": "network", + "Condition": "#type == A" + }, + { + "Label": "Content", + "Key": "content", + "LabelCss": "dns16", + "DisplayModeLabel": "content", + "Type": "string", + "Id": "content_not_a", + "Condition": "#type != A" + }, + { + "Function": "/networks/#network/ips", + "Format": "#ip (t:#type n:#nodename r:#record_name)", + "Args": [ + "props = ip,type,nodename,record_name" + ], + "Value": "#ip", + "DisplayModeLabel": "content", + "Key": "content", + "LabelCss": "dns16", + "Label": "Content", + "Type": "string", + "Id": "content_a", + "Condition": "#type == A" + } + ] + } + }, + { + "id": -3, + "form_name": "internal_add_network_segment", + "form_folder": "/internal", + "form_type": "generic", + "form_definition": { + "Outputs": [ + { + "Dest": "rest", + "Function": "/networks/#net_id/segments", + "Handler": "POST", + "Type": "json", + "Format": "dict" + } + ], + "Css": "net16 fa-2x", + "Inputs": [ + { + "Mandatory": true, + "Default": "static", + "StrictCandidates": true, + "DisplayModeLabel": "type", + "Candidates": [ + "static", + "dynamic" + ], + "LabelCss": "net16", + "Label": "Type", + "Id": "seg_type" + }, + { + "Function": "/networks", + "Mandatory": true, + "Format": "#name #network/#netmask", + "Args": [ + "props = id,name,network,netmask", + "limit = 0", + "meta = 0", + "orderby = network" + ], + "Value": "#id", + "DisplayModeLabel": "network", + "LabelCss": "net16", + "Label": "Network", + "Type": "integer", + "Id": "net_id" + }, + { + "Label": "Begin", + "DisplayModeLabel": "begin", + "Type": "string", + "Id": "seg_begin", + "LabelCss": "net16" + }, + { + "Label": "End", + "DisplayModeLabel": "end", + "Type": "string", + "Id": "seg_end", + "LabelCss": "net16" + } + ] + } + }, + { + "id": -4, + "form_name": "internal_add_quota", + "form_folder": "/internal", + "form_type": "generic", + "form_definition": { + "Outputs": [ + { + "Function": "/arrays/#array_id/diskgroups/#dg_id/quotas", + "Format": "dict", + "Keys": [ + "app_id", + "quota" + ], + "Dest": "rest", + "Handler": "POST", + "Type": "json" + } + ], + "Css": "disk48", + "Inputs": [ + { + "Function": "/arrays", + "Mandatory": true, + "DisableAutoDefault": true, + "Format": "#array_name", + "Args": [ + "props = array_name,id", + "limit = 0", + "meta = 0", + "orderby = array_name", + "filters = array_model !vdisk%" + ], + "Value": "#id", + "DisplayModeLabel": "array", + "LabelCss": "hd16", + "Label": "Array", + "Type": "string", + "Id": "array_id" + }, + { + "Function": "/arrays/#array_id/diskgroups", + "Mandatory": true, + "Format": "#dg_name", + "Args": [ + "props = dg_name,id", + "limit = 0", + "meta = 0", + "orderby = dg_name" + ], + "Value": "#id", + "DisplayModeLabel": "diskgroup", + "LabelCss": "hd16", + "Label": "Diskgroup", + "Type": "string", + "Id": "dg_id", + "Condition": "#array_id != 0" + }, + { + "Function": "/apps", + "DisableAutoDefault": true, + "Mandatory": true, + "Format": "#app", + "Args": [ + "props = id,app", + "limit = 0", + "meta = 0", + "orderby = app" + ], + "Value": "#id", + "DisplayModeLabel": "app", + "LabelCss": "svc", + "Label": "App", + "Type": "string", + "Id": "app_id" + }, + { + "Mandatory": true, + "DisplayModeLabel": "quota", + "LabelCss": "hd16", + "Label": "Quota", + "Type": "integer", + "Id": "quota", + "Unit": "mb" + } + ] + } + }, + { + "id": -5, + "form_name": "internal_add_default_thresholds", + "form_folder": "/internal", + "form_type": "generic", + "form_definition": { + "Vertical": true, + "Outputs": [ + { + "Type": "json", + "Format": "dict", + "Dest": "rest", + "Function": "/checks/defaults", + "Handler": "POST" + } + ], + "Inputs": [ + { + "Id": "chk_type", + "Label": "Type", + "LabelCss": "check16", + "Type": "string", + "Mandatory": true, + "Function": "/checks/live", + "Args": [ + "props = chk_type", + "groupby = chk_type", + "orderby = chk_type", + "meta = 0", + "limit = 0" + ], + "DisableAutoDefault": true + }, + { + "Id": "chk_inst", + "Label": "Instance regex", + "LabelCss": "check16", + "Type": "string", + "Mandatory": true + }, + { + "Id": "chk_prio", + "Label": "Priority", + "LabelCss": "fa-sort", + "Type": "integer", + "Constraint": "match [0-9]*" + }, + { + "Id": "chk_low", + "Label": "Low threshold", + "LabelCss": "fa-step-backward", + "Type": "integer", + "Constraint": "match [0-9]*" + }, + { + "Id": "chk_high", + "Label": "High threshold", + "LabelCss": "fa-step-forward", + "Type": "integer", + "Constraint": "match [0-9]*" + } + ] + } + }, + { + "id": -6, + "form_name": "internal_add_user", + "form_folder": "/internal", + "form_type": "generic", + "form_definition": { + "Vertical": true, + "Outputs": [ + { + "Type": "json", + "Format": "dict", + "Dest": "rest", + "LogRequestData": false, + "Function": "/users", + "Handler": "POST" + } + ], + "Inputs": [ + { + "Id": "email", + "Label": "Email", + "LabelCss": "fa-mail", + "Type": "string", + "Mandatory": true, + "Constraint": "match ^([\\w\\!\\#$\\%\\&'\\*\\+\\-\\/\\=\\?\\^\\`{\\|\\}\\~]+\\.)*[\\w\\!\\#$\\%\\&'\\*\\+\\-\\/\\=\\?\\^\\`{\\|\\}\\~]+@((((([a-z0-9]{1}[a-z0-9\\-]{0,62}[a-z0-9]{1})|[a-z])\\.)+[a-z]{2,6})|(\\d{1,3}\\.){3}\\d{1,3}(\\:\\d{1,5})?)$" + }, + { + "Id": "username", + "Label": "Username", + "LabelCss": "guy16", + "Type": "string", + "Mandatory": false, + "Help": "Needed for LDAP login" + }, + { + "Id": "first_name", + "Label": "First Name", + "LabelCss": "guy16", + "Type": "string", + "Mandatory": true + }, + { + "Id": "last_name", + "Label": "Last Name", + "LabelCss": "guy16", + "Type": "string", + "Mandatory": true + }, + { + "Id": "password", + "Label": "Password", + "LabelCss": "key", + "Type": "password", + "Mandatory": true, + "Constraint": "match ^......*" + } + ] + } + }, + { + "id": -7, + "form_name": "internal_notification_period", + "form_folder": "/internal", + "form_type": "generic", + "form_definition": { + "Vertical": false, + "Outputs": [ + { + "Type": "json", + "Format": "dict" + } + ], + "Inputs": [ + { + "Id": "period", + "Label": "Period", + "LabelCss": "fa-bell", + "Candidates": [ + { + "Value": "always", + "Label": "Always" + }, + { + "Value": "never", + "Label": "Never" + }, + { + "Value": "custom", + "Label": "Custom" + } + ], + "Default": "always" + }, + { + "Id": "begin", + "Label": "Begin", + "LabelCss": "fa-clock", + "Type": "time", + "Default": "08:00", + "Condition": "#period == custom" + }, + { + "Id": "end", + "Label": "End", + "LabelCss": "fa-clock", + "Type": "time", + "Default": "18:00", + "Condition": "#period == custom" + } + ] + } + }, + { + "id": -8, + "form_name": "internal_notification_periods", + "form_folder": "/internal", + "form_type": "generic", + "form_definition": { + "Vertical": false, + "Outputs": [ + { + "Type": "json", + "Format": "dict" + } + ], + "Inputs": [ + { + "Id": "mon", + "Label": "Monday", + "LabelCss": "fa-calendar", + "Type": "form", + "Form": "internal_notification_period" + }, + { + "Id": "tue", + "Label": "Tuesday", + "LabelCss": "fa-calendar", + "Type": "form", + "Form": "internal_notification_period" + }, + { + "Id": "wed", + "Label": "Wednesday", + "LabelCss": "fa-calendar", + "Type": "form", + "Form": "internal_notification_period" + }, + { + "Id": "thu", + "Label": "Thursday", + "LabelCss": "fa-calendar", + "Type": "form", + "Form": "internal_notification_period" + }, + { + "Id": "fri", + "Label": "Friday", + "LabelCss": "fa-calendar", + "Type": "form", + "Form": "internal_notification_period" + }, + { + "Id": "sat", + "Label": "Saturday", + "LabelCss": "fa-calendar", + "Type": "form", + "Form": "internal_notification_period" + }, + { + "Id": "sun", + "Label": "Sunday", + "LabelCss": "fa-calendar", + "Type": "form", + "Form": "internal_notification_period" + } + ] + } + }, + { + "id": -9, + "form_name": "generic_list", + "form_folder": "/internal", + "form_type": "generic", + "form_definition": { + "Outputs": [ + { + "Type": "json", + "Format": "list" + } + ], + "Inputs": [ + { + "Id": "entry", + "Label": "", + "LabelCss": "fa-chevron-circle-right" + } + ] + } + }, + { + "id": -10, + "form_name": "generic_check", + "form_folder": "/internal", + "form_type": "generic", + "form_definition": { + "Outputs": [ + { + "Type": "json", + "Format": "dict" + } + ], + "Inputs": [ + { + "Help": "The base severity the alerts are created with. The collector gives a +1 severity bonus for production nodes and services. The checker can also give bonus.", + "LabelCss": "fa-exclamation-triangle", + "Default": 1, + "Label": "Base severity", + "Type": "integer", + "Candidates": [ + { + "Value": 0, + "Label": "Notice" + }, + { + "Value": 1, + "Label": "Warning" + }, + { + "Value": 2, + "Label": "Error" + }, + { + "Value": 3, + "Label": "Critical" + } + ], + "Id": "base_severity", + "DisplayModeLabel": "base severity" + }, + { + "Help": "The polling interval in seconds", + "LabelCss": "fa-clock", + "Default": 30, + "Label": "Interval", + "Type": "integer", + "Id": "interval", + "DisplayModeLabel": "interval" + }, + { + "Help": "The name of each pollers that should handle this check", + "Form": "generic_list", + "Label": "Pollers", + "LabelCss": "fa-rss", + "DisplayModeLabel": "pollers", + "Type": "form", + "Id": "pollers" + } + ] + } + } +] \ No newline at end of file diff --git a/server/handlers/forms_outputs.go b/server/handlers/forms_outputs.go new file mode 100644 index 00000000..5d6447b8 --- /dev/null +++ b/server/handlers/forms_outputs.go @@ -0,0 +1,663 @@ +package serverhandlers + +import ( + "bufio" + "bytes" + "context" + "encoding/json" + "errors" + "fmt" + "html" + "io" + "net/http" + "net/smtp" + "os" + "os/exec" + "strings" + "sync" + "time" + + "github.com/spf13/viper" + + "github.com/opensvc/oc3/cdb" +) + +// formattedData returns the data an output works on: the submitted data, or +// its JSON string form for a json-typed output, as get_form_formatted_data(). +func (s *formSubmission) formattedData(output map[string]any) (any, error) { + if s.data == nil { + return nil, errors.New("no form data") + } + if defString(output, "Type") == "json" { + b, err := json.Marshal(s.data) + if err != nil { + return nil, err + } + return string(b), nil + } + return s.data, nil +} + +// outputDB inserts the data in a table of the collector database, keeping only +// the keys that are columns of the table, as output_db() does. +func (s *formSubmission) outputDB(ctx context.Context, output map[string]any) error { + outputID := defString(output, "Id") + data, ok := s.data.(map[string]any) + if !ok { + return errors.New("a db output expects the form data as an object") + } + table := defString(output, "Table") + if table == "" { + s.formLog(ctx, outputID, 1, "form.submit", "Table must be set in db type Output", nil) + return nil + } + cols, err := s.a.ODB.TableColumns(ctx, table) + if err != nil { + return err + } + if len(cols) == 0 { + s.formLog(ctx, outputID, 1, "form.submit", "Table %(t)s not found", map[string]any{"t": table}) + return nil + } + row := map[string]any{} + for _, col := range cols { + if v, ok := data[col]; ok { + if m, isMap := v.(map[string]any); isMap { + b, _ := json.Marshal(m) + v = string(b) + } else if l, isList := v.([]any); isList { + b, _ := json.Marshal(l) + v = string(b) + } else if n, isNumber := v.(json.Number); isNumber { + v = n.String() + } + row[col] = v + } + } + if err := s.a.ODB.InsertRow(ctx, table, row); err != nil { + s.formLog(ctx, outputID, 1, "form.submit", "Data insertion in database table error: %(err)s", map[string]any{"err": err.Error()}) + return nil + } + s.formLog(ctx, outputID, 0, "form.submit", "Data inserted in database table", nil) + return nil +} + +// outputScript runs a script of the collector host, as output_script() does: +// the data, the output id and the results structure are its arguments, each +// line it writes is logged as it comes, stdout as info and stderr as error, and +// its exit code adds to the return code. +func (s *formSubmission) outputScript(ctx context.Context, output map[string]any) error { + path := defString(output, "Path") + outputID := defString(output, "Id") + if outputID == "" { + outputID = path + } + if path == "" { + s.formLog(ctx, outputID, 1, "form.submit", "Path must be set in script type Output", nil) + s.addReturnCode(1) + return nil + } + if _, err := os.Stat(path); err != nil { + s.formLog(ctx, outputID, 1, "form.submit", "Script %(path)s does not exists", map[string]any{"path": path}) + s.addReturnCode(1) + return nil + } + data, err := s.formattedData(output) + if err != nil { + return err + } + arg, ok := data.(string) + if !ok { + b, _ := json.Marshal(data) + arg = string(b) + } + s.mu.Lock() + resultsJSON, _ := json.Marshal(s.results) + s.mu.Unlock() + + cmd := exec.CommandContext(ctx, path, arg, outputID, string(resultsJSON)) + stdout, err := cmd.StdoutPipe() + if err != nil { + return err + } + stderr, err := cmd.StderrPipe() + if err != nil { + return err + } + if err := cmd.Start(); err != nil { + s.formLog(ctx, outputID, 1, "form.submit", "Script %(path)s execution error: %(err)s", map[string]any{"path": path, "err": err.Error()}) + s.addReturnCode(1) + return nil + } + var wg sync.WaitGroup + stream := func(r io.Reader, ret int) { + defer wg.Done() + reader := bufio.NewReader(r) + for { + line, err := reader.ReadString('\n') + if line != "" { + s.formLog(ctx, outputID, ret, "form.submit", line, nil) + s.save(ctx, true) + } + if err != nil { + return + } + } + } + wg.Add(2) + go stream(stdout, 0) + go stream(stderr, 1) + wg.Wait() + code := 0 + if err := cmd.Wait(); err != nil { + var exitErr *exec.ExitError + if !errors.As(err, &exitErr) { + s.formLog(ctx, outputID, 1, "form.submit", "Script %(path)s execution error: %(err)s", map[string]any{"path": path, "err": err.Error()}) + s.addReturnCode(1) + return nil + } + code = exitErr.ExitCode() + } + s.addReturnCode(code) + if code != 0 { + s.formLog(ctx, outputID, 1, "form.submit", "Script returned error code %(ret)s", map[string]any{"ret": fmt.Sprint(code)}) + } + s.save(ctx, false) + return nil +} + +// mangle runs the mangler of a rest output, a javascript function of the form +// definition, in the vm2 sandbox of nodejs, as the historical collector does: +// its printed JSON result replaces the data sent. +func (s *formSubmission) mangle(ctx context.Context, mangler string) (any, error) { + s.mu.Lock() + outputs, _ := json.Marshal(s.results["outputs"]) + s.mu.Unlock() + data, err := json.Marshal(s.data) + if err != nil { + return nil, err + } + script := fmt.Sprintf("var mangle = %s; var out = mangle(%s, %s, %d); console.log(JSON.stringify(out));", + mangler, data, outputs, s.resultsID) + f, err := os.CreateTemp("", "oc3-form-mangle-*.js") + if err != nil { + return nil, err + } + defer func() { _ = os.Remove(f.Name()) }() + if _, err := f.WriteString(script); err != nil { + _ = f.Close() + return nil, err + } + _ = f.Close() + nodejs := viper.GetString("server.forms.nodejs") + vm2 := viper.GetString("server.forms.vm2") + var stdout, stderr bytes.Buffer + cmd := exec.CommandContext(ctx, nodejs, vm2, f.Name()) + cmd.Stdout = &stdout + cmd.Stderr = &stderr + _ = cmd.Run() + var lines []string + for _, line := range strings.Split(stdout.String(), "\n") { + if line != "" && !strings.Contains(line, "[vm] ") { + lines = append(lines, line) + } + } + if len(lines) == 0 { + return nil, fmt.Errorf("mangling produced no data:\nmangler: %s\noutput: %s\nerror: %s", script, stdout.String(), stderr.String()) + } + var out any + decoder := json.NewDecoder(strings.NewReader(strings.Join(lines, "\n"))) + decoder.UseNumber() + if err := decoder.Decode(&out); err != nil { + return nil, err + } + return out, nil +} + +// outputRest calls the collector API as the submitter, or an external url, as +// output_rest() does: "#key" references of the url replaced, the data mangled +// or trimmed to Keys, and the answer's info, error and data kept in the +// results. +func (s *formSubmission) outputRest(ctx context.Context, output map[string]any) error { + action := defString(output, "Handler") + url := defString(output, "Function") + outputID := defString(output, "Id") + wait := 0 + if n, ok := output["WaitResult"].(json.Number); ok { + if i, err := n.Int64(); err == nil { + wait = int(i) + } + } else if f, ok := output["WaitResult"].(float64); ok { + wait = int(f) + } + + s.formLog(ctx, outputID, 0, "form.submit", "rest %(action)s %(url)s", map[string]any{"action": action, "url": url}) + s.save(ctx, false) + + if url == "" { + return errors.New("Function must be defined in a rest output") + } + switch action { + case http.MethodGet, http.MethodPost, http.MethodDelete, http.MethodPut: + default: + return errors.New("Handler must be set to either GET, POST, DELETE or PUT in a rest output") + } + args, err := formRestArgs(url, s.data) + if err != nil { + return fmt.Errorf("%s", err) + } + if len(args) == 0 { + return errors.New("Function must be defined in a rest output") + } + + vars := s.data + if mangler := defString(output, "Mangle"); mangler != "" { + if vars, err = s.mangle(ctx, mangler); err != nil { + return err + } + } + if _, isString := vars.(string); isString { + return errors.New("The mangler must not return a str") + } + if keys := defList(output, "Keys"); len(keys) > 0 { + if m, ok := vars.(map[string]any); ok { + retained := map[string]any{} + for _, k := range keys { + if ks, ok := k.(string); ok { + if v, found := m[ks]; found { + retained[ks] = v + } + } + } + vars = retained + } + } + logRequest := true + if v, ok := output["LogRequestData"].(bool); ok { + logRequest = v + } + if logRequest { + s.mu.Lock() + ensureMap(s.results, "request_data")[outputID] = vars + s.mu.Unlock() + } + s.save(ctx, false) + + external := strings.HasPrefix(args[0], "http") + call := func() (*apiResponse, error) { + if external { + full := args[0] + "//" + strings.Join(args[1:], "/") + return s.callAPI(ctx, action, "", vars, full) + } + return s.callAPI(ctx, action, "/"+strings.Join(args, "/"), vars, "") + } + + var resp *apiResponse + if action == http.MethodGet && wait > 0 { + for ; wait > 0; wait-- { + if resp, err = call(); err != nil { + break + } + if m, ok := resp.body.(map[string]any); ok { + if list, ok := m["data"].([]any); ok && len(list) > 0 { + break + } + } + resp = nil + time.Sleep(time.Second) + } + if err == nil && resp == nil { + err = errors.New("Timed out waiting for a result") + } + } else { + resp, err = call() + } + if err == nil && !external && resp.status >= 300 { + err = errors.New(problemTextOf(resp)) + } + if err != nil { + s.formLog(ctx, outputID, 1, "form.submit", "error:\n%(result)s", map[string]any{"result": err.Error()}) + s.addReturnCode(1) + return nil + } + + // The call may have changed the results, through PUT /form_output_results. + s.reload(ctx) + s.restPostRun(output, outputID, resp.body) + return nil +} + +// restPostRun keeps the answer of a rest call in the results, as post_run() +// does: info lines logged, error lines logged with the return code raised, and +// data added to the output. +func (s *formSubmission) restPostRun(output map[string]any, outputID string, body any) { + jd, ok := body.(map[string]any) + if !ok { + return + } + switch info := jd["info"].(type) { + case []any: + for _, line := range info { + s.appendLog(outputID, 0, formValueText(line), nil) + } + case string: + if info != "" { + s.appendLog(outputID, 0, info, nil) + } + } + if errValue, ok := jd["error"]; ok && !isFalsy(errValue) { + s.addReturnCode(1) + switch e := errValue.(type) { + case []any: + for _, line := range e { + s.appendLog(outputID, 1, formValueText(line), nil) + } + case map[string]any: + for k, v := range e { + s.appendLog(outputID, 1, k+": "+formValueText(v), nil) + } + default: + s.appendLog(outputID, 1, formValueText(e), nil) + } + } + data, ok := jd["data"] + if !ok { + return + } + s.mu.Lock() + outputs := ensureMap(s.results, "outputs") + switch current := outputs[outputID].(type) { + case nil: + outputs[outputID] = data + case []any: + outputs[outputID] = append(current, data) + default: + outputs[outputID] = []any{current, data} + } + s.mu.Unlock() + + waited := false + switch w := output["WaitResult"].(type) { + case json.Number: + n, _ := w.Int64() + waited = n > 0 + case float64: + waited = w > 0 + } + if !waited { + return + } + entries, isList := data.([]any) + if !isList { + entries = []any{data} + } + for _, entry := range entries { + m, ok := entry.(map[string]any) + if !ok { + continue + } + if ret, ok := m["ret"]; ok && formValueText(ret) != "0" { + s.addReturnCode(1) + } + if stderr, ok := m["stderr"].(string); ok && stderr != "" { + s.appendLog(outputID, 1, stderr, nil) + } + } +} + +// outputMail mails the submitted data, as output_mail() does: to the output +// recipients, or to the given ones, a recipient given by name resolved to the +// user's email. The SMTP server is set by server.mail.server. +func (s *formSubmission) outputMail(ctx context.Context, output map[string]any, to []string, recordID int64) error { + outputID := defString(output, "Id") + if to == nil { + switch t := output["To"].(type) { + case string: + to = []string{t} + case []any: + for _, item := range t { + if str, ok := item.(string); ok { + to = append(to, str) + } + } + } + } + var recipients []string + for _, t := range to { + if strings.Contains(t, "@") { + recipients = append(recipients, t) + continue + } + email, found, err := s.a.ODB.UserEmailByName(ctx, t) + if err != nil { + return err + } + if found && email != "" { + recipients = append(recipients, email) + } + } + if len(recipients) == 0 { + s.formLog(ctx, outputID, 1, "form.submit", "No mail destination", nil) + return nil + } + if s.data == nil { + s.formLog(ctx, outputID, 1, "form.submit", "no form data", nil) + return nil + } + title := defString(s.definition, "Label") + if title == "" { + title = s.formName + } + dump, _ := json.MarshalIndent(s.data, "", " ") + next := "" + if recordID != 0 { + next = fmt.Sprintf("

Workflow step %d

", recordID) + } + body := fmt.Sprintf("

Form submitted on %s by %s

%s
%s", + time.Now().Format("2006-01-02 15:04"), html.EscapeString(s.caller.name), html.EscapeString(string(dump)), next) + if err := sendFormMail(recipients, title, body); err != nil { + s.formLog(ctx, outputID, 1, "form.submit", "Mail sending error: %(err)s", map[string]any{"err": err.Error()}) + return nil + } + s.formLog(ctx, outputID, 0, "form.submit", "Mail sent to %(to)s on form %(form_name)s submission.", + map[string]any{"to": strings.Join(recipients, ", "), "form_name": s.formName}) + return nil +} + +// sendFormMail sends an html mail through the configured SMTP server: +// server.mail.server (host:port), server.mail.sender and, optionally, +// server.mail.login as "user:password". +func sendFormMail(to []string, subject, body string) error { + server := viper.GetString("server.mail.server") + sender := viper.GetString("server.mail.sender") + if server == "" || sender == "" { + return errors.New("mail is not configured (server.mail.server, server.mail.sender)") + } + var auth smtp.Auth + if login := viper.GetString("server.mail.login"); login != "" { + user, password, _ := strings.Cut(login, ":") + host, _, _ := strings.Cut(server, ":") + auth = smtp.PlainAuth("", user, password, host) + } + msg := "From: " + sender + "\r\n" + + "To: " + strings.Join(to, ", ") + "\r\n" + + "Subject: " + strings.ReplaceAll(subject, "\n", " ") + "\r\n" + + "MIME-Version: 1.0\r\n" + + "Content-Type: text/html; charset=utf-8\r\n\r\n" + body + return smtp.SendMail(server, auth, sender, to, []byte(msg)) +} + +// outputWorkflow stores the submitted form as a workflow step, as +// output_workflow() does: a new workflow, or the next step of the workflow the +// submission continues (prev_wfid). The workflow stays pending while next forms +// are defined, and the assignee may be mailed. +func (s *formSubmission) outputWorkflow(ctx context.Context, output map[string]any) error { + outputID := defString(output, "Id") + if s.form == nil { + return errors.New("an internal form cannot store a workflow step") + } + data, err := s.formattedData(output) + if err != nil { + return err + } + formData, ok := data.(string) + if !ok { + b, _ := json.Marshal(data) + formData = string(b) + } + formMD5, err := s.a.ODB.InsertFormRevisionMD5(ctx, s.form) + if err != nil { + return err + } + + stepDefs := output + if scripts, ok := output["Scripts"].(map[string]any); ok { + key := "Success" + if s.returnCode() != 0 { + key = "Error" + } + stepDefs, _ = scripts[key].(map[string]any) + } + var nextForms []any + assignee := "" + if stepDefs != nil { + nextForms = defList(stepDefs, "NextForms") + assignee = defString(stepDefs, "NextAssignee") + } + var nextID *int64 + status := "pending" + if len(nextForms) == 0 { + zero := int64(0) + nextID = &zero + status = "closed" + } + + now := time.Now().Format(time.DateTime) + primaryGroup := "" + if s.caller.id > 0 { + if role, found, err := s.a.ODB.UserPrimaryOrgGroupRole(ctx, s.caller.id); err != nil { + return err + } else if found { + primaryGroup = role + } + } + + var recordID, workflowID int64 + if s.prevWfid != nil { + prev, err := s.a.ODB.StoredFormLinkByID(ctx, *s.prevWfid) + if err != nil { + return err + } + if prev == nil { + return fmt.Errorf("workflow step %d not found", *s.prevWfid) + } + if prev.NextID != nil { + s.formLog(ctx, outputID, 0, "form.store", "This step is already completed (id=%(id)d)", map[string]any{"id": prev.ID}) + return nil + } + if assignee == "" { + assignee = primaryGroup + } + if assignee == "" { + assignee = prev.Submitter + } + if assignee == "" { + assignee = s.caller.name + } + + // Walk back to the head of the workflow. + headID := *s.prevWfid + var head *cdb.StoredFormLink + iter := 0 + for iter < 100 { + iter++ + row, err := s.a.ODB.StoredFormLinkByID(ctx, headID) + if err != nil { + return err + } + if row == nil { + break + } + if row.PrevID == nil { + head = row + break + } + headID = *row.PrevID + } + + if recordID, err = s.a.ODB.InsertStoredForm(ctx, cdb.StoredFormInsert{ + MD5: formMD5, Submitter: s.caller.name, Assignee: assignee, Date: now, + PrevID: s.prevWfid, NextID: nextID, HeadID: &headID, Data: formData, ResultsID: s.resultsID, + }); err != nil { + return err + } + if err := s.a.ODB.SetStoredFormNext(ctx, *s.prevWfid, recordID); err != nil { + return err + } + if nextID == nil { + s.formLog(ctx, outputID, 0, "form.store", "Workflow %(head_id)d step %(form_name)s added with id %(id)d", + map[string]any{"form_name": s.formName, "head_id": headID, "id": recordID}) + } else { + s.formLog(ctx, outputID, 0, "form.store", "Workflow %(head_id)d closed on last step %(form_name)s with id %(id)d", + map[string]any{"form_name": s.formName, "head_id": headID, "id": recordID}) + } + w := cdb.WorkflowInsert{ + Status: status, MD5: formMD5, Steps: iter + 1, LastAssignee: assignee, LastUpdate: now, + LastFormID: recordID, LastFormName: s.formName, HeadID: headID, + } + id, found, err := s.a.ODB.WorkflowIDByHead(ctx, headID) + if err != nil { + return err + } + if found { + workflowID = id + if err := s.a.ODB.UpdateWorkflowStep(ctx, headID, w); err != nil { + return err + } + } else { + // Should not happen: the workflow is recreated from its head. + w.Creator, w.CreateDate = s.caller.name, now + if head != nil { + w.Creator, w.CreateDate = head.Submitter, head.SubmitDate + } + if workflowID, err = s.a.ODB.InsertWorkflow(ctx, w); err != nil { + return err + } + } + } else { + if assignee == "" { + assignee = primaryGroup + } + if assignee == "" { + assignee = s.caller.name + } + if recordID, err = s.a.ODB.InsertStoredForm(ctx, cdb.StoredFormInsert{ + MD5: formMD5, Submitter: s.caller.name, Assignee: assignee, Date: now, + Data: formData, ResultsID: s.resultsID, + }); err != nil { + return err + } + if err := s.a.ODB.SetStoredFormHead(ctx, recordID); err != nil { + return err + } + s.formLog(ctx, outputID, 0, "form.store", "New workflow %(form_name)s created with id %(id)d", + map[string]any{"form_name": s.formName, "id": recordID}) + if workflowID, err = s.a.ODB.InsertWorkflow(ctx, cdb.WorkflowInsert{ + Status: status, MD5: formMD5, Steps: 1, LastAssignee: assignee, LastUpdate: now, + LastFormID: recordID, LastFormName: s.formName, HeadID: recordID, + Creator: s.caller.name, CreateDate: now, + }); err != nil { + return err + } + } + + s.mu.Lock() + ensureMap(s.results, "outputs")[outputID] = map[string]any{"workflow_id": workflowID, "head_form_id": recordID} + s.mu.Unlock() + s.save(ctx, false) + + if nextID == nil && defBool(output, "Mail") { + return s.outputMail(ctx, output, []string{assignee}, recordID) + } + return nil +} diff --git a/server/handlers/forms_store.go b/server/handlers/forms_store.go new file mode 100644 index 00000000..47f55543 --- /dev/null +++ b/server/handlers/forms_store.go @@ -0,0 +1,297 @@ +package serverhandlers + +import ( + "bytes" + "context" + "encoding/json" + "errors" + "log/slog" + "net/http" + "strconv" + + "github.com/labstack/echo/v4" + + "github.com/opensvc/oc3/cdb" + "github.com/opensvc/oc3/server" + "github.com/opensvc/oc3/util/echolog" +) + +// GetFormsRevisions handles GET /forms_revisions. +func (a *Api) GetFormsRevisions(c echo.Context, params server.GetFormsRevisionsParams) error { + return a.handleList(c, "GetFormsRevisions", "form_revision", listEndpointParams{ + props: params.Props, limit: params.Limit, offset: params.Offset, + meta: params.Meta, stats: params.Stats, orderby: params.Orderby, groupby: params.Groupby, + filter: params.Filter, virtual: formDefinitionProp, + }, func(ctx context.Context, p cdb.ListParams) ([]map[string]any, error) { + return a.ODB.GetFormsRevisions(ctx, nil, p) + }) +} + +// GetFormsRevision handles GET /forms_revisions/{revision_id}: by id or md5. +func (a *Api) GetFormsRevision(c echo.Context, revisionId string, params server.GetFormsRevisionParams) error { + return a.handleList(c, "GetFormsRevision", "form_revision", listEndpointParams{ + props: params.Props, limit: params.Limit, offset: params.Offset, + meta: params.Meta, stats: params.Stats, orderby: params.Orderby, groupby: params.Groupby, + filter: params.Filter, virtual: formDefinitionProp, + }, func(ctx context.Context, p cdb.ListParams) ([]map[string]any, error) { + return a.ODB.GetFormsRevisions(ctx, &revisionId, p) + }) +} + +// GetFormsStore handles GET /forms_store. +func (a *Api) GetFormsStore(c echo.Context, params server.GetFormsStoreParams) error { + return a.handleList(c, "GetFormsStore", "form_store", listEndpointParams{ + props: params.Props, limit: params.Limit, offset: params.Offset, + meta: params.Meta, stats: params.Stats, orderby: params.Orderby, groupby: params.Groupby, + filter: params.Filter, virtual: formDefinitionProp, + }, func(ctx context.Context, p cdb.ListParams) ([]map[string]any, error) { + return a.ODB.GetFormsStore(ctx, nil, p) + }) +} + +// GetFormStore handles GET /forms_store/{store_id}. +func (a *Api) GetFormStore(c echo.Context, storeId int, params server.GetFormStoreParams) error { + id := int64(storeId) + return a.handleList(c, "GetFormStore", "form_store", listEndpointParams{ + props: params.Props, limit: params.Limit, offset: params.Offset, + meta: params.Meta, stats: params.Stats, orderby: params.Orderby, groupby: params.Groupby, + filter: params.Filter, virtual: formDefinitionProp, + }, func(ctx context.Context, p cdb.ListParams) ([]map[string]any, error) { + return a.ODB.GetFormsStore(ctx, &id, p) + }) +} + +// defaultRows reads rows with the default props of a mapping, virtual props +// computed, for the handlers answering with records they assemble. +func (a *Api) defaultRows(ctx context.Context, mappingKey string, virtual map[string]virtualProp, fetch listFetcher) ([]map[string]any, error) { + mapping := propsMapping[mappingKey] + query, err := buildListQueryParameters(nil, nil, nil, nil, nil, nil, nil, mapping) + if err != nil { + return nil, err + } + fetchProps := fetchPropsFor(query.Props, virtual) + selectExprs, err := buildSelectClause(fetchProps, mapping) + if err != nil { + return nil, err + } + items, err := fetch(ctx, cdb.ListParams{ + IsManager: true, Props: fetchProps, SelectExprs: selectExprs, + TypeHints: buildTypeHints(fetchProps, mapping), + }) + if err != nil { + return nil, err + } + computeVirtualProps(items, query.Props, virtual) + return items, nil +} + +func (a *Api) storedForm(ctx context.Context, id int64) (map[string]any, error) { + rows, err := a.defaultRows(ctx, "form_store", formDefinitionProp, func(ctx context.Context, p cdb.ListParams) ([]map[string]any, error) { + return a.ODB.GetFormsStore(ctx, &id, p) + }) + if err != nil || len(rows) == 0 { + return nil, err + } + return rows[0], nil +} + +// asInt64 reads an id column of a row. +func asInt64(v any) (int64, bool) { + switch t := v.(type) { + case int64: + return t, true + case int: + return int64(t), true + case string: + n, err := strconv.ParseInt(t, 10, 64) + return n, err == nil + case []byte: + n, err := strconv.ParseInt(string(t), 10, 64) + return n, err == nil + } + return 0, false +} + +// workflowDump returns a workflow with its head and tail stored forms, as +// /workflows/{id}/dump does in the historical collector. +func (a *Api) workflowDump(ctx context.Context, workflowID int64) (map[string]any, error) { + rows, err := a.defaultRows(ctx, "workflow", nil, func(ctx context.Context, p cdb.ListParams) ([]map[string]any, error) { + return a.ODB.GetWorkflows(ctx, &workflowID, "", p) + }) + if err != nil || len(rows) == 0 { + return nil, err + } + wf := rows[0] + if headID, ok := asInt64(wf["form_head_id"]); ok { + if wf["head"], err = a.storedForm(ctx, headID); err != nil { + return nil, err + } + } + if lastID, ok := asInt64(wf["last_form_id"]); ok { + if wf["tail"], err = a.storedForm(ctx, lastID); err != nil { + return nil, err + } + } + return wf, nil +} + +// GetFormStoreDump handles GET /forms_store/{store_id}/dump: the stored form +// with its workflow, the workflow carrying its head and tail stored forms. +func (a *Api) GetFormStoreDump(c echo.Context, storeId int) error { + log := echolog.GetLogHandler(c, "GetFormStoreDump") + ctx := c.Request().Context() + stored, err := a.storedForm(ctx, int64(storeId)) + if err != nil { + return httpProblem(c, httpInternal(log, "cannot read the stored form", err)) + } + if stored == nil { + return JSONProblemf(c, http.StatusNotFound, "stored form %d not found", storeId) + } + if headID, ok := asInt64(stored["form_head_id"]); ok { + workflowID, found, err := a.ODB.WorkflowIDByHead(ctx, headID) + if err != nil { + return httpProblem(c, httpInternal(log, "cannot read the workflow", err)) + } + if found { + if stored["workflow"], err = a.workflowDump(ctx, workflowID); err != nil { + return httpProblem(c, httpInternal(log, "cannot read the workflow", err)) + } + } + } + return c.JSON(http.StatusOK, map[string]any{"data": []any{stored}}) +} + +// formResultsAccess describes the caller for the results access filter. +func formResultsAccess(c echo.Context) cdb.FormResultsAccess { + nodeID, _ := c.Get(XNodeID).(string) + return cdb.FormResultsAccess{IsManager: IsManager(c), UserID: authUserID(c), NodeID: nodeID} +} + +// GetFormOutputResults handles GET /form_output_results/{results_id}: the +// results structure as stored. +func (a *Api) GetFormOutputResults(c echo.Context, resultsId int) error { + log := echolog.GetLogHandler(c, "GetFormOutputResults") + results, err := a.readFormResults(c.Request().Context(), c, int64(resultsId)) + if err != nil { + return httpProblem(c, formResultsError(log, err)) + } + return c.JSON(http.StatusOK, results) +} + +// formResultsError keeps a refusal as it is and logs an internal failure. +func formResultsError(log *slog.Logger, err error) error { + var fe *httpError + if errors.As(err, &fe) { + return err + } + return httpInternal(log, "cannot read the results", err) +} + +// readFormResults reads a results structure the caller may see, 404 otherwise. +func (a *Api) readFormResults(ctx context.Context, c echo.Context, id int64) (map[string]any, error) { + s, found, err := a.ODB.FormOutputResults(ctx, id, formResultsAccess(c)) + if err != nil { + return nil, err + } + if !found { + return nil, httpErrorf(http.StatusNotFound, "results not found") + } + var results map[string]any + decoder := json.NewDecoder(bytes.NewReader([]byte(s))) + decoder.UseNumber() + if err := decoder.Decode(&results); err != nil { + return nil, httpErrorf(http.StatusInternalServerError, "unreadable results: %s", err) + } + return results, nil +} + +// PutFormOutputResults handles PUT /form_output_results/{results_id}: add a +// result and log lines to an output, as scripts run by a form report them. +func (a *Api) PutFormOutputResults(c echo.Context, resultsId int) error { + log := echolog.GetLogHandler(c, "PutFormOutputResults") + ctx, cancel := context.WithTimeout(c.Request().Context(), a.SyncTimeout) + defer cancel() + id := int64(resultsId) + results, err := a.readFormResults(ctx, c, id) + if err != nil { + return httpProblem(c, formResultsError(log, err)) + } + entries, isList, err := decodeEntries(c) + if err != nil { + return httpProblem(c, err) + } + if isList { + return JSONProblem(c, http.StatusBadRequest, "expecting an object") + } + body := entries[0] + outputID, _ := entryString(body, "output_id") + result, hasResult := body["result"] + logLines, hasLog := body["log"] + if (!hasResult || isEmpty(result)) && (!hasLog || isEmpty(logLines)) { + return c.JSON(http.StatusOK, results) + } + if hasResult && !isEmpty(result) { + outputs := ensureMap(results, "outputs") + list, _ := outputs[outputID].([]any) + outputs[outputID] = append(list, decodedJSON(result)) + } + if hasLog && !isEmpty(logLines) { + logs := ensureMap(results, "log") + list, _ := logs[outputID].([]any) + switch lines := decodedJSON(logLines).(type) { + case []any: + list = append(list, lines...) + default: + list = append(list, lines) + } + logs[outputID] = list + } + b, err := json.Marshal(results) + if err != nil { + return httpProblem(c, httpInternal(log, "cannot encode the results", err)) + } + if err := a.ODB.UpdateFormOutputResults(ctx, id, string(b)); err != nil { + return httpProblem(c, httpInternal(log, "cannot store the results", err)) + } + a.formNotify(ctx, log) + return c.JSON(http.StatusOK, results) +} + +func isEmpty(v any) bool { + switch t := v.(type) { + case nil: + return true + case string: + return t == "" + case []any: + return len(t) == 0 + case map[string]any: + return len(t) == 0 + } + return false +} + +// decodedJSON decodes a value posted as its JSON string form, as +// sjson.loads(result) does, and keeps any other value as it is. +func decodedJSON(v any) any { + s, ok := v.(string) + if !ok { + return v + } + var out any + decoder := json.NewDecoder(bytes.NewReader([]byte(s))) + decoder.UseNumber() + if err := decoder.Decode(&out); err != nil { + return s + } + return out +} + +func ensureMap(m map[string]any, key string) map[string]any { + sub, ok := m[key].(map[string]any) + if !ok { + sub = map[string]any{} + m[key] = sub + } + return sub +} diff --git a/server/handlers/forms_submit.go b/server/handlers/forms_submit.go new file mode 100644 index 00000000..c3f168ba --- /dev/null +++ b/server/handlers/forms_submit.go @@ -0,0 +1,529 @@ +package serverhandlers + +import ( + "bytes" + "context" + _ "embed" + "encoding/json" + "fmt" + "io" + "log/slog" + "net" + "net/http" + "net/url" + "strconv" + "strings" + "sync" + "time" + + "github.com/labstack/echo/v4" + "github.com/spf13/viper" + + "github.com/opensvc/oc3/cdb" + "github.com/opensvc/oc3/util/echolog" + "github.com/opensvc/oc3/util/logkey" +) + +// internalFormsJSON holds the forms the historical collector defines in code +// (lib_forms_internal.py), designated by a negative id. +// +//go:embed forms_internal.json +var internalFormsJSON []byte + +type internalForm struct { + ID int64 `json:"id"` + Name string `json:"form_name"` + Folder string `json:"form_folder"` + Type string `json:"form_type"` + Definition map[string]any `json:"form_definition"` +} + +var ( + internalFormsOnce sync.Once + internalForms map[int64]internalForm +) + +// internalFormByID returns an internal form, as get_internal_form() does. The +// definition is decoded on every call: the submission assigns output ids in it. +func internalFormByID(id int64) (internalForm, bool) { + internalFormsOnce.Do(func() { + var list []internalForm + if err := json.Unmarshal(internalFormsJSON, &list); err != nil { + panic(fmt.Sprintf("forms_internal.json: %s", err)) + } + internalForms = make(map[int64]internalForm, len(list)) + for _, f := range list { + internalForms[f.ID] = f + } + }) + f, ok := internalForms[id] + if !ok { + return f, false + } + b, _ := json.Marshal(f.Definition) + decoder := json.NewDecoder(bytes.NewReader(b)) + decoder.UseNumber() + var definition map[string]any + _ = decoder.Decode(&definition) + f.Definition = definition + return f, true +} + +// formSubmission is one PUT /forms/{form_id}: the form, the submitted data, the +// caller and the results structure, stored in form_output_results and updated +// as the outputs run. Outputs may run after the request has been answered, for +// an Async form: the submission carries all it needs. +type formSubmission struct { + a *Api + log *slog.Logger + formID int64 + formName string + form *cdb.Form // nil for an internal form + definition map[string]any + data any + prevWfid *int64 + caller formCaller + nodeID string + userEmail string + auth string // Authorization header, for the calls of rest outputs + + mu sync.Mutex + results map[string]any + resultsID int64 +} + +// PutForm handles PUT /forms/{form_id}: submit a form. +func (a *Api) PutForm(c echo.Context, formId int) error { + log := echolog.GetLogHandler(c, "PutForm") + ctx := c.Request().Context() + + entries, isList, err := decodeEntries(c) + if err != nil { + return httpProblem(c, err) + } + if isList { + return JSONProblem(c, http.StatusBadRequest, "expecting an object with the data and prev_wfid keys") + } + body := entries[0] + + s := &formSubmission{a: a, log: log, formID: int64(formId), auth: c.Request().Header.Get("Authorization")} + s.userEmail, _ = c.Get(XUserEmail).(string) + s.nodeID, _ = c.Get(XNodeID).(string) + if s.caller, err = a.formCaller(ctx, c); err != nil { + return httpProblem(c, httpInternal(log, "cannot read the caller", err)) + } + + // The data may come as its JSON string form, as a posted form variable. + s.data = body["data"] + if text, ok := s.data.(string); ok { + decoder := json.NewDecoder(strings.NewReader(text)) + decoder.UseNumber() + if err := decoder.Decode(&s.data); err != nil { + return JSONProblemf(c, http.StatusBadRequest, "unparsable form data: %s", text) + } + } + if prev, ok := entryString(body, "prev_wfid"); ok && prev != "" && prev != "None" { + id, err := strconv.ParseInt(prev, 10, 64) + if err != nil { + return JSONProblemf(c, http.StatusBadRequest, "invalid prev_wfid %q", prev) + } + s.prevWfid = &id + } + + if err := s.loadForm(ctx, c); err != nil { + return httpProblem(c, err) + } + + s.results = map[string]any{ + "form_id": s.formID, + "submitted_data": s.data, + "outputs_order": []any{}, + "request_data": map[string]any{}, + "outputs": map[string]any{}, + "log": map[string]any{}, + "returncode": 0, + "status": "QUEUED", + } + + if done, err := s.workflowStepDone(ctx); err != nil { + return httpProblem(c, httpInternal(log, "cannot read the workflow step", err)) + } else if done { + s.appendLog("", 1, "This step is already completed (id=%(id)d)", map[string]any{"id": *s.prevWfid}) + return c.JSON(http.StatusOK, s.results) + } + + if err := s.validate(ctx); err != nil { + return httpProblem(c, err) + } + + var userID *int64 + if s.caller.id > 0 { + userID = &s.caller.id + } + b, err := json.Marshal(s.results) + if err != nil { + return httpProblem(c, httpInternal(log, "cannot encode the results", err)) + } + if s.resultsID, err = a.ODB.InsertFormOutputResults(ctx, userID, s.nodeID, "", string(b)); err != nil { + return httpProblem(c, httpInternal(log, "cannot store the results", err)) + } + s.results["results_id"] = s.resultsID + log.Info("form submitted", "form_id", s.formID, "results_id", s.resultsID) + + if defBool(s.definition, "Async") { + // Answered at once; the outputs run on the server, the results record + // telling their progress, as the historical collector queued them. + response := s.snapshot() + go s.run(context.WithoutCancel(ctx)) + return c.JSON(http.StatusOK, response) + } + s.run(ctx) + return c.JSON(http.StatusOK, s.snapshot()) +} + +// loadForm finds the form: an internal one for a negative id, else a form of +// the database the caller may use: published to one of their groups, unless a +// manager. +func (s *formSubmission) loadForm(ctx context.Context, c echo.Context) error { + notFound := httpErrorf(http.StatusNotFound, "the requested form does not exist or you don't have permission to use it") + if s.formID < 0 { + f, ok := internalFormByID(s.formID) + if !ok { + return notFound + } + s.formName = f.Name + s.definition = f.Definition + return nil + } + visible, err := s.a.ODB.FormVisible(ctx, s.formID, UserGroupsFromContext(c), IsManager(c)) + if err != nil { + return httpInternal(s.log, "cannot check form publication", err) + } + if !visible { + return notFound + } + if s.form, err = s.a.ODB.FormByID(ctx, s.formID); err != nil { + return httpInternal(s.log, "cannot read the form", err) + } + if s.form == nil { + return notFound + } + s.formName = s.form.Name + definition, err := parseFormYaml(s.form.Yaml) + if err != nil { + return httpErrorf(http.StatusBadRequest, "invalid form definition: %s", err) + } + s.definition, _ = definition.(map[string]any) + if s.definition == nil { + s.definition = map[string]any{} + } + return nil +} + +// workflowStepDone tells whether the submission continues a workflow step that +// already has a next step, as workflow_continuation() does. +func (s *formSubmission) workflowStepDone(ctx context.Context) (bool, error) { + if s.formID < 0 || s.prevWfid == nil { + return false, nil + } + for _, output := range defMaps(s.definition, "Outputs") { + if defString(output, "Dest") != "workflow" { + continue + } + prev, err := s.a.ODB.StoredFormLinkByID(ctx, *s.prevWfid) + if err != nil { + return false, err + } + if prev != nil && prev.NextID != nil { + return true, nil + } + } + return false, nil +} + +// snapshot returns a copy of the results structure, safe to encode while the +// outputs keep running. +func (s *formSubmission) snapshot() map[string]any { + s.mu.Lock() + defer s.mu.Unlock() + b, _ := json.Marshal(s.results) + var out map[string]any + decoder := json.NewDecoder(bytes.NewReader(b)) + decoder.UseNumber() + _ = decoder.Decode(&out) + return out +} + +// appendLog adds a line to the log of an output, without writing the collector +// log: for the lines of rest answers, as the historical collector appends them +// directly. +func (s *formSubmission) appendLog(outputID string, ret int, format string, d map[string]any) { + s.mu.Lock() + defer s.mu.Unlock() + logs := ensureMap(s.results, "log") + list, _ := logs[outputID].([]any) + if d == nil { + d = map[string]any{} + } + logs[outputID] = append(list, []any{ret, format, d}) +} + +// formLog adds a line to the log of an output and to the collector log, as +// form_log() does. +func (s *formSubmission) formLog(ctx context.Context, outputID string, ret int, action, format string, d map[string]any) { + s.appendLog(outputID, ret, format, d) + level := "info" + if ret != 0 { + level = "error" + } + if d == nil { + d = map[string]any{} + } + if err := s.a.ODB.Log(ctx, cdb.LogEntry{Action: action, User: s.userEmail, Fmt: format, Dict: d, Level: level}); err != nil { + s.log.Error("cannot write audit log", logkey.Error, err) + } +} + +// addReturnCode adds to the return code of the submission. +func (s *formSubmission) addReturnCode(n int) { + s.mu.Lock() + defer s.mu.Unlock() + s.results["returncode"] = s.returnCodeLocked() + n +} + +func (s *formSubmission) returnCode() int { + s.mu.Lock() + defer s.mu.Unlock() + return s.returnCodeLocked() +} + +func (s *formSubmission) returnCodeLocked() int { + switch t := s.results["returncode"].(type) { + case int: + return t + case json.Number: + n, _ := t.Int64() + return int(n) + case float64: + return int(t) + } + return 0 +} + +func (s *formSubmission) setStatus(status string) { + s.mu.Lock() + defer s.mu.Unlock() + s.results["status"] = status +} + +// save stores the results structure, as update_results() does. mergeOutputs +// first takes in the outputs other clients stored meanwhile, through +// PUT /form_output_results, as reload_outputs=True does. +func (s *formSubmission) save(ctx context.Context, mergeOutputs bool) { + if mergeOutputs { + if current, err := s.stored(ctx); err == nil { + s.mu.Lock() + outputs := ensureMap(s.results, "outputs") + if stored, ok := current["outputs"].(map[string]any); ok { + for k, v := range stored { + outputs[k] = v + } + } + s.mu.Unlock() + } + } + s.mu.Lock() + b, err := json.Marshal(s.results) + s.mu.Unlock() + if err != nil { + s.log.Error("cannot encode the results", logkey.Error, err) + return + } + if err := s.a.ODB.UpdateFormOutputResults(ctx, s.resultsID, string(b)); err != nil { + s.log.Error("cannot store the results", "results_id", s.resultsID, logkey.Error, err) + return + } + if err := s.a.ODB.Session.NotifyChanges(ctx); err != nil { + s.log.Error("cannot notify changes", logkey.Error, err) + } +} + +func (s *formSubmission) stored(ctx context.Context) (map[string]any, error) { + text, err := s.a.ODB.ReadFormOutputResults(ctx, s.resultsID) + if err != nil { + return nil, err + } + var current map[string]any + decoder := json.NewDecoder(strings.NewReader(text)) + decoder.UseNumber() + if err := decoder.Decode(¤t); err != nil { + return nil, err + } + return current, nil +} + +// reload replaces the results structure by the stored one, as reload_results() +// does after a rest call, which may have changed it. +func (s *formSubmission) reload(ctx context.Context) { + current, err := s.stored(ctx) + if err != nil { + s.log.Error("cannot reload the results", "results_id", s.resultsID, logkey.Error, err) + return + } + s.mu.Lock() + s.results = current + s.mu.Unlock() +} + +// run runs the outputs of the form in order, as __form_submit() does: an output +// may be skipped after an error, or by its condition; an output failing stops +// the run. +func (s *formSubmission) run(ctx context.Context) { + defer func() { + if r := recover(); r != nil { + s.formLog(ctx, "", 1, "form.submit", fmt.Sprint(r), nil) + s.addReturnCode(1) + } + s.setStatus("COMPLETED") + s.save(ctx, false) + }() + + s.setStatus("RUNNING") + s.save(ctx, false) + + outputs := defMaps(s.definition, "Outputs") + for i, output := range outputs { + if _, ok := output["Id"]; !ok { + output["Id"] = fmt.Sprintf("output-%d", i) + } + } + for _, output := range outputs { + outputID := defString(output, "Id") + s.mu.Lock() + ensureMap(s.results, "log")[outputID] = []any{} + order, _ := s.results["outputs_order"].([]any) + s.results["outputs_order"] = append(order, outputID) + s.mu.Unlock() + + if defBool(output, "SkipOnErrors") && s.returnCode() != 0 { + s.formLog(ctx, outputID, 1, "form.submit", "%(output_id)s: skip (previous output error)", + map[string]any{"output_id": outputID}) + s.save(ctx, false) + continue + } + run, err := checkOutputCondition(output, s.data) + if err != nil { + s.formLog(ctx, outputID, 1, "form.submit", err.Error(), nil) + s.save(ctx, false) + continue + } + if !run { + continue + } + + switch defString(output, "Dest") { + case "db": + err = s.outputDB(ctx, output) + case "script": + err = s.outputScript(ctx, output) + case "rest": + err = s.outputRest(ctx, output) + case "mail": + err = s.outputMail(ctx, output, nil, 0) + case "workflow": + err = s.outputWorkflow(ctx, output) + } + if err != nil { + s.formLog(ctx, outputID, 1, "form.submit", err.Error(), nil) + s.addReturnCode(1) + break + } + s.save(ctx, false) + } +} + +// formsAPIBase is the base url of the collector API, for the rest outputs and +// the dynamic candidates checks, which call it as the submitter: the configured +// server.forms.api_url, else the local listener of this server. +func formsAPIBase() string { + if base := viper.GetString("server.forms.api_url"); base != "" { + return strings.TrimRight(base, "/") + } + addr := viper.GetString("server.addr") + host, port, err := net.SplitHostPort(addr) + if err != nil { + return "http://" + addr + "/api" + } + if host == "" || host == "0.0.0.0" || host == "::" { + host = "127.0.0.1" + } + return "http://" + net.JoinHostPort(host, port) + "/api" +} + +var formsHTTPClient = &http.Client{Timeout: 10 * time.Minute} + +// apiResponse is the answer of an API call: its status and its decoded body. +type apiResponse struct { + status int + body any + raw []byte +} + +// callAPI calls the collector API as the submitter: a GET carries vars in its +// query string, the other methods in a JSON body. fullURL is used as it is when +// set, for the external calls of rest outputs, without the credentials. +func (s *formSubmission) callAPI(ctx context.Context, method, path string, vars any, fullURL string) (*apiResponse, error) { + target := fullURL + if target == "" { + target = formsAPIBase() + path + } + var body io.Reader + if method == http.MethodGet && fullURL == "" { + if m, ok := vars.(map[string]any); ok && len(m) > 0 { + q := url.Values{} + for k, v := range m { + q.Set(k, formValueText(v)) + } + target += "?" + q.Encode() + } + } else if vars != nil { + b, err := json.Marshal(vars) + if err != nil { + return nil, err + } + body = bytes.NewReader(b) + } + req, err := http.NewRequestWithContext(ctx, method, target, body) + if err != nil { + return nil, err + } + req.Header.Set("Content-Type", "application/json") + req.Header.Set("Accept", "application/json") + if fullURL == "" && s.auth != "" { + req.Header.Set("Authorization", s.auth) + } + resp, err := formsHTTPClient.Do(req) + if err != nil { + return nil, err + } + defer func() { _ = resp.Body.Close() }() + raw, err := io.ReadAll(resp.Body) + if err != nil { + return nil, err + } + out := &apiResponse{status: resp.StatusCode, raw: raw} + decoder := json.NewDecoder(bytes.NewReader(raw)) + decoder.UseNumber() + _ = decoder.Decode(&out.body) + return out, nil +} + +// problemTextOf returns the message of an API error answer. +func problemTextOf(r *apiResponse) string { + if m, ok := r.body.(map[string]any); ok { + if text, ok := m["text"].(string); ok { + return text + } + } + return strings.TrimSpace(string(r.raw)) +} diff --git a/server/handlers/forms_team.go b/server/handlers/forms_team.go new file mode 100644 index 00000000..dfd30373 --- /dev/null +++ b/server/handlers/forms_team.go @@ -0,0 +1,235 @@ +package serverhandlers + +import ( + "context" + "log/slog" + "net/http" + "strconv" + + "github.com/labstack/echo/v4" + + "github.com/opensvc/oc3/cdb" + "github.com/opensvc/oc3/server" + "github.com/opensvc/oc3/util/echolog" + "github.com/opensvc/oc3/xauth" +) + +// formTeam describes one kind of form/group link: the publications, which make +// a form usable by a group, and the responsibles, who may change it. Each has +// the log actions and messages of the historical collector. +type formTeam struct { + table cdb.FormTeamTable + addAction string + addFmt string + addedFmt string + delAction string + delFmt string + deletedFmt string +} + +var ( + formPublicationTeam = formTeam{ + table: cdb.FormPublications, + addAction: "form.publication.add", + addFmt: "Form %(form_id)s published to group %(role)s", + addedFmt: "Form %(form_id)s already published to group %(role)s", + delAction: "form.publication.delete", + delFmt: "Form %(form_id)s unpublished to group %(group_id)s", + deletedFmt: "Form %(form_id)s already unpublished to group %(group_id)s", + } + formResponsibleTeam = formTeam{ + table: cdb.FormResponsibles, + addAction: "form.responsible.add", + addFmt: "Form %(form_id)s responsibility to group %(role)s added", + addedFmt: "Form %(form_id)s responsibility to group %(role)s already added", + delAction: "form.responsible.delete", + delFmt: "Form %(form_id)s responsibility to group %(group_id)s removed", + deletedFmt: "Form %(form_id)s responsibility to group %(group_id)s already removed", + } +) + +// GetFormPublications handles GET /forms/{form_id}/publications. +func (a *Api) GetFormPublications(c echo.Context, formId int, params server.GetFormPublicationsParams) error { + return a.getFormTeam(c, "GetFormPublications", cdb.FormPublications, int64(formId), listEndpointParams{ + props: params.Props, limit: params.Limit, offset: params.Offset, + meta: params.Meta, stats: params.Stats, orderby: params.Orderby, groupby: params.Groupby, + filter: params.Filter, + }) +} + +// GetFormResponsibles handles GET /forms/{form_id}/responsibles. +func (a *Api) GetFormResponsibles(c echo.Context, formId int, params server.GetFormResponsiblesParams) error { + return a.getFormTeam(c, "GetFormResponsibles", cdb.FormResponsibles, int64(formId), listEndpointParams{ + props: params.Props, limit: params.Limit, offset: params.Offset, + meta: params.Meta, stats: params.Stats, orderby: params.Orderby, groupby: params.Groupby, + filter: params.Filter, + }) +} + +// getFormTeam lists the groups linked to a form. Both lists require the form to +// be published to the caller, as form_published() does for both. +func (a *Api) getFormTeam(c echo.Context, handlerName string, table cdb.FormTeamTable, formID int64, p listEndpointParams) error { + log := echolog.GetLogHandler(c, handlerName) + if err := a.requireFormPublished(c, log, c.Request().Context(), formID); err != nil { + return httpProblem(c, err) + } + return a.handleList(c, handlerName, "auth_group", p, func(ctx context.Context, lp cdb.ListParams) ([]map[string]any, error) { + return a.ODB.GetFormTeam(ctx, table, formID, lp) + }) +} + +// PostFormPublication handles POST /forms/{form_id}/publications/{group_id}. +func (a *Api) PostFormPublication(c echo.Context, formId int, groupId string) error { + return a.formTeamOne(c, "PostFormPublication", formPublicationTeam, true, strconv.Itoa(formId), groupId) +} + +// DeleteFormPublication handles DELETE /forms/{form_id}/publications/{group_id}. +func (a *Api) DeleteFormPublication(c echo.Context, formId int, groupId string) error { + return a.formTeamOne(c, "DeleteFormPublication", formPublicationTeam, false, strconv.Itoa(formId), groupId) +} + +// PostFormResponsible handles POST /forms/{form_id}/responsibles/{group_id}. +func (a *Api) PostFormResponsible(c echo.Context, formId int, groupId string) error { + return a.formTeamOne(c, "PostFormResponsible", formResponsibleTeam, true, strconv.Itoa(formId), groupId) +} + +// DeleteFormResponsible handles DELETE /forms/{form_id}/responsibles/{group_id}. +func (a *Api) DeleteFormResponsible(c echo.Context, formId int, groupId string) error { + return a.formTeamOne(c, "DeleteFormResponsible", formResponsibleTeam, false, strconv.Itoa(formId), groupId) +} + +// PostFormsPublications handles POST /forms_publications. +func (a *Api) PostFormsPublications(c echo.Context) error { + return a.formTeamBulk(c, "PostFormsPublications", formPublicationTeam, true) +} + +// DeleteFormsPublications handles DELETE /forms_publications. +func (a *Api) DeleteFormsPublications(c echo.Context) error { + return a.formTeamBulk(c, "DeleteFormsPublications", formPublicationTeam, false) +} + +// PostFormsResponsibles handles POST /forms_responsibles. +func (a *Api) PostFormsResponsibles(c echo.Context) error { + return a.formTeamBulk(c, "PostFormsResponsibles", formResponsibleTeam, true) +} + +// DeleteFormsResponsibles handles DELETE /forms_responsibles. +func (a *Api) DeleteFormsResponsibles(c echo.Context) error { + return a.formTeamBulk(c, "DeleteFormsResponsibles", formResponsibleTeam, false) +} + +func (a *Api) formTeamOne(c echo.Context, handlerName string, team formTeam, add bool, formID, groupID string) error { + log := echolog.GetLogHandler(c, handlerName) + ctx, cancel := context.WithTimeout(c.Request().Context(), a.SyncTimeout) + defer cancel() + result, err := a.formTeamChange(ctx, c, log, team, add, formID, groupID) + if err != nil { + return httpProblem(c, err) + } + a.formNotify(ctx, log) + return c.JSON(http.StatusOK, result) +} + +// formTeamBulk takes the form and the group from the body keys form_id and +// group_id, one entry or a list, as the historical /forms_publications and +// /forms_responsibles handlers do. +func (a *Api) formTeamBulk(c echo.Context, handlerName string, team formTeam, add bool) error { + log := echolog.GetLogHandler(c, handlerName) + ctx, cancel := context.WithTimeout(c.Request().Context(), a.SyncTimeout) + defer cancel() + entries, isList, err := decodeEntries(c) + if err != nil { + return httpProblem(c, err) + } + defer a.formNotify(ctx, log) + return runEntries(c, entries, isList, func(entry map[string]any) (map[string]any, error) { + formID, ok := entryString(entry, "form_id") + if !ok { + return nil, httpErrorf(http.StatusBadRequest, "The 'form_id' key is mandatory") + } + groupID, ok := entryString(entry, "group_id") + if !ok { + return nil, httpErrorf(http.StatusBadRequest, "The 'group_id' key is mandatory") + } + return a.formTeamChange(ctx, c, log, team, add, formID, groupID) + }) +} + +// formTeamChange links or unlinks a form and a group. Adding resolves the group +// as lib_org_group() does, by id or role, among the caller's groups for a +// non-manager, and refuses privilege groups. An existing link, or a missing +// one, answers with an info message rather than an error. +func (a *Api) formTeamChange(ctx context.Context, c echo.Context, log *slog.Logger, team formTeam, add bool, formIDStr, groupIDStr string) (map[string]any, error) { + if err := requireFormsManager(c); err != nil { + return nil, err + } + formID, err := parseFormID(formIDStr) + if err != nil { + return nil, err + } + if err := a.requireFormResponsible(c, log, ctx, formID); err != nil { + return nil, err + } + + if !add { + groupID, err := strconv.ParseInt(groupIDStr, 10, 64) + if err != nil { + return nil, httpErrorf(http.StatusBadRequest, "invalid group id %q", groupIDStr) + } + d := map[string]any{"form_id": formIDStr, "group_id": groupIDStr} + exists, err := a.ODB.FormTeamExists(ctx, team.table, formID, groupID) + if err != nil { + return nil, httpInternal(log, "cannot check the form group link", err) + } + if !exists { + return map[string]any{"info": pyFormat(team.deletedFmt, d)}, nil + } + if err := a.ODB.DeleteFormTeam(ctx, team.table, formID, groupID); err != nil { + return nil, httpInternal(log, "cannot unlink the form and the group", err) + } + a.formLog(ctx, c, log, team.delAction, team.delFmt, d) + return map[string]any{"info": pyFormat(team.delFmt, d)}, nil + } + + var userGroupIDs []int64 + isManager := IsManager(c) + if !isManager { + user := UserInfoFromContext(c) + if user == nil { + return nil, httpErrorf(http.StatusUnauthorized, "missing user context") + } + userID, err := strconv.ParseInt(user.GetExtensions().Get(xauth.XUserID), 10, 64) + if err != nil { + return nil, httpErrorf(http.StatusBadRequest, "invalid user id") + } + if userGroupIDs, err = a.ODB.UserGroupIDs(ctx, userID); err != nil { + return nil, httpInternal(log, "cannot list user groups", err) + } + } + group, status, err := a.ODB.OrgGroup(ctx, groupIDStr, userGroupIDs, isManager) + if err != nil { + return nil, httpInternal(log, "cannot resolve the group", err) + } + switch status { + case cdb.OrgGroupNotFound: + return nil, httpErrorf(http.StatusNotFound, "Group not found: %s", groupIDStr) + case cdb.OrgGroupAmbiguous: + return nil, httpErrorf(http.StatusBadRequest, "Ambiguous group id: %s", groupIDStr) + case cdb.OrgGroupPrivileged: + return nil, httpErrorf(http.StatusForbidden, "Operation not allowed on privilege group: %s", group.Role) + } + + d := map[string]any{"form_id": formIDStr, "role": group.Role} + exists, err := a.ODB.FormTeamExists(ctx, team.table, formID, group.ID) + if err != nil { + return nil, httpInternal(log, "cannot check the form group link", err) + } + if exists { + return map[string]any{"info": pyFormat(team.addedFmt, d)}, nil + } + if err := a.ODB.InsertFormTeam(ctx, team.table, formID, group.ID); err != nil { + return nil, httpInternal(log, "cannot link the form and the group", err) + } + a.formLog(ctx, c, log, team.addAction, team.addFmt, d) + return map[string]any{"info": pyFormat(team.addFmt, d)}, nil +} diff --git a/server/handlers/forms_validate.go b/server/handlers/forms_validate.go new file mode 100644 index 00000000..6eb0fb88 --- /dev/null +++ b/server/handlers/forms_validate.go @@ -0,0 +1,224 @@ +package serverhandlers + +import ( + "context" + "fmt" + "net/http" + "strings" +) + +// validate checks the submitted data against the inputs of the form, as +// validate_data() does: one object, or a list of objects each checked. +func (s *formSubmission) validate(ctx context.Context) error { + switch t := s.data.(type) { + case map[string]any: + return s.validateData(ctx, t) + case []any: + for _, item := range t { + m, ok := item.(map[string]any) + if !ok { + return httpErrorf(http.StatusBadRequest, "form data list entries must be objects") + } + if err := s.validateData(ctx, m); err != nil { + return err + } + } + } + return nil +} + +func (s *formSubmission) validateData(ctx context.Context, data map[string]any) error { + for _, input := range defMaps(s.definition, "Inputs") { + if err := s.validateInput(ctx, data, input); err != nil { + return err + } + } + return nil +} + +// validateInput checks one input, as validate_input_data() does: mandatory +// values, forced keys, strict static candidates and strict dynamic candidates, +// the last ones fetched from the API as the submitter. +func (s *formSubmission) validateInput(ctx context.Context, data map[string]any, input map[string]any) error { + inputID := defString(input, "Id") + keyID := defString(input, "Key") + lookup := inputID + if keyID != "" { + lookup = keyID + } + val := data[lookup] + + applies, err := checkInputCondition(input, data) + if err != nil { + return httpErrorf(http.StatusBadRequest, "%s", err) + } + if !applies { + return nil + } + if val == nil { + if defBool(input, "Mandatory") { + return httpErrorf(http.StatusBadRequest, "Missing value for mandatory input '%s'", inputID) + } + return nil + } + + vals, isList := val.([]any) + if !isList { + vals = []any{val} + } + + // Forced keys: "key=value" entries the submitted data must carry as defined. + var keyDefs []string + for _, k := range defList(input, "Keys") { + if ks, ok := k.(string); ok { + keyDefs = append(keyDefs, ks) + } + } + refData := []map[string]any{data} + if isList { + refData = nil + for _, item := range vals { + if m, ok := item.(map[string]any); ok { + refData = append(refData, m) + } + } + } + for _, ref := range refData { + for _, keyDef := range keyDefs { + key, forced, found := strings.Cut(keyDef, "=") + if !found { + continue + } + key = strings.TrimSpace(key) + forced = formDereference(strings.TrimSpace(forced), ref, "") + refVal, ok := ref[key] + if !ok { + return httpErrorf(http.StatusBadRequest, "missing key '%s', from input %s", key, inputID) + } + if !strings.Contains(forced, "#") && forced != formValueText(refVal) { + return httpErrorf(http.StatusBadRequest, "unallowed key value '%s=%s', expecting '%s', from input %s", + key, formValueText(refVal), forced, inputID) + } + } + } + + strict := defBool(input, "StrictCandidates") + mandatory := defBool(input, "Mandatory") + + // Strict static candidates. + if candidates := defList(input, "Candidates"); len(candidates) > 0 && strict { + var allowed []string + for _, candidate := range candidates { + if m, ok := candidate.(map[string]any); ok { + if v, ok := m["Value"]; ok { + allowed = append(allowed, formValueText(v)) + continue + } + } + allowed = append(allowed, formValueText(candidate)) + } + for _, v := range vals { + if isFalsy(v) && !mandatory { + continue + } + if !containsString(allowed, formValueText(v)) { + return httpErrorf(http.StatusBadRequest, "Input '%s' value '%s' not in allowed candidates", inputID, formValueText(v)) + } + } + } + + // Strict dynamic candidates: the key to compare is a forced key naming the + // input, else the input Value property. + var key string + for _, keyDef := range keyDefs { + k, v, found := strings.Cut(keyDef, "=") + if found && strings.TrimSpace(k) == inputID { + key = strings.TrimSpace(v) + } + } + if key == "" { + key = defString(input, "Value") + } + fn := defString(input, "Function") + if fn == "" || key == "" || !strict { + return nil + } + fn = formDereference(fn, data, "") + if !strings.HasPrefix(fn, "/") { + return nil + } + key = strings.TrimLeft(key, "#") + for _, v := range vals { + args, err := formRestArgs(fn, data) + if err != nil { + return httpErrorf(http.StatusBadRequest, "cannot build the candidates url %s: missing %s", fn, err) + } + kwargs := map[string]any{} + for _, entry := range defList(input, "Args") { + es, ok := entry.(string) + if !ok { + continue + } + es = formDereference(es, data, "") + k, kv, found := strings.Cut(es, "=") + if !found { + continue + } + kwargs[strings.TrimSpace(k)] = formDereference(strings.TrimSpace(kv), data, "") + } + keyVal := v + if m, ok := v.(map[string]any); ok { + keyVal = m[key] + } + kwargs["limit"] = 0 + kwargs["search"] = formValueText(keyVal) + kwargs["search_props"] = key + path := "/" + strings.Join(args, "/") + resp, err := s.callAPI(ctx, http.MethodGet, path, kwargs, "") + if err != nil { + return httpErrorf(http.StatusBadRequest, "cannot verify the submitted value is a valid candidate: %s", err) + } + if resp.status == http.StatusNotFound { + return httpErrorf(http.StatusBadRequest, "Unknown handler '%s': can not verify the submitted value is a valid candidates", fn) + } + if resp.status >= 300 { + return httpErrorf(http.StatusBadRequest, "cannot verify the submitted value is a valid candidate: %s", problemTextOf(resp)) + } + var candidates []string + if m, ok := resp.body.(map[string]any); ok { + list, _ := m["data"].([]any) + for _, candidate := range list { + cv, err := formGetVal(candidate, key) + if err != nil { + return httpErrorf(http.StatusBadRequest, "Key '%s' not in candidates", key) + } + candidates = append(candidates, formValueText(cv)) + } + } + if isFalsy(keyVal) && !mandatory { + continue + } + if !containsString(candidates, formValueText(keyVal)) { + return httpErrorf(http.StatusBadRequest, "Input '%s' value '%s' not in allowed candidates %s obtained from %s", + inputID, formValueText(keyVal), fmt.Sprint(candidates), path) + } + } + return nil +} + +// isFalsy tells whether a value is false for python: empty or zero. +func isFalsy(v any) bool { + switch t := v.(type) { + case nil: + return true + case string: + return t == "" + case bool: + return !t + case []any: + return len(t) == 0 + case map[string]any: + return len(t) == 0 + } + return formValueText(v) == "0" +} diff --git a/server/handlers/get_actions.go b/server/handlers/get_actions.go index 06491111..0869d316 100644 --- a/server/handlers/get_actions.go +++ b/server/handlers/get_actions.go @@ -14,6 +14,7 @@ func (a *Api) GetActions(c echo.Context, params server.GetActionsParams) error { return a.handleList(c, "GetActions", "action_queue", listEndpointParams{ props: params.Props, limit: params.Limit, offset: params.Offset, meta: params.Meta, stats: params.Stats, orderby: params.Orderby, groupby: params.Groupby, + filter: params.Filter, }, func(ctx context.Context, p cdb.ListParams) ([]map[string]any, error) { return a.ODB.GetActions(ctx, p) }) diff --git a/server/handlers/get_alerts.go b/server/handlers/get_alerts.go index 9b8a8e68..cb38154b 100644 --- a/server/handlers/get_alerts.go +++ b/server/handlers/get_alerts.go @@ -67,7 +67,7 @@ func (a *Api) handleAlerts( return JSONProblemf(c, http.StatusInternalServerError, "cannot build select clause") } - items, err := fetch(c.Request().Context(), cdb.ListParams{ + dbParams := cdb.ListParams{ Groups: UserGroupsFromContext(c), IsManager: IsManager(c), Limit: query.Page.Limit, @@ -77,7 +77,8 @@ func (a *Api) handleAlerts( TypeHints: buildTypeHints(fetchProps, mapping), OrderBy: query.OrderBy, GroupBy: query.GroupBy, - }) + } + items, err := fetch(c.Request().Context(), dbParams) if err != nil { log.Error("cannot fetch alerts", logkey.Error, err) return JSONProblemf(c, http.StatusInternalServerError, "cannot get alerts") @@ -91,5 +92,9 @@ func (a *Api) handleAlerts( return JSONProblemf(c, http.StatusNotFound, "alert %s not found", itemVal) } - return c.JSON(http.StatusOK, newListResponse(items, mapping, query)) + response := newListResponse(items, mapping, query) + if !isItem && query.WithMeta && !query.WithStats { + response = response.withTotal(listTotal(c.Request().Context(), log, fetch, dbParams, len(items))) + } + return c.JSON(http.StatusOK, response) } diff --git a/server/handlers/get_apps.go b/server/handlers/get_apps.go index db12ee90..22687e1e 100644 --- a/server/handlers/get_apps.go +++ b/server/handlers/get_apps.go @@ -15,6 +15,7 @@ func (a *Api) GetApps(c echo.Context, params server.GetAppsParams) error { return a.handleList(c, "GetApps", "app", listEndpointParams{ props: params.Props, limit: params.Limit, offset: params.Offset, meta: params.Meta, stats: params.Stats, orderby: params.Orderby, groupby: params.Groupby, + filter: params.Filter, }, func(ctx context.Context, p cdb.ListParams) ([]map[string]any, error) { return odb.GetApps(ctx, p) }) diff --git a/server/handlers/get_disks.go b/server/handlers/get_disks.go index 7dd8e530..16e28b91 100644 --- a/server/handlers/get_disks.go +++ b/server/handlers/get_disks.go @@ -15,6 +15,7 @@ func (a *Api) GetDisks(c echo.Context, params server.GetDisksParams) error { return a.handleList(c, "GetDisks", "disk", listEndpointParams{ props: params.Props, limit: params.Limit, offset: params.Offset, meta: params.Meta, stats: params.Stats, orderby: params.Orderby, groupby: params.Groupby, + filter: params.Filter, }, func(ctx context.Context, p cdb.ListParams) ([]map[string]any, error) { return odb.GetDisks(ctx, p) }) diff --git a/server/handlers/get_filterset_nodes.go b/server/handlers/get_filterset_nodes.go index 3f61a74e..6d8f42b4 100644 --- a/server/handlers/get_filterset_nodes.go +++ b/server/handlers/get_filterset_nodes.go @@ -36,6 +36,7 @@ func (a *Api) GetFiltersetNodes(c echo.Context, filtersetId string, params serve return a.handleList(c, "GetFiltersetNodes", "node", listEndpointParams{ props: params.Props, limit: params.Limit, offset: params.Offset, meta: params.Meta, stats: params.Stats, orderby: params.Orderby, groupby: params.Groupby, + filter: params.Filter, }, func(ctx context.Context, p cdb.ListParams) ([]map[string]any, error) { return a.ODB.GetNodesByIDs(ctx, nodeIDs, p) }) diff --git a/server/handlers/get_filterset_services.go b/server/handlers/get_filterset_services.go index 073bf159..07fc791d 100644 --- a/server/handlers/get_filterset_services.go +++ b/server/handlers/get_filterset_services.go @@ -36,6 +36,7 @@ func (a *Api) GetFiltersetServices(c echo.Context, filtersetId string, params se return a.handleList(c, "GetFiltersetServices", "service", listEndpointParams{ props: params.Props, limit: params.Limit, offset: params.Offset, meta: params.Meta, stats: params.Stats, orderby: params.Orderby, groupby: params.Groupby, + filter: params.Filter, }, func(ctx context.Context, p cdb.ListParams) ([]map[string]any, error) { return a.ODB.GetServicesByIDs(ctx, svcIDs, p) }) diff --git a/server/handlers/get_filtersets.go b/server/handlers/get_filtersets.go index 030f67b3..a4b5f43a 100644 --- a/server/handlers/get_filtersets.go +++ b/server/handlers/get_filtersets.go @@ -14,6 +14,7 @@ func (a *Api) GetFiltersets(c echo.Context, params server.GetFiltersetsParams) e return a.handleList(c, "GetFiltersets", "filterset", listEndpointParams{ props: params.Props, limit: params.Limit, offset: params.Offset, meta: params.Meta, stats: params.Stats, orderby: params.Orderby, groupby: params.Groupby, + filter: params.Filter, }, func(ctx context.Context, p cdb.ListParams) ([]map[string]any, error) { return a.ODB.GetFiltersets(ctx, p) }) diff --git a/server/handlers/get_groups.go b/server/handlers/get_groups.go index 131645cd..66025c67 100644 --- a/server/handlers/get_groups.go +++ b/server/handlers/get_groups.go @@ -14,6 +14,7 @@ func (a *Api) GetGroups(c echo.Context, params server.GetGroupsParams) error { return a.handleList(c, "GetGroups", "auth_group", listEndpointParams{ props: params.Props, limit: params.Limit, offset: params.Offset, meta: params.Meta, stats: params.Stats, orderby: params.Orderby, groupby: params.Groupby, + filter: params.Filter, }, func(ctx context.Context, p cdb.ListParams) ([]map[string]any, error) { return a.ODB.GetGroups(ctx, p) }) diff --git a/server/handlers/get_ips.go b/server/handlers/get_ips.go index 240e8cb4..4d60709c 100644 --- a/server/handlers/get_ips.go +++ b/server/handlers/get_ips.go @@ -11,10 +11,9 @@ import ( // GetIps handles GET /ips func (a *Api) GetIps(c echo.Context, params server.GetIpsParams) error { - return a.handleList(c, "GetIps", "node_ip", listEndpointParams{ - props: params.Props, limit: params.Limit, offset: params.Offset, - meta: params.Meta, stats: params.Stats, orderby: params.Orderby, groupby: params.Groupby, - }, func(ctx context.Context, p cdb.ListParams) ([]map[string]any, error) { - return a.ODB.GetIps(ctx, p) - }) + return a.handleList(c, "GetIps", "node_ip", + listParams(params.Props, params.Limit, params.Offset, params.Meta, params.Stats, params.Orderby, params.Groupby, params.Filter), + func(ctx context.Context, p cdb.ListParams) ([]map[string]any, error) { + return a.ODB.GetIps(ctx, p) + }) } diff --git a/server/handlers/get_nodes.go b/server/handlers/get_nodes.go index d62ed0d0..fd125c7a 100644 --- a/server/handlers/get_nodes.go +++ b/server/handlers/get_nodes.go @@ -15,6 +15,7 @@ func (a *Api) GetNodes(c echo.Context, params server.GetNodesParams) error { return a.handleList(c, "GetNodes", "node", listEndpointParams{ props: params.Props, limit: params.Limit, offset: params.Offset, meta: params.Meta, stats: params.Stats, orderby: params.Orderby, groupby: params.Groupby, + filter: params.Filter, }, func(ctx context.Context, p cdb.ListParams) ([]map[string]any, error) { return odb.GetNodes(ctx, p) }) diff --git a/server/handlers/get_nodes_hardware.go b/server/handlers/get_nodes_hardware.go index 47a663fc..0df939e8 100644 --- a/server/handlers/get_nodes_hardware.go +++ b/server/handlers/get_nodes_hardware.go @@ -15,6 +15,7 @@ func (a *Api) GetNodesHardware(c echo.Context, params server.GetNodesHardwarePar return a.handleList(c, "GetNodesHardware", "node_hw", listEndpointParams{ props: params.Props, limit: params.Limit, offset: params.Offset, meta: params.Meta, stats: params.Stats, orderby: params.Orderby, groupby: params.Groupby, + filter: params.Filter, }, func(ctx context.Context, p cdb.ListParams) ([]map[string]any, error) { return odb.GetNodesHardware(ctx, p) }) diff --git a/server/handlers/get_packages.go b/server/handlers/get_packages.go new file mode 100644 index 00000000..2443491f --- /dev/null +++ b/server/handlers/get_packages.go @@ -0,0 +1,22 @@ +package serverhandlers + +import ( + "context" + + "github.com/labstack/echo/v4" + + "github.com/opensvc/oc3/cdb" + "github.com/opensvc/oc3/server" +) + +// GetPackages handles GET /packages +func (a *Api) GetPackages(c echo.Context, params server.GetPackagesParams) error { + odb := a.ODB + return a.handleList(c, "GetPackages", "package", listEndpointParams{ + props: params.Props, limit: params.Limit, offset: params.Offset, + meta: params.Meta, stats: params.Stats, orderby: params.Orderby, groupby: params.Groupby, + filter: params.Filter, + }, func(ctx context.Context, p cdb.ListParams) ([]map[string]any, error) { + return odb.GetPackages(ctx, p) + }) +} diff --git a/server/handlers/get_packages_diff.go b/server/handlers/get_packages_diff.go new file mode 100644 index 00000000..89e4cc2a --- /dev/null +++ b/server/handlers/get_packages_diff.go @@ -0,0 +1,72 @@ +package serverhandlers + +import ( + "context" + "net/http" + "strings" + + "github.com/labstack/echo/v4" + + "github.com/opensvc/oc3/server" + "github.com/opensvc/oc3/util/echolog" + "github.com/opensvc/oc3/util/logkey" +) + +// splitIDs reads a comma-separated list of ids, blanks dropped. +func splitIDs(s *string) []string { + if s == nil { + return nil + } + var ids []string + for _, id := range strings.Split(*s, ",") { + if id = strings.TrimSpace(id); id != "" { + ids = append(ids, id) + } + } + return ids +} + +// GetPackagesDiff handles GET /packages/diff, as the historical +// rest_get_packages_diff: the package versions installed on some of the compared +// nodes but not on all of them. +func (a *Api) GetPackagesDiff(c echo.Context, params server.GetPackagesDiffParams) error { + log := echolog.GetLogHandler(c, "GetPackagesDiff") + ctx, cancel := context.WithTimeout(c.Request().Context(), a.SyncTimeout) + defer cancel() + + encap := params.Encap != nil && *params.Encap + nodes, err := a.ODB.PackagesDiffNodes(ctx, splitIDs(params.NodeIds), splitIDs(params.SvcIds), encap, + UserGroupsFromContext(c), IsManager(c)) + if err != nil { + log.Error("cannot resolve the nodes to compare", logkey.Error, err) + return JSONProblemf(c, http.StatusInternalServerError, "cannot resolve the nodes to compare") + } + // With encap, a service without encapsulated nodes has nothing to compare: an + // empty answer rather than an error, as the historical API. + if len(nodes) < 2 && !encap { + return JSONProblemf(c, http.StatusBadRequest, "At least two nodes should be selected") + } + + nodeIDs := make([]string, len(nodes)) + resultNodes := make([]server.PackageDiffNode, len(nodes)) + for i, n := range nodes { + nodeIDs[i] = n.NodeID + resultNodes[i] = server.PackageDiffNode{NodeId: n.NodeID, Nodename: n.Nodename} + } + rows, err := a.ODB.PackagesDiff(ctx, nodeIDs) + if err != nil { + log.Error("cannot compare packages", logkey.Error, err) + return JSONProblemf(c, http.StatusInternalServerError, "cannot compare packages") + } + data := make([]server.PackageDiffRow, len(rows)) + for i, r := range rows { + data[i] = server.PackageDiffRow{ + NodeId: r.NodeID, PkgName: r.PkgName, PkgVersion: r.PkgVersion, + PkgArch: r.PkgArch, PkgType: r.PkgType, + } + } + resp := server.PackagesDiffResponse{Data: data} + resp.Meta.NodeIds = nodeIDs + resp.Meta.Nodes = resultNodes + return c.JSON(http.StatusOK, resp) +} diff --git a/server/handlers/get_services.go b/server/handlers/get_services.go index 972f43fe..00363a1e 100644 --- a/server/handlers/get_services.go +++ b/server/handlers/get_services.go @@ -15,6 +15,7 @@ func (a *Api) GetServices(c echo.Context, params server.GetServicesParams) error return a.handleList(c, "GetServices", "service", listEndpointParams{ props: params.Props, limit: params.Limit, offset: params.Offset, meta: params.Meta, stats: params.Stats, orderby: params.Orderby, groupby: params.Groupby, + filter: params.Filter, }, func(ctx context.Context, p cdb.ListParams) ([]map[string]any, error) { return odb.GetServices(ctx, p) }) diff --git a/server/handlers/get_services_instances.go b/server/handlers/get_services_instances.go index 31a066f6..e60cadab 100644 --- a/server/handlers/get_services_instances.go +++ b/server/handlers/get_services_instances.go @@ -15,6 +15,7 @@ func (a *Api) GetServicesInstances(c echo.Context, params server.GetServicesInst return a.handleList(c, "GetServicesInstances", "instance", listEndpointParams{ props: params.Props, limit: params.Limit, offset: params.Offset, meta: params.Meta, stats: params.Stats, orderby: params.Orderby, groupby: params.Groupby, + filter: params.Filter, }, func(ctx context.Context, p cdb.ListParams) ([]map[string]any, error) { return odb.GetServicesInstances(ctx, p) }) diff --git a/server/handlers/get_tags.go b/server/handlers/get_tags.go index 1789a495..719041bd 100644 --- a/server/handlers/get_tags.go +++ b/server/handlers/get_tags.go @@ -41,7 +41,19 @@ func (a *Api) handleGetTags(c echo.Context, tagID *int, query ListQueryParameter log.Error("cannot project tag props", logkey.Error, err) return JSONProblemf(c, http.StatusInternalServerError, "cannot project tag props") } - return c.JSON(http.StatusOK, newListResponse(filteredItems, propsMapping["tag"], query)) + response := newListResponse(filteredItems, propsMapping["tag"], query) + if query.WithMeta && !query.WithStats { + total, known := totalFromPage(query.Page.Limit, query.Page.Offset, len(tags)) + if !known { + if total, err = odb.CountTags(ctx); err != nil { + log.Error("cannot count tags", logkey.Error, err) + } + } + if err == nil { + response = response.withTotal(&total) + } + } + return c.JSON(http.StatusOK, response) } // GetTags handles GET /tags diff --git a/server/handlers/get_user.go b/server/handlers/get_user.go new file mode 100644 index 00000000..47621720 --- /dev/null +++ b/server/handlers/get_user.go @@ -0,0 +1,21 @@ +package serverhandlers + +import ( + "context" + + "github.com/labstack/echo/v4" + + "github.com/opensvc/oc3/cdb" + "github.com/opensvc/oc3/server" +) + +// GetUser handles GET /users/{user_id} +func (a *Api) GetUser(c echo.Context, userId string, params server.GetUserParams) error { + return a.handleItem(c, "GetUser", "user", "user_id", userId, listEndpointParams{ + props: params.Props, limit: params.Limit, offset: params.Offset, + meta: params.Meta, stats: params.Stats, orderby: params.Orderby, groupby: params.Groupby, + withUserID: true, + }, func(ctx context.Context, p cdb.ListParams) ([]map[string]any, error) { + return a.ODB.GetUser(ctx, userId, p) + }) +} diff --git a/server/handlers/get_user_prefs.go b/server/handlers/get_user_prefs.go new file mode 100644 index 00000000..d16e1d71 --- /dev/null +++ b/server/handlers/get_user_prefs.go @@ -0,0 +1,44 @@ +package serverhandlers + +import ( + "encoding/json" + "net/http" + + "github.com/labstack/echo/v4" + + "github.com/opensvc/oc3/cdb" + "github.com/opensvc/oc3/server" + "github.com/opensvc/oc3/util/echolog" + "github.com/opensvc/oc3/util/logkey" +) + +// GetUserPrefs handles GET /users/{user_id}/prefs +func (a *Api) GetUserPrefs(c echo.Context, userId string) error { + log := echolog.GetLogHandler(c, "GetUserPrefs") + ctx := c.Request().Context() + + log.Info("called", logkey.UserID, userId) + + raw, found, err := a.ODB.UserPrefs(ctx, userId, cdb.ListParams{ + Groups: UserGroupsFromContext(c), + IsManager: IsManager(c), + UserID: authUserID(c), + }) + if err != nil { + log.Error("cannot get user prefs", logkey.UserID, userId, logkey.Error, err) + return JSONProblemf(c, http.StatusInternalServerError, "cannot get user prefs") + } + + // An unknown user, a user the caller cannot see, a missing row and a stored + // document that does not parse all answer with an empty object, as the python + // handler does. + prefs := map[string]any{} + if found && raw != "" { + if err := json.Unmarshal([]byte(raw), &prefs); err != nil { + log.Warn("stored user prefs are not valid json", logkey.UserID, userId, logkey.Error, err) + prefs = map[string]any{} + } + } + + return c.JSON(http.StatusOK, server.UserPrefsResponse{Data: prefs}) +} diff --git a/server/handlers/get_users.go b/server/handlers/get_users.go new file mode 100644 index 00000000..7929b78a --- /dev/null +++ b/server/handlers/get_users.go @@ -0,0 +1,22 @@ +package serverhandlers + +import ( + "context" + + "github.com/labstack/echo/v4" + + "github.com/opensvc/oc3/cdb" + "github.com/opensvc/oc3/server" +) + +// GetUsers handles GET /users +func (a *Api) GetUsers(c echo.Context, params server.GetUsersParams) error { + return a.handleList(c, "GetUsers", "user", listEndpointParams{ + props: params.Props, limit: params.Limit, offset: params.Offset, + meta: params.Meta, stats: params.Stats, orderby: params.Orderby, groupby: params.Groupby, + filter: params.Filter, + withUserID: true, + }, func(ctx context.Context, p cdb.ListParams) ([]map[string]any, error) { + return a.ODB.GetUsers(ctx, p) + }) +} diff --git a/server/handlers/get_workflows.go b/server/handlers/get_workflows.go new file mode 100644 index 00000000..f23cb92f --- /dev/null +++ b/server/handlers/get_workflows.go @@ -0,0 +1,37 @@ +package serverhandlers + +import ( + "context" + "net/http" + + "github.com/labstack/echo/v4" + + "github.com/opensvc/oc3/cdb" + "github.com/opensvc/oc3/server" +) + +// GetWorkflows handles GET /workflows, as the historical rest_get_workflows: +// every workflow is listed to any authenticated user. The assigned parameter +// narrows the list to the historical "Assigned to my team" and "Pending tiers +// action" tables. +func (a *Api) GetWorkflows(c echo.Context, params server.GetWorkflowsParams) error { + odb := a.ODB + assigned := "" + if params.Assigned != nil { + assigned = string(*params.Assigned) + } + switch assigned { + case "", cdb.WorkflowsAssignedTeam, cdb.WorkflowsAssignedTiers: + default: + return JSONProblemf(c, http.StatusBadRequest, "invalid assigned value %q: expected %s or %s", + assigned, cdb.WorkflowsAssignedTeam, cdb.WorkflowsAssignedTiers) + } + return a.handleList(c, "GetWorkflows", "workflow", listEndpointParams{ + props: params.Props, limit: params.Limit, offset: params.Offset, + meta: params.Meta, stats: params.Stats, orderby: params.Orderby, groupby: params.Groupby, + filter: params.Filter, + withUserID: assigned != "", + }, func(ctx context.Context, p cdb.ListParams) ([]map[string]any, error) { + return odb.GetWorkflows(ctx, nil, assigned, p) + }) +} diff --git a/server/handlers/handle_list.go b/server/handlers/handle_list.go index c6d5d4f0..7a42ded8 100644 --- a/server/handlers/handle_list.go +++ b/server/handlers/handle_list.go @@ -2,7 +2,9 @@ package serverhandlers import ( "context" + "log/slog" "net/http" + "slices" "github.com/labstack/echo/v4" @@ -24,6 +26,74 @@ type listEndpointParams struct { stats *server.InQueryStats orderby *server.InQueryOrderby groupby *server.InQueryGroupby + filter *server.InQueryFilter + + // withUserID asks for the authenticated user's id to be forwarded in + // cdb.ListParams. Set it only on the endpoints whose access control + // references the caller's identity and not just its groups. + withUserID bool + + // virtual are the props computed from other props rather than read from a + // column, as the historical collector's vprops, e.g. form_definition parsed + // from form_yaml. They are listed in the mapping's Available props, without a + // SQL expression. + virtual map[string]virtualProp +} + +// virtualProp is a prop computed after the fetch, from the props it requires. +// The required props are fetched even when not asked for, then dropped. +type virtualProp struct { + requires []string + // compute returns the value, or false to leave the prop out of the row. + compute func(item map[string]any) (any, bool) +} + +// fetchPropsFor replaces the virtual props of a selection by the props they +// require, keeping the order and without duplicates. +func fetchPropsFor(props []string, virtual map[string]virtualProp) []string { + if len(virtual) == 0 { + return props + } + out := make([]string, 0, len(props)) + for _, prop := range props { + if v, ok := virtual[prop]; ok { + out = ensureProps(out, v.requires...) + continue + } + out = ensureProps(out, prop) + } + return out +} + +// computeVirtualProps fills the virtual props asked for, then removes the props +// fetched only to compute them. +func computeVirtualProps(items []map[string]any, props []string, virtual map[string]virtualProp) { + if len(virtual) == 0 { + return + } + var wanted []string + for _, prop := range props { + if _, ok := virtual[prop]; ok { + wanted = append(wanted, prop) + } + } + if len(wanted) == 0 { + return + } + for _, item := range items { + for _, prop := range wanted { + if value, ok := virtual[prop].compute(item); ok { + item[prop] = value + } + } + for _, prop := range wanted { + for _, required := range virtual[prop].requires { + if !slices.Contains(props, required) { + delete(item, required) + } + } + } + } } // handleList implements the common pipeline for all list endpoints: @@ -46,6 +116,11 @@ func (a *Api) handleList( return JSONProblem(c, http.StatusBadRequest, err.Error()) } + filters, err := buildFilters(p.filter, mapping) + if err != nil { + return JSONProblem(c, http.StatusBadRequest, err.Error()) + } + log := echolog.GetLogHandler(c, handlerName) groups := UserGroupsFromContext(c) isManager := IsManager(c) @@ -58,10 +133,12 @@ func (a *Api) handleList( "stats", query.WithStats, "orderby", query.OrderBy, "groupby", query.GroupBy, + "filters", len(filters), "is_manager", isManager, ) - selectExprs, err := buildSelectClause(query.Props, mapping) + fetchProps := fetchPropsFor(query.Props, p.virtual) + selectExprs, err := buildSelectClause(fetchProps, mapping) if err != nil { log.Error("cannot build select clause", logkey.Error, err) return JSONProblemf(c, http.StatusInternalServerError, "cannot build select clause") @@ -72,11 +149,15 @@ func (a *Api) handleList( IsManager: isManager, Limit: query.Page.Limit, Offset: query.Page.Offset, - Props: query.Props, + Props: fetchProps, SelectExprs: selectExprs, - TypeHints: buildTypeHints(query.Props, mapping), + TypeHints: buildTypeHints(fetchProps, mapping), OrderBy: query.OrderBy, GroupBy: query.GroupBy, + Filters: filters, + } + if p.withUserID { + dbParams.UserID = authUserID(c) } items, err := fetch(c.Request().Context(), dbParams) @@ -84,8 +165,64 @@ func (a *Api) handleList( log.Error("cannot fetch items", logkey.Error, err) return JSONProblemf(c, http.StatusInternalServerError, "cannot get %s", mappingKey) } + computeVirtualProps(items, query.Props, p.virtual) - return c.JSON(http.StatusOK, newListResponse(items, mapping, query)) + response := newListResponse(items, mapping, query) + if query.WithMeta && !query.WithStats { + response = response.withTotal(listTotal(c.Request().Context(), log, fetch, dbParams, len(items))) + } + return c.JSON(http.StatusOK, response) +} + +// totalFromPage returns the list total when the page alone tells it: every row +// was asked for, the page is not full, or the first page is empty. Only a full +// page, or an empty page past the first, needs a count. +func totalFromPage(limit, offset, pageLen int) (int, bool) { + switch { + case limit <= 0: + // No limit: the offset is not applied either, the page is the whole list. + return pageLen, true + case pageLen > 0 && pageLen < limit: + return offset + pageLen, true + case pageLen == 0 && offset == 0: + return 0, true + } + return 0, false +} + +// listTotal counts the rows of a list without pagination, for meta.total. The +// fetcher runs again with the same access control, filters and grouping, but +// selects a window count instead of the columns, without sort and for one row: +// COUNT(*) OVER () counts the rows of the final result, so a grouped list counts +// its groups, as the historical collector did. A failed count is logged and the +// total left out, rather than failing a list whose rows were read. +func listTotal(ctx context.Context, log *slog.Logger, fetch listFetcher, p cdb.ListParams, pageLen int) *int { + if total, known := totalFromPage(p.Limit, p.Offset, pageLen); known { + return &total + } + count := p + count.CountOnly = true + count.SelectExprs = []string{"COUNT(*) OVER ()"} + count.Props = []string{"total"} + count.TypeHints = map[string]string{"total": "int64"} + count.Limit = 1 + count.Offset = 0 + rows, err := fetch(ctx, count) + if err != nil { + log.Error("cannot count the list rows", logkey.Error, err) + return nil + } + if len(rows) == 0 { + return intPtr(0) + } + switch n := rows[0]["total"].(type) { + case int64: + return intPtr(int(n)) + case int: + return intPtr(n) + } + log.Error("unexpected list count", "value", rows[0]["total"]) + return nil } // handleItem is like handleList but expects exactly one result and returns 404 @@ -126,6 +263,9 @@ func (a *Api) handleItem( Props: query.Props, SelectExprs: selectExprs, } + if p.withUserID { + dbParams.UserID = authUserID(c) + } items, err := fetch(c.Request().Context(), dbParams) if err != nil { diff --git a/server/handlers/handle_list_test.go b/server/handlers/handle_list_test.go new file mode 100644 index 00000000..0f9d388f --- /dev/null +++ b/server/handlers/handle_list_test.go @@ -0,0 +1,26 @@ +package serverhandlers + +import "testing" + +func TestTotalFromPage(t *testing.T) { + cases := []struct { + name string + limit, offset, pageLen int + total int + known bool + }{ + {"no limit: the page is the list", 0, 0, 120, 120, true}, + {"no limit, offset ignored", 0, 50, 120, 120, true}, + {"partial first page", 50, 0, 12, 12, true}, + {"partial last page", 50, 100, 7, 107, true}, + {"empty list", 50, 0, 0, 0, true}, + {"full page: rows may follow", 50, 0, 50, 0, false}, + {"empty page past the end", 50, 200, 0, 0, false}, + } + for _, c := range cases { + total, known := totalFromPage(c.limit, c.offset, c.pageLen) + if total != c.total || known != c.known { + t.Errorf("%s: got (%d, %v), want (%d, %v)", c.name, total, known, c.total, c.known) + } + } +} diff --git a/server/handlers/list_filters.go b/server/handlers/list_filters.go new file mode 100644 index 00000000..7931bde0 --- /dev/null +++ b/server/handlers/list_filters.go @@ -0,0 +1,98 @@ +package serverhandlers + +import ( + "fmt" + "regexp" + "strings" + + "github.com/opensvc/oc3/cdb" + "github.com/opensvc/oc3/server" +) + +// likeEscaper protects the LIKE wildcards of a text filter: "50%" searches for the +// string "50%", not for anything starting with "50". +var likeEscaper = strings.NewReplacer(`\`, `\\`, `%`, `\%`, `_`, `\_`) + +// buildFilters turns the filter query parameters of a list request into SQL +// conditions, combined with AND by the caller. +// +// Each value is "prop:expr". The prop is resolved like an orderby prop, joined +// props included, and must have a column. The expr is one of: +// +// text case-insensitive match anywhere in the value (LIKE %text%) +// ~regex regular expression, case-insensitive (REGEXP) +// in:a,b one of the listed values +// eq:v ne:v equal, not equal +// gt: gte: lt: lte: comparisons +// empty !empty no value, any value +// +// Case-insensitivity comes from the utf8_general_ci collation of the collector +// tables, which LIKE and REGEXP both honour. Regular expressions are checked with +// Go's RE2 parser first: an invalid one is a 400 naming the column rather than a +// database error, and RE2 is a subset of the PCRE MariaDB evaluates them with. +func buildFilters(filters *server.InQueryFilter, mapping propMapping) ([]cdb.ColumnFilter, error) { + if filters == nil { + return nil, nil + } + out := make([]cdb.ColumnFilter, 0, len(*filters)) + for _, raw := range *filters { + prop, expr, ok := strings.Cut(raw, ":") + prop = strings.TrimSpace(prop) + if !ok || prop == "" { + return nil, fmt.Errorf("invalid filter %q: expected prop:expr", raw) + } + col, err := resolvePropCol(prop, mapping, "filter") + if err != nil { + return nil, err + } + if expr == "" { + // An empty filter matches everything: nothing to add. + continue + } + column := col.Qualified() + f := cdb.ColumnFilter{Col: col} + + switch { + case expr == "empty": + f.Expr = fmt.Sprintf("(%s IS NULL OR %s = '')", column, column) + case expr == "!empty": + f.Expr = fmt.Sprintf("(%s IS NOT NULL AND %s <> '')", column, column) + case strings.HasPrefix(expr, "~"): + pattern := expr[1:] + if _, err := regexp.Compile(pattern); err != nil { + return nil, fmt.Errorf("invalid regular expression for %s: %v", prop, err) + } + f.Expr = column + " REGEXP ?" + f.Args = []any{pattern} + case strings.HasPrefix(expr, "in:"): + values := strings.Split(expr[len("in:"):], ",") + f.Expr = fmt.Sprintf("%s IN (%s)", column, cdb.Placeholders(len(values))) + for _, v := range values { + f.Args = append(f.Args, v) + } + default: + op, value, isOp := comparison(expr) + if isOp { + f.Expr = column + " " + op + " ?" + f.Args = []any{value} + } else { + f.Expr = column + " LIKE ?" + f.Args = []any{"%" + likeEscaper.Replace(expr) + "%"} + } + } + out = append(out, f) + } + return out, nil +} + +// comparison recognises the "eq:", "ne:", "gt:"… operators of a filter. +func comparison(expr string) (op, value string, ok bool) { + for prefix, sql := range map[string]string{ + "eq:": "=", "ne:": "<>", "gt:": ">", "gte:": ">=", "lt:": "<", "lte:": "<=", + } { + if strings.HasPrefix(expr, prefix) { + return sql, expr[len(prefix):], true + } + } + return "", "", false +} diff --git a/server/handlers/list_query_parameters.go b/server/handlers/list_query_parameters.go index 2fd25a9a..1f74db5a 100644 --- a/server/handlers/list_query_parameters.go +++ b/server/handlers/list_query_parameters.go @@ -2,8 +2,10 @@ package serverhandlers import ( "fmt" + "slices" "strings" + "github.com/opensvc/oc3/schema" "github.com/opensvc/oc3/server" ) @@ -91,13 +93,9 @@ func buildOrderBy(orderby *server.InQueryOrderby, mapping propMapping) ([]string desc = true token = token[1:] } - def, ok := mapping.Props[token] - if !ok { - return nil, fmt.Errorf("unknown orderby prop %q", token) - } - col := def.Col - if col == nil { - return nil, fmt.Errorf("prop %q cannot be used in orderby (no column reference)", token) + col, err := resolvePropCol(token, mapping, "orderby") + if err != nil { + return nil, err } expr := col.Qualified() if desc { @@ -107,3 +105,38 @@ func buildOrderBy(orderby *server.InQueryOrderby, mapping propMapping) ([]string } return exprs, nil } + +// resolvePropCol resolves an orderby or filter prop to its column. A +// "table.column" prop is resolved through the mapping's Joins, the same way props +// selection does, so that a list can be sorted or filtered by a joined name (e.g. +// "services.svcname"). usage names the parameter in the error messages. +func resolvePropCol(token string, mapping propMapping, usage string) (*schema.Col, error) { + if table, column, ok := strings.Cut(token, "."); ok { + jd, joinKnown := mapping.Joins[table] + if !joinKnown { + return nil, fmt.Errorf("unknown %s prop %q", usage, token) + } + refMapping, refFound := propsMapping[jd.MappingKey] + if !refFound { + return nil, fmt.Errorf("unknown %s prop %q", usage, token) + } + def, ok := refMapping.Props[column] + if !ok || !slices.Contains(refMapping.Available, column) { + return nil, fmt.Errorf("unknown %s prop %q", usage, token) + } + // The join key names the table the query joins: refuse a column that lives + // elsewhere, which would produce SQL referencing an absent table. + if def.Col == nil || def.Col.T.Name != table { + return nil, fmt.Errorf("prop %q cannot be used in %s (no column reference)", token, usage) + } + return def.Col, nil + } + def, ok := mapping.Props[token] + if !ok { + return nil, fmt.Errorf("unknown %s prop %q", usage, token) + } + if def.Col == nil { + return nil, fmt.Errorf("prop %q cannot be used in %s (no column reference)", token, usage) + } + return def.Col, nil +} diff --git a/server/handlers/list_response.go b/server/handlers/list_response.go index 4aafa131..1bd4635c 100644 --- a/server/handlers/list_response.go +++ b/server/handlers/list_response.go @@ -15,7 +15,7 @@ type listMeta struct { IncludedProps []string `json:"included_props,omitempty"` Limit int `json:"limit,omitempty"` Offset int `json:"offset,omitempty"` - Total int `json:"total,omitempty"` + Total *int `json:"total,omitempty"` } type listResponse struct { @@ -102,7 +102,7 @@ func newListResponse(items []map[string]any, mapping propMapping, query ListQuer Data: statsData, Meta: &listMeta{ Distinct: distinct, - Total: len(items), + Total: intPtr(len(items)), }, } } @@ -125,3 +125,15 @@ func newListResponse(items []map[string]any, mapping propMapping, query ListQuer return response } + +func intPtr(n int) *int { return &n } + +// withTotal sets meta.total, the number of rows of the list without pagination, +// as the historical collector returned it along with every paginated answer. A +// response without meta is left alone: meta=false asks for the rows only. +func (r listResponse) withTotal(total *int) listResponse { + if r.Meta != nil && total != nil { + r.Meta.Total = total + } + return r +} diff --git a/server/handlers/network_segments.go b/server/handlers/network_segments.go new file mode 100644 index 00000000..6d8d9ea2 --- /dev/null +++ b/server/handlers/network_segments.go @@ -0,0 +1,152 @@ +package serverhandlers + +import ( + "context" + "fmt" + "net/http" + "net/netip" + "slices" + "strconv" + "strings" + + "github.com/labstack/echo/v4" + + "github.com/opensvc/oc3/cdb" + "github.com/opensvc/oc3/server" + "github.com/opensvc/oc3/util/echolog" + "github.com/opensvc/oc3/util/logkey" +) + +// GetNetworks handles GET /networks: the declared networks. +func (a *Api) GetNetworks(c echo.Context, params server.GetNetworksParams) error { + return a.handleList(c, "GetNetworks", "network", + listParams(params.Props, params.Limit, params.Offset, params.Meta, params.Stats, params.Orderby, params.Groupby, params.Filter), + func(ctx context.Context, p cdb.ListParams) ([]map[string]any, error) { + return a.ODB.GetNetworks(ctx, p) + }) +} + +// PostNetworkSegments handles POST /networks/{net_id}/segments: declare an +// address range of a network, as the historical collector's +// rest_post_network_segments did. The caller's primary group becomes +// responsible for the segment. +func (a *Api) PostNetworkSegments(c echo.Context, netId string) error { + log := echolog.GetLogHandler(c, "PostNetworkSegments") + odb := a.ODB + ctx, cancel := context.WithTimeout(c.Request().Context(), a.SyncTimeout) + defer cancel() + + if err := requireNetworkManager(c); err != nil { + return err + } + netID, err := strconv.Atoi(netId) + if err != nil { + return JSONProblemf(c, http.StatusBadRequest, "network id must be an integer, got %q", netId) + } + + var body server.PostNetworkSegmentsJSONRequestBody + if err := c.Bind(&body); err != nil { + log.Error("invalid request body", logkey.Error, err) + return JSONProblem(c, http.StatusBadRequest, err.Error()) + } + + network, found, err := odb.GetNetworkRange(ctx, netID) + if err != nil { + log.Error("cannot read network", logkey.Error, err) + return JSONProblemf(c, http.StatusInternalServerError, "cannot read network") + } + if !found { + return JSONProblemf(c, http.StatusNotFound, "network %d not found", netID) + } + // Only the team responsible for the network carves it up, or a manager. + if !IsManager(c) && !slices.Contains(UserGroupsFromContext(c), network.TeamResponsible) { + return JSONProblemf(c, http.StatusForbidden, "not responsible for network %d", netID) + } + + segType := "static" + if body.SegType != nil && *body.SegType != "" { + segType = string(*body.SegType) + } + if segType != "static" && segType != "dynamic" { + return JSONProblemf(c, http.StatusBadRequest, "seg_type must be static or dynamic, got %q", segType) + } + + // The overlap check compares addresses with INET_ATON: IPv4 only, like networks. + netBegin, errB := netip.ParseAddr(network.Begin) + netEnd, errE := netip.ParseAddr(network.End) + if errB != nil || errE != nil { + return JSONProblemf(c, http.StatusConflict, "network %d has no usable range", netID) + } + parse := func(name, value string) (netip.Addr, error) { + addr, err := netip.ParseAddr(strings.TrimSpace(value)) + if err != nil || !addr.Is4() { + return addr, fmt.Errorf("%s must be an IPv4 address, got %q", name, value) + } + if addr.Less(netBegin) || netEnd.Less(addr) { + return addr, fmt.Errorf("%s %s is outside the network range %s - %s", name, addr, netBegin, netEnd) + } + return addr, nil + } + begin, err := parse("seg_begin", body.SegBegin) + if err != nil { + return JSONProblem(c, http.StatusBadRequest, err.Error()) + } + end, err := parse("seg_end", body.SegEnd) + if err != nil { + return JSONProblem(c, http.StatusBadRequest, err.Error()) + } + if end.Less(begin) { + return JSONProblemf(c, http.StatusBadRequest, "seg_end %s is before seg_begin %s", end, begin) + } + + otherID, taken, err := odb.NetworkSegmentOverlapping(ctx, netID, begin.String(), end.String()) + if err != nil { + log.Error("cannot check segment overlap", logkey.Error, err) + return JSONProblemf(c, http.StatusInternalServerError, "cannot check segment overlap") + } + if taken { + return JSONProblemf(c, http.StatusConflict, "range %s - %s overlaps segment %d", begin, end, otherID) + } + + var groupID *int64 + if userID := authUserID(c); userID != nil { + id, found, err := odb.UserPrimaryGroupID(ctx, *userID) + if err != nil { + log.Error("cannot get primary group", logkey.Error, err) + return JSONProblemf(c, http.StatusInternalServerError, "cannot get primary group") + } + if found { + groupID = &id + } + } + + prefix := fmt.Sprintf("%s/%d", network.Network, network.Netmask) + log.Info("called", "network", prefix, "begin", begin.String(), "end", end.String()) + + id, err := odb.InsertNetworkSegment(ctx, netID, segType, begin.String(), end.String(), groupID) + if err != nil { + log.Error("cannot create segment", logkey.Error, err) + return JSONProblemf(c, http.StatusInternalServerError, "cannot create segment") + } + + userEmail, _ := c.Get(XUserEmail).(string) + if logErr := odb.Log(ctx, cdb.LogEntry{ + Action: "networks.segment.create", + User: userEmail, + Fmt: "created %(type)s segment %(begin)s-%(end)s of network %(network)s", + Dict: map[string]any{"type": segType, "begin": begin.String(), "end": end.String(), "network": prefix}, + Level: "info", + }); logErr != nil { + log.Error("cannot write audit log", logkey.Error, logErr) + } + if err := odb.Session.NotifyChanges(ctx); err != nil { + log.Error("cannot notify changes", logkey.Error, err) + } + + row, err := odb.GetNetworkSegmentRow(ctx, id) + if err != nil || row == nil { + log.Error("cannot read the created segment", "id", id, logkey.Error, err) + return JSONProblemf(c, http.StatusInternalServerError, "segment %d created but cannot be read back", id) + } + return c.JSON(http.StatusOK, map[string]any{"data": []any{row}, "info": fmt.Sprintf("segment %d created", id)}) +} diff --git a/server/handlers/node_fields.go b/server/handlers/node_fields.go index 4e272531..ba072ba8 100644 --- a/server/handlers/node_fields.go +++ b/server/handlers/node_fields.go @@ -92,7 +92,15 @@ func (f nodeBodyFields) toFields() map[string]any { } setBool := func(key string, v *bool) { if v != nil { - m[key] = *v + // These columns are varchar(1) holding the collector's "T"/"F" + // convention: alertd matches notifications="T" OR NULL. Writing a Go + // bool stores "1"/"0", which matches neither and silently disables + // notifications for the node. + if *v { + m[key] = "T" + } else { + m[key] = "F" + } } } setStr("nodename", f.Nodename) diff --git a/server/handlers/post_filter.go b/server/handlers/post_filter.go index 477a6192..55e2967b 100644 --- a/server/handlers/post_filter.go +++ b/server/handlers/post_filter.go @@ -5,6 +5,7 @@ import ( "database/sql" "fmt" "net/http" + "slices" "strconv" "strings" @@ -53,12 +54,67 @@ func (a *Api) PostFilter(c echo.Context, filterId string) error { return JSONProblemf(c, http.StatusNotFound, "filter %d not found", id) } + // f_label and f_cksum are generated columns, computed from the definition. + if body.FLabel != nil { + return JSONProblemf(c, http.StatusBadRequest, "f_label is computed from the filter definition and cannot be set") + } + + // Validate the definition the filter will have once modified, with the same + // rules as POST /filters: a filter on an unknown table, column or operator would + // break the filtersets it is attached to. + fTable, fField, fOp, fValue := row.FTable, row.FField, row.FOp, row.FValue + if body.FTable != nil { + fTable = *body.FTable + } + if body.FField != nil { + fField = *body.FField + } + if body.FOp != nil { + fOp = strings.ToUpper(string(*body.FOp)) + } + if body.FValue != nil { + fValue = *body.FValue + } + switch { + case fTable == "": + return JSONProblemf(c, http.StatusBadRequest, "f_table is mandatory") + case fField == "": + return JSONProblemf(c, http.StatusBadRequest, "f_field is mandatory") + case fOp == "": + return JSONProblemf(c, http.StatusBadRequest, "f_op is mandatory") + case fValue == "": + return JSONProblemf(c, http.StatusBadRequest, "f_value is mandatory") + } + if !slices.Contains(filterTables, fTable) { + return JSONProblemf(c, http.StatusBadRequest, "f_table must be one of %s", strings.Join(filterTables, ", ")) + } + if !slices.Contains(filterOperators, fOp) { + return JSONProblemf(c, http.StatusBadRequest, "f_op must be one of %s", strings.Join(filterOperators, ", ")) + } + columnFound, err := odb.ColumnExists(ctx, fTable, fField) + if err != nil { + log.Error("cannot check filter field", "f_table", fTable, "f_field", fField, logkey.Error, err) + return JSONProblemf(c, http.StatusInternalServerError, "cannot check filter field") + } + if !columnFound { + return JSONProblemf(c, http.StatusBadRequest, "field not found in model's table") + } + existingID, exists, err := odb.FilterByDefinition(ctx, fTable, fField, fOp, fValue) + if err != nil { + log.Error("cannot check filter existence", logkey.Error, err) + return JSONProblemf(c, http.StatusInternalServerError, "cannot check filter existence") + } + if exists && existingID != id { + return JSONProblemf(c, http.StatusConflict, "a filter with the same definition already exists: %d", existingID) + } + fields := cdb.UpdateFilterFields{ FTable: body.FTable, FField: body.FField, - FOp: body.FOp, FValue: body.FValue, - FLabel: body.FLabel, + } + if body.FOp != nil { + fields.FOp = &fOp } changes := []string{} @@ -69,41 +125,41 @@ func (a *Api) PostFilter(c echo.Context, filterId string) error { changes = append(changes, fmt.Sprintf("f_field: %s => %s", row.FField, *body.FField)) } if body.FOp != nil { - changes = append(changes, fmt.Sprintf("f_op: %s => %s", row.FOp, *body.FOp)) + changes = append(changes, fmt.Sprintf("f_op: %s => %s", row.FOp, fOp)) } if body.FValue != nil { changes = append(changes, fmt.Sprintf("f_value: %s => %s", row.FValue, *body.FValue)) } - if body.FLabel != nil { - changes = append(changes, fmt.Sprintf("f_label: %s => %s", row.FLabel, *body.FLabel)) - } userEmail, _ := c.Get(XUserEmail).(string) - tx, markSuccess, endTx, err := odb.BeginTxWithControl(ctx, log, &sql.TxOptions{}) - if err != nil { - log.Error("cannot start transaction", logkey.Error, err) - return JSONProblemf(c, http.StatusInternalServerError, "cannot update filter") - } - defer endTx() - - if err := tx.UpdateFilter(ctx, id, fields, userEmail); err != nil { + // The transaction ends before the modified filter is read back: a read done + // while it is still open, on another connection, returns the previous values. + if err := func() error { + tx, markSuccess, endTx, err := odb.BeginTxWithControl(ctx, log, &sql.TxOptions{}) + if err != nil { + return fmt.Errorf("cannot start transaction: %w", err) + } + defer endTx() + if err := tx.UpdateFilter(ctx, id, fields, userEmail); err != nil { + return err + } + if logErr := tx.Log(ctx, cdb.LogEntry{ + Action: "filter.change", + User: userEmail, + Fmt: "change filter %(data)s", + Dict: map[string]any{"data": strings.Join(changes, ", ")}, + Level: "info", + }); logErr != nil { + log.Error("cannot write audit log", logkey.Error, logErr) + } + markSuccess() + return nil + }(); err != nil { log.Error("cannot update filter", "filter_id", id, logkey.Error, err) return JSONProblemf(c, http.StatusInternalServerError, "cannot update filter") } - if logErr := tx.Log(ctx, cdb.LogEntry{ - Action: "filter.change", - User: userEmail, - Fmt: "change filter %(data)s", - Dict: map[string]any{"data": strings.Join(changes, ", ")}, - Level: "info", - }); logErr != nil { - log.Error("cannot write audit log", logkey.Error, logErr) - } - - markSuccess() - if err := odb.Session.NotifyChanges(ctx); err != nil { log.Error("cannot notify changes", logkey.Error, err) } diff --git a/server/handlers/post_filters.go b/server/handlers/post_filters.go index 87723cdf..a4862a74 100644 --- a/server/handlers/post_filters.go +++ b/server/handlers/post_filters.go @@ -32,6 +32,13 @@ var filterTables = []string{ var filterOperators = []string{"=", "LIKE", ">", ">=", "<", "<=", "IN"} +// filtersetLogOps are the logical operators joining an entry of a filterset to the +// previous one, as in the historical collector (gen_filtersets_filters.f_log_op). +var filtersetLogOps = []string{"AND", "AND NOT", "OR", "OR NOT"} + +// filtersetStatsValues are the accepted values of gen_filtersets.fset_stats. +var filtersetStatsValues = []string{"T", "F"} + // PostFilters handles POST /filters func (a *Api) PostFilters(c echo.Context) error { log := echolog.GetLogHandler(c, "PostFilters") diff --git a/server/handlers/post_filterset.go b/server/handlers/post_filterset.go index a0942926..9d71c6f6 100644 --- a/server/handlers/post_filterset.go +++ b/server/handlers/post_filterset.go @@ -6,6 +6,7 @@ import ( "fmt" "log/slog" "net/http" + "slices" "strconv" "strings" @@ -35,7 +36,7 @@ func (a *Api) PostFilterset(c echo.Context, filtersetId string) error { log.Info("called", "filterset_id", filtersetId) - return a.postFiltersetUpdate(c, log, ctx, filtersetId, body.FsetName, body.FsetStats) + return a.postFiltersetUpdate(c, log, ctx, filtersetId, body.FsetName, stringPtr(body.FsetStats)) } func (a *Api) postFiltersetUpdate(c echo.Context, log *slog.Logger, ctx context.Context, filtersetId string, fsetName, fsetStats *string) error { @@ -68,6 +69,23 @@ func (a *Api) postFiltersetUpdate(c echo.Context, log *slog.Logger, ctx context. return a.handleItem(c, "PostFilterset", "filterset", "id", strconv.Itoa(id), listEndpointParams{}, getFilterset) } + if fsetStats != nil && !slices.Contains(filtersetStatsValues, *fsetStats) { + return JSONProblemf(c, http.StatusBadRequest, "fset_stats must be one of %s", strings.Join(filtersetStatsValues, ", ")) + } + if fsetName != nil { + if *fsetName == "" { + return JSONProblemf(c, http.StatusBadRequest, "fset_name cannot be empty") + } + otherID, taken, err := odb.FiltersetByName(ctx, *fsetName) + if err != nil { + log.Error("cannot check filterset name", "fset_name", *fsetName, logkey.Error, err) + return JSONProblemf(c, http.StatusInternalServerError, "cannot check filterset name") + } + if taken && otherID != id { + return JSONProblemf(c, http.StatusConflict, "a filterset named %s already exists: %d", *fsetName, otherID) + } + } + fields := cdb.UpdateFiltersetFields{ FsetName: fsetName, FsetStats: fsetStats, @@ -83,30 +101,33 @@ func (a *Api) postFiltersetUpdate(c echo.Context, log *slog.Logger, ctx context. userEmail, _ := c.Get(XUserEmail).(string) - tx, markSuccess, endTx, err := odb.BeginTxWithControl(ctx, log, &sql.TxOptions{}) - if err != nil { - log.Error("cannot start transaction", logkey.Error, err) - return JSONProblemf(c, http.StatusInternalServerError, "cannot update filterset") - } - defer endTx() - - if err := tx.UpdateFilterset(ctx, id, fields); err != nil { + // The transaction ends before the filterset is read back: a read done while it + // is still open, on another connection, returns the previous values. + if err := func() error { + tx, markSuccess, endTx, err := odb.BeginTxWithControl(ctx, log, &sql.TxOptions{}) + if err != nil { + return fmt.Errorf("cannot start transaction: %w", err) + } + defer endTx() + if err := tx.UpdateFilterset(ctx, id, fields); err != nil { + return err + } + if logErr := tx.Log(ctx, cdb.LogEntry{ + Action: "filterset.change", + User: userEmail, + Fmt: "change filterset %(data)s", + Dict: map[string]any{"data": strings.Join(changes, ", ")}, + Level: "info", + }); logErr != nil { + log.Error("cannot write audit log", logkey.Error, logErr) + } + markSuccess() + return nil + }(); err != nil { log.Error("cannot update filterset", "filterset_id", id, logkey.Error, err) return JSONProblemf(c, http.StatusInternalServerError, "cannot update filterset") } - if logErr := tx.Log(ctx, cdb.LogEntry{ - Action: "filterset.change", - User: userEmail, - Fmt: "change filterset %(data)s", - Dict: map[string]any{"data": strings.Join(changes, ", ")}, - Level: "info", - }); logErr != nil { - log.Error("cannot write audit log", logkey.Error, logErr) - } - - markSuccess() - if err := odb.Session.NotifyChanges(ctx); err != nil { log.Error("cannot notify changes", logkey.Error, err) } @@ -116,10 +137,10 @@ func (a *Api) postFiltersetUpdate(c echo.Context, log *slog.Logger, ctx context. func requireCompManager(c echo.Context) error { if !IsAuthByUser(c) { - return JSONProblemf(c, http.StatusUnauthorized, "user authentication required") + return denyRequest(c, http.StatusUnauthorized, "user authentication required") } if !IsCompManager(c) { - return JSONProblemf(c, http.StatusForbidden, "CompManager privilege required") + return denyRequest(c, http.StatusForbidden, "CompManager privilege required") } return nil } diff --git a/server/handlers/post_filterset_filter.go b/server/handlers/post_filterset_filter.go index e258a845..c6246900 100644 --- a/server/handlers/post_filterset_filter.go +++ b/server/handlers/post_filterset_filter.go @@ -5,6 +5,8 @@ import ( "fmt" "log/slog" "net/http" + "slices" + "strings" "github.com/labstack/echo/v4" @@ -32,10 +34,13 @@ func (a *Api) PostFiltersetFilter(c echo.Context, filtersetId string, fId string log.Info("called", "filterset_id", filtersetId, "f_id", fId) - return a.postFiltersetFilter(c, log, ctx, filtersetId, fId, body.FLogOp, body.FOrder) + return a.postFiltersetFilter(c, log, ctx, filtersetId, fId, stringPtr(body.FLogOp), body.FOrder) } func (a *Api) postFiltersetFilter(c echo.Context, log *slog.Logger, ctx context.Context, filtersetId, fId string, fLogOp *string, fOrder *int) error { + if fLogOp != nil && !slices.Contains(filtersetLogOps, *fLogOp) { + return JSONProblemf(c, http.StatusBadRequest, "f_log_op must be one of %s", strings.Join(filtersetLogOps, ", ")) + } odb := a.ODB fsetID, found, err := odb.FiltersetID(ctx, filtersetId) diff --git a/server/handlers/post_filterset_filterset.go b/server/handlers/post_filterset_filterset.go index c42f60e3..f205835e 100644 --- a/server/handlers/post_filterset_filterset.go +++ b/server/handlers/post_filterset_filterset.go @@ -5,6 +5,8 @@ import ( "fmt" "log/slog" "net/http" + "slices" + "strings" "github.com/labstack/echo/v4" @@ -33,10 +35,13 @@ func (a *Api) PostFiltersetFilterset(c echo.Context, filtersetId string, childId log.Info("called", "filterset_id", filtersetId, "child_id", childId) - return a.postFiltersetFilterset(c, log, ctx, filtersetId, childId, body.FLogOp, body.FOrder) + return a.postFiltersetFilterset(c, log, ctx, filtersetId, childId, stringPtr(body.FLogOp), body.FOrder) } func (a *Api) postFiltersetFilterset(c echo.Context, log *slog.Logger, ctx context.Context, filtersetId, childId string, fLogOp *string, fOrder *int) error { + if fLogOp != nil && !slices.Contains(filtersetLogOps, *fLogOp) { + return JSONProblemf(c, http.StatusBadRequest, "f_log_op must be one of %s", strings.Join(filtersetLogOps, ", ")) + } odb := a.ODB parentID, found, err := odb.FiltersetID(ctx, filtersetId) diff --git a/server/handlers/post_filtersets.go b/server/handlers/post_filtersets.go index be223031..079518fd 100644 --- a/server/handlers/post_filtersets.go +++ b/server/handlers/post_filtersets.go @@ -3,7 +3,9 @@ package serverhandlers import ( "context" "net/http" + "slices" "strconv" + "strings" "github.com/labstack/echo/v4" @@ -30,9 +32,13 @@ func (a *Api) PostFiltersets(c echo.Context) error { return JSONProblem(c, http.StatusBadRequest, err.Error()) } + if body.FsetStats != nil && !slices.Contains(filtersetStatsValues, string(*body.FsetStats)) { + return JSONProblemf(c, http.StatusBadRequest, "fset_stats must be one of %s", strings.Join(filtersetStatsValues, ", ")) + } + if body.Id != nil && *body.Id != "" { log.Info("called", "filterset_id", *body.Id) - return a.postFiltersetUpdate(c, log, ctx, *body.Id, nil, body.FsetStats) + return a.postFiltersetUpdate(c, log, ctx, *body.Id, nil, stringPtr(body.FsetStats)) } if body.FsetName == nil || *body.FsetName == "" { @@ -48,12 +54,12 @@ func (a *Api) PostFiltersets(c echo.Context) error { return JSONProblemf(c, http.StatusInternalServerError, "cannot check filterset existence") } if exists { - return a.postFiltersetUpdate(c, log, ctx, strconv.Itoa(existingID), nil, body.FsetStats) + return a.postFiltersetUpdate(c, log, ctx, strconv.Itoa(existingID), nil, stringPtr(body.FsetStats)) } fsetStats := "F" if body.FsetStats != nil { - fsetStats = *body.FsetStats + fsetStats = string(*body.FsetStats) } userEmail, _ := c.Get(XUserEmail).(string) diff --git a/server/handlers/post_filtersets_filters.go b/server/handlers/post_filtersets_filters.go index 3b90b745..fac7bb3a 100644 --- a/server/handlers/post_filtersets_filters.go +++ b/server/handlers/post_filtersets_filters.go @@ -35,5 +35,5 @@ func (a *Api) PostFiltersetsFilters(c echo.Context) error { log.Info("called", "filterset_id", body.FsetId, "f_id", body.FId) - return a.postFiltersetFilter(c, log, ctx, body.FsetId, body.FId, body.FLogOp, body.FOrder) + return a.postFiltersetFilter(c, log, ctx, body.FsetId, body.FId, stringPtr(body.FLogOp), body.FOrder) } diff --git a/server/handlers/post_filtersets_filtersets.go b/server/handlers/post_filtersets_filtersets.go index 7bf40eee..c401d0b7 100644 --- a/server/handlers/post_filtersets_filtersets.go +++ b/server/handlers/post_filtersets_filtersets.go @@ -35,5 +35,5 @@ func (a *Api) PostFiltersetsFiltersets(c echo.Context) error { log.Info("called", "parent_fset_id", body.ParentFsetId, "child_fset_id", body.ChildFsetId) - return a.postFiltersetFilterset(c, log, ctx, body.ParentFsetId, body.ChildFsetId, body.FLogOp, body.FOrder) + return a.postFiltersetFilterset(c, log, ctx, body.ParentFsetId, body.ChildFsetId, stringPtr(body.FLogOp), body.FOrder) } diff --git a/server/handlers/post_group.go b/server/handlers/post_group.go index a0abd95a..0b4e1406 100644 --- a/server/handlers/post_group.go +++ b/server/handlers/post_group.go @@ -19,12 +19,12 @@ import ( func requireGroupPrivilege(c echo.Context, privilege *string) error { if privilege != nil && (*privilege == "T" || *privilege == "true") { if !IsManager(c) { - return JSONProblemf(c, http.StatusForbidden, "Manager privilege required") + return denyRequest(c, http.StatusForbidden, "Manager privilege required") } return nil } if !IsGroupManager(c) { - return JSONProblemf(c, http.StatusForbidden, "GroupManager privilege required") + return denyRequest(c, http.StatusForbidden, "GroupManager privilege required") } return nil } diff --git a/server/handlers/post_networks.go b/server/handlers/post_networks.go new file mode 100644 index 00000000..62d65583 --- /dev/null +++ b/server/handlers/post_networks.go @@ -0,0 +1,165 @@ +package serverhandlers + +import ( + "context" + "fmt" + "net/http" + "net/netip" + "strings" + + "github.com/labstack/echo/v4" + + "github.com/opensvc/oc3/cdb" + "github.com/opensvc/oc3/server" + "github.com/opensvc/oc3/util/echolog" + "github.com/opensvc/oc3/util/logkey" +) + +func IsNetworkManager(c echo.Context) bool { + return IsManager(c) || HasGroup(c, "NetworkManager") +} + +func requireNetworkManager(c echo.Context) error { + if !IsAuthByUser(c) { + return denyRequest(c, http.StatusUnauthorized, "user authentication required") + } + if !IsNetworkManager(c) { + return denyRequest(c, http.StatusForbidden, "NetworkManager privilege required") + } + return nil +} + +// PostNetworks handles POST /networks: declare a network, as the historical +// collector's rest_post_networks did. +func (a *Api) PostNetworks(c echo.Context) error { + log := echolog.GetLogHandler(c, "PostNetworks") + odb := a.ODB + ctx, cancel := context.WithTimeout(c.Request().Context(), a.SyncTimeout) + defer cancel() + + if err := requireNetworkManager(c); err != nil { + return err + } + + var body server.PostNetworksJSONRequestBody + if err := c.Bind(&body); err != nil { + log.Error("invalid request body", logkey.Error, err) + return JSONProblem(c, http.StatusBadRequest, err.Error()) + } + + // The begin, end and broadcast columns are computed with inet_aton: IPv4 only. + addr, err := netip.ParseAddr(strings.TrimSpace(body.Network)) + if err != nil || !addr.Is4() { + return JSONProblemf(c, http.StatusBadRequest, "network must be an IPv4 address, got %q", body.Network) + } + if body.Netmask < 0 || body.Netmask > 32 { + return JSONProblemf(c, http.StatusBadRequest, "netmask must be a prefix length between 0 and 32") + } + prefix := netip.PrefixFrom(addr, body.Netmask) + if masked := prefix.Masked(); masked.Addr() != addr { + return JSONProblemf(c, http.StatusBadRequest, "%s is not a network address, did you mean %s?", prefix, masked) + } + + insert := cdb.NetworkInsert{Network: addr.String(), Netmask: body.Netmask} + + if body.Gateway != nil && strings.TrimSpace(*body.Gateway) != "" { + gw, err := netip.ParseAddr(strings.TrimSpace(*body.Gateway)) + if err != nil || !gw.Is4() || !prefix.Contains(gw) { + return JSONProblemf(c, http.StatusBadRequest, "gateway must be an IPv4 address inside %s", prefix) + } + s := gw.String() + insert.Gateway = &s + } + if body.Prio != nil { + if *body.Prio < 0 || *body.Prio > 99 { + return JSONProblemf(c, http.StatusBadRequest, "prio must be between 0 and 99") + } + insert.Prio = *body.Prio + } + if body.Pvid != nil { + if *body.Pvid < 0 || *body.Pvid > 4094 { + return JSONProblemf(c, http.StatusBadRequest, "pvid must be a VLAN id between 0 and 4094") + } + insert.Pvid = body.Pvid + } + if body.Comment != nil && *body.Comment != "" { + insert.Comment = body.Comment + } + + if body.Name != nil && strings.TrimSpace(*body.Name) != "" { + name := strings.TrimSpace(*body.Name) + otherID, taken, err := odb.NetworkIDByName(ctx, name) + if err != nil { + log.Error("cannot check network name", logkey.Error, err) + return JSONProblemf(c, http.StatusInternalServerError, "cannot check network name") + } + if taken { + return JSONProblemf(c, http.StatusConflict, "a network named %s already exists: %d", name, otherID) + } + insert.Name = &name + } + otherID, taken, err := odb.NetworkIDByAddress(ctx, insert.Network, insert.Netmask) + if err != nil { + log.Error("cannot check network address", logkey.Error, err) + return JSONProblemf(c, http.StatusInternalServerError, "cannot check network address") + } + if taken { + return JSONProblemf(c, http.StatusConflict, "network %s is already declared: %d", prefix, otherID) + } + + // The responsible team defaults to the caller's primary group. + if body.TeamResponsible != nil && strings.TrimSpace(*body.TeamResponsible) != "" { + team := strings.TrimSpace(*body.TeamResponsible) + ok, err := odb.IsAssignableTeam(ctx, team) + if err != nil { + log.Error("cannot check team", logkey.Error, err) + return JSONProblemf(c, http.StatusInternalServerError, "cannot check team") + } + if !ok { + return JSONProblemf(c, http.StatusBadRequest, "team_responsible must be an existing organisational group, got %q", team) + } + insert.TeamResponsible = &team + } else if userID := authUserID(c); userID != nil { + role, found, err := odb.UserPrimaryGroupRole(ctx, *userID) + if err != nil { + log.Error("cannot get primary group", logkey.Error, err) + return JSONProblemf(c, http.StatusInternalServerError, "cannot get primary group") + } + if found { + insert.TeamResponsible = &role + } + } + + log.Info("called", "network", prefix.String()) + + id, err := odb.InsertNetwork(ctx, insert) + if err != nil { + log.Error("cannot create network", logkey.Error, err) + return JSONProblemf(c, http.StatusInternalServerError, "cannot create network") + } + + userEmail, _ := c.Get(XUserEmail).(string) + name := "" + if insert.Name != nil { + name = *insert.Name + } + if logErr := odb.Log(ctx, cdb.LogEntry{ + Action: "networks.create", + User: userEmail, + Fmt: "created network %(name)s %(network)s", + Dict: map[string]any{"name": name, "network": prefix.String()}, + Level: "info", + }); logErr != nil { + log.Error("cannot write audit log", logkey.Error, logErr) + } + if err := odb.Session.NotifyChanges(ctx); err != nil { + log.Error("cannot notify changes", logkey.Error, err) + } + + row, err := odb.GetNetworkRow(ctx, id) + if err != nil || row == nil { + log.Error("cannot read the created network", "id", id, logkey.Error, err) + return JSONProblemf(c, http.StatusInternalServerError, "network %d created but cannot be read back", id) + } + return c.JSON(http.StatusOK, map[string]any{"data": []any{row}, "info": fmt.Sprintf("network %d created", id)}) +} diff --git a/server/handlers/post_obsolescence_setting.go b/server/handlers/post_obsolescence_setting.go index eff41de2..5e0ed411 100644 --- a/server/handlers/post_obsolescence_setting.go +++ b/server/handlers/post_obsolescence_setting.go @@ -8,6 +8,7 @@ import ( "net/http" "strconv" "strings" + "time" "github.com/labstack/echo/v4" @@ -19,10 +20,10 @@ import ( func requireObsManager(c echo.Context) error { if !IsAuthByUser(c) { - return JSONProblemf(c, http.StatusUnauthorized, "user authentication required") + return denyRequest(c, http.StatusUnauthorized, "user authentication required") } if !IsObsManager(c) { - return JSONProblemf(c, http.StatusForbidden, "ObsManager privilege required") + return denyRequest(c, http.StatusForbidden, "ObsManager privilege required") } return nil } @@ -60,6 +61,13 @@ func (a *Api) postObsolescenceSettingUpdate(c echo.Context, ctx context.Context, return JSONProblemf(c, http.StatusNotFound, "obsolescence setting %s not found", id) } + if _, err := parseObsDate(obsWarnDate); err != nil { + return JSONProblemf(c, http.StatusBadRequest, "invalid obs_warn_date: %s", err) + } + if _, err := parseObsDate(obsAlertDate); err != nil { + return JSONProblemf(c, http.StatusBadRequest, "invalid obs_alert_date: %s", err) + } + changes := []string{} if obsWarnDate != nil { changes = append(changes, fmt.Sprintf("obs_warn_date: %s => %s", row.ObsWarnDate.String, *obsWarnDate)) @@ -78,23 +86,20 @@ func (a *Api) postObsolescenceSettingUpdate(c echo.Context, ctx context.Context, return JSONProblemf(c, http.StatusInternalServerError, "cannot update obsolescence setting") } - if obsWarnDate != nil { - newWarn := sql.NullString{String: *obsWarnDate, Valid: true} - if err := odb.UpdateNodeObsolescenceDates(ctx, row.ObsType, row.ObsName, newWarn, row.ObsAlertDate); err != nil { + // The nodes take the setting's dates as now stored, both at once. + if obsWarnDate != nil || obsAlertDate != nil { + if err := odb.SyncNodeObsolescenceDates(ctx, row.ID, row.ObsType); err != nil { log.Error("cannot update node obsolescence dates", "id", row.ID, logkey.Error, err) return JSONProblemf(c, http.StatusInternalServerError, "cannot update node obsolescence dates") } + } + if obsWarnDate != nil { if err := odb.DeleteDashObsWithout(ctx, row.ObsName, row.ObsType, "warn"); err != nil { log.Error("cannot clean up obsolescence dashboard alerts", "id", row.ID, logkey.Error, err) return JSONProblemf(c, http.StatusInternalServerError, "cannot clean up obsolescence dashboard alerts") } } if obsAlertDate != nil { - newAlert := sql.NullString{String: *obsAlertDate, Valid: true} - if err := odb.UpdateNodeObsolescenceDates(ctx, row.ObsType, row.ObsName, row.ObsWarnDate, newAlert); err != nil { - log.Error("cannot update node obsolescence dates", "id", row.ID, logkey.Error, err) - return JSONProblemf(c, http.StatusInternalServerError, "cannot update node obsolescence dates") - } if err := odb.DeleteDashObsWithout(ctx, row.ObsName, row.ObsType, "alert"); err != nil { log.Error("cannot clean up obsolescence dashboard alerts", "id", row.ID, logkey.Error, err) return JSONProblemf(c, http.StatusInternalServerError, "cannot clean up obsolescence dashboard alerts") @@ -146,3 +151,21 @@ func (a *Api) postObsolescenceSettingUpdate(c echo.Context, ctx context.Context, return odb.GetObsolescenceSetting(ctx, idStr, p) }) } + +// obsDateLayouts are the date forms accepted for obsolescence dates: a calendar +// date, or the "YYYY-MM-DD hh:mm:ss" form the settings are listed with. +var obsDateLayouts = []string{"2006-01-02", "2006-01-02 15:04:05"} + +// parseObsDate validates an obsolescence date from a request body. An empty string +// clears the date and maps to NULL: the column is a datetime, which rejects ”. +func parseObsDate(value *string) (sql.NullString, error) { + if value == nil || *value == "" { + return sql.NullString{}, nil + } + for _, layout := range obsDateLayouts { + if _, err := time.Parse(layout, *value); err == nil { + return sql.NullString{String: *value, Valid: true}, nil + } + } + return sql.NullString{}, fmt.Errorf("%q is not a YYYY-MM-DD or YYYY-MM-DD hh:mm:ss date", *value) +} diff --git a/server/handlers/post_user.go b/server/handlers/post_user.go new file mode 100644 index 00000000..3f406f49 --- /dev/null +++ b/server/handlers/post_user.go @@ -0,0 +1,160 @@ +package serverhandlers + +import ( + "context" + "net/http" + "net/mail" + "strconv" + "strings" + "unicode/utf8" + + "github.com/labstack/echo/v4" + + "github.com/opensvc/oc3/cdb" + "github.com/opensvc/oc3/server" + "github.com/opensvc/oc3/util/echolog" + "github.com/opensvc/oc3/util/logkey" +) + +// The widths of the auth_user columns. +const ( + maxUserNameLength = 128 + maxUserEmailLength = 512 +) + +// PostUser handles POST /users/{user_id}: the first name, last name or email of +// a user. Any signed-in user may change their own, as the profile form of the +// historical collector allows; another user's requires the UserManager +// privilege (or Manager), as rest_post_user did. The email is the sign-in name, +// unique among users; the change is logged with the fields changed. +func (a *Api) PostUser(c echo.Context, userId string) error { + log := echolog.GetLogHandler(c, "PostUser") + ctx, cancel := context.WithTimeout(c.Request().Context(), a.SyncTimeout) + defer cancel() + odb := a.ODB + + if !IsAuthByUser(c) { + return JSONProblemf(c, http.StatusUnauthorized, "user authentication required") + } + selfID := authUserID(c) + if selfID == nil { + return JSONProblemf(c, http.StatusUnauthorized, "user authentication required") + } + callerEmail, _ := c.Get(XUserEmail).(string) + targetID := *selfID + if userId != "self" && userId != strconv.FormatInt(*selfID, 10) && userId != callerEmail { + if !IsManager(c) && !HasGroup(c, "UserManager") { + return JSONProblemf(c, http.StatusForbidden, "the UserManager privilege is required to change another user") + } + id, found, err := odb.UserIDForPrefs(ctx, userId, cdb.ListParams{ + Groups: UserGroupsFromContext(c), IsManager: IsManager(c), UserID: selfID, + }) + if err != nil { + log.Error("cannot resolve user", logkey.Error, err) + return JSONProblemf(c, http.StatusInternalServerError, "cannot resolve the user") + } + if !found { + return JSONProblemf(c, http.StatusNotFound, "user %s not found", userId) + } + targetID = id + } + + var body server.PostUserJSONRequestBody + if err := c.Bind(&body); err != nil { + return JSONProblem(c, http.StatusBadRequest, err.Error()) + } + + current, found, err := odb.GetUserIdentity(ctx, targetID) + if err != nil { + log.Error("cannot read user", logkey.Error, err) + return JSONProblemf(c, http.StatusInternalServerError, "cannot read the user") + } + if !found { + return JSONProblemf(c, http.StatusNotFound, "user %d not found", targetID) + } + + next := current + var changed []string + // setName applies a name given in the body, false when it is too long. + setName := func(field string, value *string, target *string) bool { + if value == nil { + return true + } + v := strings.TrimSpace(*value) + if utf8.RuneCountInString(v) > maxUserNameLength { + return false + } + if v != *target { + *target = v + changed = append(changed, field) + } + return true + } + for _, name := range []struct { + field string + value *string + target *string + }{ + {"first_name", body.FirstName, &next.FirstName}, + {"last_name", body.LastName, &next.LastName}, + } { + if !setName(name.field, name.value, name.target) { + return JSONProblemf(c, http.StatusBadRequest, "%s must be at most %d characters long", name.field, maxUserNameLength) + } + } + if body.Email != nil { + email := strings.TrimSpace(*body.Email) + if addr, err := mail.ParseAddress(email); err != nil || addr.Address != email { + return JSONProblemf(c, http.StatusBadRequest, "email must be a valid address, got %q", *body.Email) + } + if utf8.RuneCountInString(email) > maxUserEmailLength { + return JSONProblemf(c, http.StatusBadRequest, "email must be at most %d characters long", maxUserEmailLength) + } + if !strings.EqualFold(email, current.Email) { + otherID, taken, err := odb.UserIDByEmail(ctx, email) + if err != nil { + log.Error("cannot check email", logkey.Error, err) + return JSONProblemf(c, http.StatusInternalServerError, "cannot check email") + } + if taken && otherID != targetID { + return JSONProblemf(c, http.StatusConflict, "another user already has the email %s", email) + } + } + if email != current.Email { + next.Email = email + changed = append(changed, "email") + } + } + + if len(changed) > 0 { + if err := odb.SetUserIdentity(ctx, targetID, next); err != nil { + log.Error("cannot store user", logkey.Error, err) + return JSONProblemf(c, http.StatusInternalServerError, "cannot store the user") + } + format := "change user %(email)s: %(fields)s" + dict := map[string]any{"email": current.Email, "fields": strings.Join(changed, ", ")} + if next.Email != current.Email { + format = "change user %(email)s: %(fields)s, email now %(new_email)s" + dict["new_email"] = next.Email + } + if logErr := odb.Log(ctx, cdb.LogEntry{ + Action: "user.change", + User: callerEmail, + Fmt: format, + Dict: dict, + Level: "info", + }); logErr != nil { + log.Error("cannot write audit log", logkey.Error, logErr) + } + if err := odb.Session.NotifyChanges(ctx); err != nil { + log.Error("cannot notify changes", logkey.Error, err) + } + log.Info("user changed", "fields", strings.Join(changed, ",")) + } + + id := strconv.FormatInt(targetID, 10) + return a.handleItem(c, "PostUser", "user", "user_id", id, listEndpointParams{props: &userCreatedProps, withUserID: true}, + func(ctx context.Context, p cdb.ListParams) ([]map[string]any, error) { + return odb.GetUser(ctx, id, p) + }) +} diff --git a/server/handlers/post_user_password.go b/server/handlers/post_user_password.go new file mode 100644 index 00000000..e9cf1051 --- /dev/null +++ b/server/handlers/post_user_password.go @@ -0,0 +1,84 @@ +package serverhandlers + +import ( + "context" + "net/http" + "unicode/utf8" + + "github.com/labstack/echo/v4" + "github.com/spf13/viper" + + "github.com/opensvc/oc3/cdb" + "github.com/opensvc/oc3/server" + "github.com/opensvc/oc3/util/echolog" + "github.com/opensvc/oc3/util/logkey" + "github.com/opensvc/oc3/xauth" +) + +// minResetPasswordLength is the shortest password accepted when a user changes +// their own, counted in characters rather than bytes. It is stricter than the +// length required at user creation. +const minResetPasswordLength = 12 + +// PostUserSelfPassword handles POST /users/self/password: the caller changes +// their own password, proving they know the current one, as the change_password +// form of the historical collector does. The new one must be at least +// minResetPasswordLength characters long, and is stored as a web2py hash, so +// that both collectors accept it. The change is logged, without the password. +func (a *Api) PostUserSelfPassword(c echo.Context) error { + log := echolog.GetLogHandler(c, "PostUserSelfPassword") + ctx, cancel := context.WithTimeout(c.Request().Context(), a.SyncTimeout) + defer cancel() + + if !IsAuthByUser(c) { + return JSONProblemf(c, http.StatusUnauthorized, "user authentication required") + } + userID := authUserID(c) + if userID == nil { + return JSONProblemf(c, http.StatusUnauthorized, "user authentication required") + } + + var body server.PostUserSelfPasswordJSONRequestBody + if err := c.Bind(&body); err != nil { + return JSONProblem(c, http.StatusBadRequest, err.Error()) + } + if utf8.RuneCountInString(body.NewPassword) < minResetPasswordLength { + return JSONProblemf(c, http.StatusBadRequest, "the new password must be at least %d characters long", minResetPasswordLength) + } + if body.NewPassword == body.CurrentPassword { + return JSONProblemf(c, http.StatusBadRequest, "the new password must differ from the current one") + } + + hmacKey := viper.GetString("w2p_hmac") + stored, found, err := a.ODB.UserPasswordHash(ctx, *userID) + if err != nil { + log.Error("cannot read password", logkey.Error, err) + return JSONProblemf(c, http.StatusInternalServerError, "cannot read the current password") + } + if !found || !xauth.VerifyWeb2pyPassword(body.CurrentPassword, stored, hmacKey) { + return JSONProblemf(c, http.StatusForbidden, "the current password is incorrect") + } + + hash, err := xauth.HashWeb2pyPassword(body.NewPassword, hmacKey) + if err != nil { + log.Error("cannot hash password", logkey.Error, err) + return JSONProblemf(c, http.StatusInternalServerError, "cannot hash password") + } + if err := a.ODB.SetUserPassword(ctx, *userID, hash); err != nil { + log.Error("cannot store password", logkey.Error, err) + return JSONProblemf(c, http.StatusInternalServerError, "cannot store the new password") + } + + userEmail, _ := c.Get(XUserEmail).(string) + if logErr := a.ODB.Log(ctx, cdb.LogEntry{ + Action: "user.change", + User: userEmail, + Fmt: "change user %(email)s: password", + Dict: map[string]any{"email": userEmail}, + Level: "info", + }); logErr != nil { + log.Error("cannot write audit log", logkey.Error, logErr) + } + log.Info("password changed") + return c.JSON(http.StatusOK, map[string]string{"info": "password changed"}) +} diff --git a/server/handlers/post_user_prefs.go b/server/handlers/post_user_prefs.go new file mode 100644 index 00000000..975483ec --- /dev/null +++ b/server/handlers/post_user_prefs.go @@ -0,0 +1,88 @@ +package serverhandlers + +import ( + "context" + "database/sql" + "encoding/json" + "net/http" + + "github.com/labstack/echo/v4" + + "github.com/opensvc/oc3/cdb" + "github.com/opensvc/oc3/server" + "github.com/opensvc/oc3/util/echolog" + "github.com/opensvc/oc3/util/logkey" +) + +// PostUserPrefs handles POST /users/{user_id}/prefs +func (a *Api) PostUserPrefs(c echo.Context, userId string) error { + log := echolog.GetLogHandler(c, "PostUserPrefs") + odb := a.ODB + ctx, cancel := context.WithTimeout(c.Request().Context(), a.SyncTimeout) + defer cancel() + + if !IsAuthByUser(c) { + return JSONProblemf(c, http.StatusUnauthorized, "user authentication required") + } + + var body server.PostUserPrefsJSONRequestBody + if err := c.Bind(&body); err != nil { + log.Error("invalid request body", logkey.Error, err) + return JSONProblem(c, http.StatusBadRequest, err.Error()) + } + if body.Data == nil { + return JSONProblemf(c, http.StatusBadRequest, "The 'data' key is mandatory") + } + + log.Info("called", logkey.UserID, userId) + + // The python handler answers 403 when the target user is unknown or not + // visible, without distinguishing the two. + targetID, found, err := odb.UserIDForPrefs(ctx, userId, cdb.ListParams{ + Groups: UserGroupsFromContext(c), + IsManager: IsManager(c), + UserID: authUserID(c), + }) + if err != nil { + log.Error("cannot resolve user", logkey.UserID, userId, logkey.Error, err) + return JSONProblemf(c, http.StatusInternalServerError, "cannot resolve user") + } + if !found { + return JSONProblemf(c, http.StatusForbidden, "Not authorized") + } + + prefs, err := json.Marshal(body.Data) + if err != nil { + log.Error("cannot encode prefs", logkey.UserID, userId, logkey.Error, err) + return JSONProblemf(c, http.StatusBadRequest, "cannot encode prefs") + } + + tx, markSuccess, endTx, err := odb.BeginTxWithControl(ctx, log, &sql.TxOptions{}) + if err != nil { + log.Error("cannot start transaction", logkey.Error, err) + return JSONProblemf(c, http.StatusInternalServerError, "cannot save user prefs") + } + defer endTx() + + if err := tx.SaveUserPrefs(ctx, targetID, string(prefs)); err != nil { + log.Error("cannot save user prefs", logkey.UserID, targetID, logkey.Error, err) + return JSONProblemf(c, http.StatusInternalServerError, "cannot save user prefs") + } + + markSuccess() + + var uuid string + if body.Uuid != nil { + uuid = *body.Uuid + } + // Publishes the "user_prefs_change" event the python handler sends through + // ws_send (init/models/rest/api_users.py:149). + if err := odb.Session.NotifyTableChangeWithData(ctx, "user_prefs", map[string]any{ + "user_id": targetID, + "uuid": uuid, + }); err != nil { + log.Error("cannot notify user prefs change", logkey.Error, err) + } + + return c.JSON(http.StatusOK, map[string]string{"info": "user prefs saved"}) +} diff --git a/server/handlers/post_users.go b/server/handlers/post_users.go new file mode 100644 index 00000000..0067b11f --- /dev/null +++ b/server/handlers/post_users.go @@ -0,0 +1,152 @@ +package serverhandlers + +import ( + "context" + "database/sql" + "fmt" + "net/http" + "net/mail" + "strconv" + "strings" + + "github.com/labstack/echo/v4" + "github.com/spf13/viper" + + "github.com/opensvc/oc3/cdb" + "github.com/opensvc/oc3/server" + "github.com/opensvc/oc3/util/echolog" + "github.com/opensvc/oc3/util/logkey" + "github.com/opensvc/oc3/xauth" +) + +// minPasswordLength is the shortest password accepted at user creation. +const minPasswordLength = 8 + +// userCreatedProps are the properties returned for a created user: never the +// password, the reset key nor the registration id. +var userCreatedProps = server.InQueryProps("id,email,username,first_name,last_name,phone_work") + +func IsUserManager(c echo.Context) bool { + return IsManager(c) || HasGroup(c, "UserManager") +} + +func requireUserManager(c echo.Context) error { + if !IsAuthByUser(c) { + return denyRequest(c, http.StatusUnauthorized, "user authentication required") + } + if !IsUserManager(c) { + return denyRequest(c, http.StatusForbidden, "UserManager privilege required") + } + return nil +} + +func optionalString(value *string) *string { + if value == nil { + return nil + } + s := strings.TrimSpace(*value) + if s == "" { + return nil + } + return &s +} + +// PostUsers handles POST /users: create a user, as the historical collector's +// rest_post_users did, except that an existing email or username is refused +// instead of silently updated. +func (a *Api) PostUsers(c echo.Context) error { + log := echolog.GetLogHandler(c, "PostUsers") + odb := a.ODB + ctx, cancel := context.WithTimeout(c.Request().Context(), a.SyncTimeout) + defer cancel() + + if err := requireUserManager(c); err != nil { + return err + } + + var body server.PostUsersJSONRequestBody + if err := c.Bind(&body); err != nil { + log.Error("invalid request body", logkey.Error, err) + return JSONProblem(c, http.StatusBadRequest, err.Error()) + } + + email := strings.TrimSpace(body.Email) + if addr, err := mail.ParseAddress(email); err != nil || addr.Address != email { + return JSONProblemf(c, http.StatusBadRequest, "email must be a valid address, got %q", body.Email) + } + insert := cdb.UserInsert{ + Email: email, + Username: optionalString(body.Username), + FirstName: optionalString(body.FirstName), + LastName: optionalString(body.LastName), + PhoneWork: optionalString(body.PhoneWork), + } + + if otherID, taken, err := odb.UserIDByEmail(ctx, email); err != nil { + log.Error("cannot check email", logkey.Error, err) + return JSONProblemf(c, http.StatusInternalServerError, "cannot check email") + } else if taken { + return JSONProblemf(c, http.StatusConflict, "a user with email %s already exists: %d", email, otherID) + } + if insert.Username != nil { + if otherID, taken, err := odb.UserIDByUsername(ctx, *insert.Username); err != nil { + log.Error("cannot check username", logkey.Error, err) + return JSONProblemf(c, http.StatusInternalServerError, "cannot check username") + } else if taken { + return JSONProblemf(c, http.StatusConflict, "a user named %s already exists: %d", *insert.Username, otherID) + } + } + + // Without a password the account exists but cannot sign in, as in the + // historical collector. + if body.Password != nil && *body.Password != "" { + if len(*body.Password) < minPasswordLength { + return JSONProblemf(c, http.StatusBadRequest, "password must be at least %d characters long", minPasswordLength) + } + hash, err := xauth.HashWeb2pyPassword(*body.Password, viper.GetString("w2p_hmac")) + if err != nil { + log.Error("cannot hash password", logkey.Error, err) + return JSONProblemf(c, http.StatusInternalServerError, "cannot hash password") + } + insert.PasswordHash = &hash + } + + log.Info("called", "email", email) + + var userID int64 + if err := func() error { + tx, markSuccess, endTx, err := odb.BeginTxWithControl(ctx, log, &sql.TxOptions{}) + if err != nil { + return fmt.Errorf("cannot start transaction: %w", err) + } + defer endTx() + if userID, err = tx.InsertUserWithPrivateGroup(ctx, insert); err != nil { + return err + } + userEmail, _ := c.Get(XUserEmail).(string) + if logErr := tx.Log(ctx, cdb.LogEntry{ + Action: "user.create", + User: userEmail, + Fmt: "add user %(email)s", + Dict: map[string]any{"email": email}, + Level: "info", + }); logErr != nil { + log.Error("cannot write audit log", logkey.Error, logErr) + } + markSuccess() + return nil + }(); err != nil { + log.Error("cannot create user", "email", email, logkey.Error, err) + return JSONProblemf(c, http.StatusInternalServerError, "cannot create user") + } + + if err := odb.Session.NotifyChanges(ctx); err != nil { + log.Error("cannot notify changes", logkey.Error, err) + } + + id := strconv.FormatInt(userID, 10) + return a.handleItem(c, "PostUsers", "user", "user_id", id, listEndpointParams{props: &userCreatedProps, withUserID: true}, + func(ctx context.Context, p cdb.ListParams) ([]map[string]any, error) { + return odb.GetUser(ctx, id, p) + }) +} diff --git a/server/handlers/problems.go b/server/handlers/problems.go index dd1f98ff..b73c482a 100644 --- a/server/handlers/problems.go +++ b/server/handlers/problems.go @@ -1,14 +1,33 @@ package serverhandlers import ( + "errors" "fmt" + "log/slog" "net/http" "github.com/labstack/echo/v4" "github.com/opensvc/oc3/server" + "github.com/opensvc/oc3/util/logkey" ) +// errRequestDenied is returned by the require* guards after they have written the +// problem response. JSONProblemf returns nil once the response is written, so a +// guard returning its result would let the caller go on with the denied action: +// callers stop on a non-nil error, and echo's error handler leaves the already +// committed response untouched. +var errRequestDenied = errors.New("request denied, problem response sent") + +// denyRequest writes the problem response and returns errRequestDenied, or the +// error that prevented writing the response. +func denyRequest(ctx echo.Context, code int, format string, args ...any) error { + if err := JSONProblemf(ctx, code, format, args...); err != nil { + return err + } + return errRequestDenied +} + func JSONProblemf(ctx echo.Context, code int, format string, args ...any) error { return JSONProblem(ctx, code, fmt.Sprintf(format, args...)) } @@ -20,3 +39,44 @@ func JSONProblem(ctx echo.Context, code int, s string) error { func JSONNodeAuthProblem(c echo.Context) error { return JSONProblem(c, http.StatusForbidden, "expecting node credentials") } + +// stringPtr converts a pointer to a generated enum string type to a *string, +// keeping nil for an absent property. +func stringPtr[T ~string](value *T) *string { + if value == nil { + return nil + } + s := string(*value) + return &s +} + +// httpError is a request refused with an HTTP status, the way the historical +// collector raised HTTP(status, message): the handlers return it, and write it +// once with httpProblem. +type httpError struct { + status int + msg string +} + +func (e *httpError) Error() string { return e.msg } + +func httpErrorf(status int, format string, args ...any) error { + return &httpError{status: status, msg: fmt.Sprintf(format, args...)} +} + +// httpProblem writes the problem response of a refused request: its status for +// an httpError, 500 otherwise. +func httpProblem(c echo.Context, err error) error { + var he *httpError + if errors.As(err, &he) { + return JSONProblem(c, he.status, he.msg) + } + return JSONProblem(c, http.StatusInternalServerError, err.Error()) +} + +// httpInternal logs an internal failure and turns it into a 500 with a +// message that does not leak the database error. +func httpInternal(log *slog.Logger, msg string, err error) error { + log.Error(msg, logkey.Error, err) + return httpErrorf(http.StatusInternalServerError, "%s", msg) +} diff --git a/server/handlers/props_mapping.go b/server/handlers/props_mapping.go index e2abde60..d9a81ef2 100644 --- a/server/handlers/props_mapping.go +++ b/server/handlers/props_mapping.go @@ -3,6 +3,7 @@ package serverhandlers import ( "fmt" + "github.com/opensvc/oc3/cdb" "github.com/opensvc/oc3/schema" ) @@ -75,6 +76,20 @@ var propsMapping = map[string]propMapping{ "node_id": colStr(schema.ActionQueueNodeID), "svc_id": colStr(schema.ActionQueueSvcID), }, + // A queued action points at its node, and at its service when it has one, by + // id only: the names live in the joined tables, as for dashboard entries. + Joins: map[string]JoinDef{ + "nodes": {MappingKey: "node"}, + "services": {MappingKey: "service"}, + }, + }, + "cluster": { + Available: []string{"id", "cluster_id", "cluster_name"}, + Props: map[string]propDef{ + "id": col(schema.ClustersID), + "cluster_id": colStr(schema.ClustersClusterID), + "cluster_name": colStr(schema.ClustersClusterName), + }, }, "node": { Available: []string{ @@ -176,6 +191,11 @@ var propsMapping = map[string]propMapping{ "os_obs_alert_date": colStr(schema.NodesOSObsAlertDate), "updated": colStr(schema.NodesUpdated), }, + // A node names its cluster by id only: the name lives in the joined table, as + // for the node and service names of an instance. + Joins: map[string]JoinDef{ + "clusters": {MappingKey: "cluster"}, + }, }, "disk": { Available: []string{ @@ -231,6 +251,8 @@ var propsMapping = map[string]propMapping{ "app_id": {SQLExpr: "COALESCE(app_id, 0) AS app_id", Kind: "int64"}, }, }, + // Addresses of the nodes, read from the v_nodenetworks view. Each prop keeps + // its expression and names the view column it reads, for sorting and filtering. "node_ip": { Available: []string{ "id", "node_id", "nodename", "intf", "mac", "type", "addr", "mask", "updated", "flag_deprecated", @@ -239,28 +261,28 @@ var propsMapping = map[string]propMapping{ }, Default: []string{"node_id", "intf", "addr", "mask", "net_name", "net_network", "net_netmask", "net_gateway"}, Props: map[string]propDef{ - "id": {SQLExpr: "id", Kind: "int64"}, - "node_id": {SQLExpr: "COALESCE(node_id, '') AS node_id", Kind: "string"}, - "nodename": {SQLExpr: "COALESCE(nodename, '') AS nodename", Kind: "string"}, - "intf": {SQLExpr: "COALESCE(intf, '') AS intf", Kind: "string"}, - "mac": {SQLExpr: "COALESCE(mac, '') AS mac", Kind: "string"}, - "type": {SQLExpr: "COALESCE(addr_type, '') AS type", Kind: "string"}, - "addr": {SQLExpr: "COALESCE(addr, '') AS addr", Kind: "string"}, - "mask": {SQLExpr: "COALESCE(mask, '') AS mask", Kind: "string"}, - "updated": {SQLExpr: "COALESCE(addr_updated, '') AS updated", Kind: "string"}, - "flag_deprecated": {SQLExpr: "COALESCE(flag_deprecated, 0) AS flag_deprecated", Kind: "int64"}, - "net_id": {SQLExpr: "net_id", Kind: "int64"}, - "net_name": {SQLExpr: "COALESCE(net_name, '') AS net_name", Kind: "string"}, - "net_network": {SQLExpr: "COALESCE(net_network, '') AS net_network", Kind: "string"}, - "net_netmask": {SQLExpr: "COALESCE(net_netmask, '') AS net_netmask", Kind: "string"}, - "net_broadcast": {SQLExpr: "COALESCE(net_broadcast, '') AS net_broadcast", Kind: "string"}, - "net_gateway": {SQLExpr: "COALESCE(net_gateway, '') AS net_gateway", Kind: "string"}, - "net_begin": {SQLExpr: "COALESCE(net_begin, '') AS net_begin", Kind: "string"}, - "net_end": {SQLExpr: "COALESCE(net_end, '') AS net_end", Kind: "string"}, - "net_pvid": {SQLExpr: "COALESCE(net_pvid, '') AS net_pvid", Kind: "string"}, - "net_prio": {SQLExpr: "COALESCE(net_prio, 0) AS net_prio", Kind: "int64"}, - "net_comment": {SQLExpr: "COALESCE(net_comment, '') AS net_comment", Kind: "string"}, - "net_team_responsible": {SQLExpr: "COALESCE(net_team_responsible, '') AS net_team_responsible", Kind: "string"}, + "id": {Col: cdb.NodeNetworksCol("id"), SQLExpr: "id", Kind: "int64"}, + "node_id": {Col: cdb.NodeNetworksCol("node_id"), SQLExpr: "COALESCE(node_id, '') AS node_id", Kind: "string"}, + "nodename": {Col: cdb.NodeNetworksCol("nodename"), SQLExpr: "COALESCE(nodename, '') AS nodename", Kind: "string"}, + "intf": {Col: cdb.NodeNetworksCol("intf"), SQLExpr: "COALESCE(intf, '') AS intf", Kind: "string"}, + "mac": {Col: cdb.NodeNetworksCol("mac"), SQLExpr: "COALESCE(mac, '') AS mac", Kind: "string"}, + "type": {Col: cdb.NodeNetworksCol("addr_type"), SQLExpr: "COALESCE(addr_type, '') AS type", Kind: "string"}, + "addr": {Col: cdb.NodeNetworksCol("addr"), SQLExpr: "COALESCE(addr, '') AS addr", Kind: "string"}, + "mask": {Col: cdb.NodeNetworksCol("mask"), SQLExpr: "COALESCE(mask, '') AS mask", Kind: "string"}, + "updated": {Col: cdb.NodeNetworksCol("addr_updated"), SQLExpr: "COALESCE(addr_updated, '') AS updated", Kind: "string"}, + "flag_deprecated": {Col: cdb.NodeNetworksCol("flag_deprecated"), SQLExpr: "COALESCE(flag_deprecated, 0) AS flag_deprecated", Kind: "int64"}, + "net_id": {Col: cdb.NodeNetworksCol("net_id"), SQLExpr: "net_id", Kind: "int64"}, + "net_name": {Col: cdb.NodeNetworksCol("net_name"), SQLExpr: "COALESCE(net_name, '') AS net_name", Kind: "string"}, + "net_network": {Col: cdb.NodeNetworksCol("net_network"), SQLExpr: "COALESCE(net_network, '') AS net_network", Kind: "string"}, + "net_netmask": {Col: cdb.NodeNetworksCol("net_netmask"), SQLExpr: "COALESCE(net_netmask, '') AS net_netmask", Kind: "string"}, + "net_broadcast": {Col: cdb.NodeNetworksCol("net_broadcast"), SQLExpr: "COALESCE(net_broadcast, '') AS net_broadcast", Kind: "string"}, + "net_gateway": {Col: cdb.NodeNetworksCol("net_gateway"), SQLExpr: "COALESCE(net_gateway, '') AS net_gateway", Kind: "string"}, + "net_begin": {Col: cdb.NodeNetworksCol("net_begin"), SQLExpr: "COALESCE(net_begin, '') AS net_begin", Kind: "string"}, + "net_end": {Col: cdb.NodeNetworksCol("net_end"), SQLExpr: "COALESCE(net_end, '') AS net_end", Kind: "string"}, + "net_pvid": {Col: cdb.NodeNetworksCol("net_pvid"), SQLExpr: "COALESCE(net_pvid, '') AS net_pvid", Kind: "string"}, + "net_prio": {Col: cdb.NodeNetworksCol("prio"), SQLExpr: "COALESCE(prio, 0) AS net_prio", Kind: "int64"}, + "net_comment": {Col: cdb.NodeNetworksCol("net_comment"), SQLExpr: "COALESCE(net_comment, '') AS net_comment", Kind: "string"}, + "net_team_responsible": {Col: cdb.NodeNetworksCol("net_team_responsible"), SQLExpr: "COALESCE(net_team_responsible, '') AS net_team_responsible", Kind: "string"}, }, }, "node_interface": { @@ -297,6 +319,11 @@ var propsMapping = map[string]propMapping{ "hw_driver": colStr(schema.NodeHWHWDriver), "updated": colStr(schema.NodeHWUpdated), }, + // A component carries only the node id: its name lives in the joined nodes + // table, as in the historical nodes hardware table. + Joins: map[string]JoinDef{ + "nodes": {MappingKey: "node"}, + }, }, "hba": { Available: []string{"id", "node_id", "hba_id", "hba_type", "updated"}, @@ -363,6 +390,99 @@ var propsMapping = map[string]propMapping{ "description": colStr(schema.AuthGroupDescription), }, }, + // Forms, as the historical collector lists them: form_definition is not a + // column but form_yaml parsed, computed by the forms handlers. + "form": { + Available: []string{ + "id", "form_name", "form_yaml", "form_author", "form_created", + "form_type", "form_folder", "form_definition", + }, + Props: map[string]propDef{ + "id": col(schema.FormsID), + "form_name": colStr(schema.FormsFormName), + "form_yaml": colStr(schema.FormsFormYaml), + "form_author": colStr(schema.FormsFormAuthor), + "form_created": colStr(schema.FormsFormCreated), + "form_type": colStr(schema.FormsFormType), + "form_folder": colStr(schema.FormsFormFolder), + }, + }, + // Form revisions: the definition of a form as submitted, kept by md5. + "form_revision": { + Available: []string{ + "id", "form_yaml", "form_md5", "form_date", "form_id", + "form_folder", "form_name", "form_definition", + }, + Props: map[string]propDef{ + "id": col(schema.FormsRevisionsID), + "form_yaml": colStr(schema.FormsRevisionsFormYaml), + "form_md5": colStr(schema.FormsRevisionsFormMD5), + "form_date": colStr(schema.FormsRevisionsFormDate), + "form_id": col(schema.FormsRevisionsFormID), + "form_folder": colStr(schema.FormsRevisionsFormFolder), + "form_name": colStr(schema.FormsRevisionsFormName), + }, + }, + // Forms stored by workflows, joined to the revision they were submitted with, + // as the historical collector's v_forms_store view does: the revision columns + // keep their own name, flat. + "form_store": { + Available: []string{ + "id", "results_id", "form_submitter", "form_submit_date", "form_data", + "form_next_id", "form_prev_id", "form_assignee", "form_head_id", + "form_md5", "form_var_id", "form_yaml", "form_date", "form_id", + "form_folder", "form_name", "form_definition", + }, + Props: map[string]propDef{ + "id": col(schema.FormsStoreID), + "results_id": col(schema.FormsStoreResultsID), + "form_submitter": colStr(schema.FormsStoreFormSubmitter), + "form_submit_date": colStr(schema.FormsStoreFormSubmitDate), + "form_data": colStr(schema.FormsStoreFormData), + "form_next_id": col(schema.FormsStoreFormNextID), + "form_prev_id": col(schema.FormsStoreFormPrevID), + "form_assignee": colStr(schema.FormsStoreFormAssignee), + "form_head_id": col(schema.FormsStoreFormHeadID), + "form_md5": colStr(schema.FormsStoreFormMD5), + "form_var_id": col(schema.FormsStoreFormVarID), + "form_yaml": colStr(schema.FormsRevisionsFormYaml), + "form_date": colStr(schema.FormsRevisionsFormDate), + "form_id": col(schema.FormsRevisionsFormID), + "form_folder": colStr(schema.FormsRevisionsFormFolder), + "form_name": colStr(schema.FormsRevisionsFormName), + }, + }, + // Workflows chaining stored forms: the requests. form_name, form_folder and + // form_yaml are those of the form revision the request started from, joined + // by form_md5 as in the historical workflows table; they are not among the + // default props, which stay those of the workflows table (the /dump output). + "workflow": { + Available: []string{ + "id", "form_head_id", "status", "steps", "creator", "create_date", + "last_assignee", "last_update", "form_md5", "last_form_id", "last_form_name", + "form_name", "form_folder", "form_yaml", + }, + Default: []string{ + "id", "form_head_id", "status", "steps", "creator", "create_date", + "last_assignee", "last_update", "form_md5", "last_form_id", "last_form_name", + }, + Props: map[string]propDef{ + "id": col(schema.WorkflowsID), + "form_head_id": col(schema.WorkflowsFormHeadID), + "status": colStr(schema.WorkflowsStatus), + "steps": col(schema.WorkflowsSteps), + "creator": colStr(schema.WorkflowsCreator), + "create_date": colStr(schema.WorkflowsCreateDate), + "last_assignee": colStr(schema.WorkflowsLastAssignee), + "last_update": colStr(schema.WorkflowsLastUpdate), + "form_md5": colStr(schema.WorkflowsFormMD5), + "last_form_id": col(schema.WorkflowsLastFormID), + "last_form_name": colStr(schema.WorkflowsLastFormName), + "form_name": colStr(schema.FormsRevisionsFormName), + "form_folder": colStr(schema.FormsRevisionsFormFolder), + "form_yaml": colStr(schema.FormsRevisionsFormYaml), + }, + }, "user": { Available: []string{ "id", "username", "email", "first_name", "last_name", "phone_work", @@ -526,6 +646,45 @@ var propsMapping = map[string]propMapping{ "mon_updated": colStr(schema.SvcmonMonUpdated), "mon_changed": colStr(schema.SvcmonMonChanged), }, + // An instance row carries only the service and node ids: the names live in + // the joined tables, as in the historical collector's svcmon table. + Joins: map[string]JoinDef{ + "nodes": {MappingKey: "node"}, + "services": {MappingKey: "service"}, + }, + }, + // Packages installed on the nodes, as the historical packages table lists them. + // sig_provider names the provider of the signing key, from pkg_sig_provider; + // it is empty when the signature is unknown. + "package": { + Available: []string{ + "id", "node_id", + "pkg_name", "pkg_version", "pkg_arch", "pkg_type", + "pkg_sig", "sig_provider", + "pkg_install_date", "pkg_updated", + }, + Default: []string{ + "id", "node_id", + "pkg_name", "pkg_version", "pkg_arch", "pkg_type", + "sig_provider", "pkg_install_date", "pkg_updated", + }, + Props: map[string]propDef{ + "id": col(schema.PackagesID), + "node_id": colStr(schema.PackagesNodeID), + "pkg_name": colStr(schema.PackagesPkgName), + "pkg_version": colStr(schema.PackagesPkgVersion), + "pkg_arch": colStr(schema.PackagesPkgArch), + "pkg_type": colStr(schema.PackagesPkgType), + "pkg_sig": colStr(schema.PackagesPkgSig), + "sig_provider": colStr(schema.PkgSigProviderSigProvider), + "pkg_install_date": colStr(schema.PackagesPkgInstallDate), + "pkg_updated": colStr(schema.PackagesPkgUpdated), + }, + // A package row carries only the node id: its name and properties live in + // the joined nodes table. + Joins: map[string]JoinDef{ + "nodes": {MappingKey: "node"}, + }, }, "instance_status_log": { Available: []string{ @@ -601,6 +760,108 @@ var propsMapping = map[string]propMapping{ "ruleset_public": colStr(schema.CompRulesetsRulesetPublic), }, }, + // Modules of a compliance moduleset: the agent modules it runs. + "moduleset_module": { + Available: []string{"id", "modset_id", "modset_mod_name", "autofix", "modset_mod_author", "modset_mod_updated"}, + Props: map[string]propDef{ + "id": col(schema.CompModulesetModulesID), + "modset_id": colInt(schema.CompModulesetModulesModsetID), + "modset_mod_name": colStr(schema.CompModulesetModulesModsetModName), + "autofix": colStr(schema.CompModulesetModulesAutofix), + "modset_mod_author": colStr(schema.CompModulesetModulesModsetModAuthor), + "modset_mod_updated": colStr(schema.CompModulesetModulesModsetModUpdated), + }, + }, + // Modules of every moduleset, as the historical v_comp_modulesets view: a + // moduleset without module has a row with a zero id and empty module props. + "modulesets_module": { + Available: []string{ + "id", "modset_id", "modset_name", "teams_responsible", "teams_publication", + "modset_mod_name", "autofix", "modset_mod_updated", "modset_mod_author", + "modset_author", "modset_updated", + }, + Props: map[string]propDef{ + "id": colInt(schema.CompModulesetModulesID), + "modset_id": col(schema.CompModulesetID), + "modset_name": colStr(schema.CompModulesetModsetName), + "modset_author": colStr(schema.CompModulesetModsetAuthor), + "modset_updated": colStr(schema.CompModulesetModsetUpdated), + "modset_mod_name": colStr(schema.CompModulesetModulesModsetModName), + "autofix": colStr(schema.CompModulesetModulesAutofix), + "modset_mod_author": colStr(schema.CompModulesetModulesModsetModAuthor), + "modset_mod_updated": colStr(schema.CompModulesetModulesModsetModUpdated), + "teams_responsible": colStr(cdb.ModsetResponsibles), + "teams_publication": colStr(cdb.ModsetPublications), + }, + }, + // Declared networks. begin, end and broadcast are generated by the database + // from network and netmask. + "network": { + Available: []string{ + "id", "name", "network", "netmask", "broadcast", "gateway", "begin", "end", + "pvid", "prio", "team_responsible", "comment", "updated", + }, + Props: map[string]propDef{ + "id": colInt(schema.NetworksID), + "name": colStr(schema.NetworksName), + "network": colStr(schema.NetworksNetwork), + "netmask": colInt(schema.NetworksNetmask), + "broadcast": colStr(schema.NetworksBroadcast), + "gateway": colStr(schema.NetworksGateway), + "begin": colStr(schema.NetworksBegin), + "end": colStr(schema.NetworksEnd), + "pvid": colInt(schema.NetworksPvid), + "prio": colInt(schema.NetworksPrio), + "team_responsible": colStr(schema.NetworksTeamResponsible), + "comment": colStr(schema.NetworksComment), + "updated": colStr(schema.NetworksUpdated), + }, + }, + // Variables of every ruleset, as the historical v_comp_rulesets view: a + // ruleset lists its own variables, then those of each ruleset it + // encapsulates; a ruleset of the chain without variable has a row with a zero + // id and empty variable props. + "rulesets_variable": { + Available: []string{ + "id", "ruleset_id", "ruleset_name", "ruleset_type", "ruleset_public", + "teams_responsible", "teams_publication", "fset_name", "chain", "chain_len", + "encap_rset", "var_class", "var_name", "var_value", "var_updated", "var_author", + "encap_rset_id", "fset_id", + }, + Props: map[string]propDef{ + "id": colInt(schema.CompRulesetsVariablesID), + "ruleset_id": col(schema.CompRulesetsID), + "ruleset_name": colStr(schema.CompRulesetsRulesetName), + "ruleset_type": colStr(schema.CompRulesetsRulesetType), + "ruleset_public": colStr(schema.CompRulesetsRulesetPublic), + "teams_responsible": colStr(cdb.RsetResponsibles), + "teams_publication": colStr(cdb.RsetPublications), + "fset_name": colStr(schema.GenFiltersetsFsetName), + "chain": colStr(cdb.RsetChainsChain), + "chain_len": colInt(cdb.RsetChainsLen), + "encap_rset": colStr(cdb.RsetChainsEncap), + "var_class": colStr(schema.CompRulesetsVariablesVarClass), + "var_name": colStr(schema.CompRulesetsVariablesVarName), + "var_value": colStr(schema.CompRulesetsVariablesVarValue), + "var_updated": colStr(schema.CompRulesetsVariablesVarUpdated), + "var_author": colStr(schema.CompRulesetsVariablesVarAuthor), + "encap_rset_id": colInt(cdb.RsetChainsEncapID), + "fset_id": colInt(schema.CompRulesetsFiltersetsFsetID), + }, + }, + // Variables of a compliance ruleset: the rules the modules apply. + "ruleset_variable": { + Available: []string{"id", "ruleset_id", "var_name", "var_class", "var_value", "var_author", "var_updated"}, + Props: map[string]propDef{ + "id": col(schema.CompRulesetsVariablesID), + "ruleset_id": colInt(schema.CompRulesetsVariablesRulesetID), + "var_name": colStr(schema.CompRulesetsVariablesVarName), + "var_class": colStr(schema.CompRulesetsVariablesVarClass), + "var_value": colStr(schema.CompRulesetsVariablesVarValue), + "var_author": colStr(schema.CompRulesetsVariablesVarAuthor), + "var_updated": colStr(schema.CompRulesetsVariablesVarUpdated), + }, + }, "alert_event": { Available: []string{"id", "svc_id", "node_id", "dash_begin", "dash_end", "dash_md5"}, Props: map[string]propDef{ @@ -642,6 +903,12 @@ var propsMapping = map[string]propMapping{ "dash_env": colStr(schema.DashboardDashEnv), "dash_instance": colStr(schema.DashboardDashInstance), }, + // A dashboard entry points at a node or a service by id only. The names live + // in the joined tables, as in the historical collector's own alert query. + Joins: map[string]JoinDef{ + "nodes": {MappingKey: "node"}, + "services": {MappingKey: "service"}, + }, }, "check": { Available: []string{ @@ -816,6 +1083,12 @@ var propsMapping = map[string]propMapping{ "node_id": colStr(schema.CompLogNodeID), "svc_id": colStr(schema.CompLogSvcID), }, + // A run points at its node, and at its service when it has one, by id + // only: the names live in the joined tables. + Joins: map[string]JoinDef{ + "nodes": {MappingKey: "node"}, + "services": {MappingKey: "service"}, + }, }, "log_event": { Available: []string{ @@ -841,5 +1114,11 @@ var propsMapping = map[string]propMapping{ "log_gtalk_sent": colInt(schema.LogLogGtalkSent), "log_email_sent": colInt(schema.LogLogEmailSent), }, + // A log event names its node and service by id only: the names come from the + // joined tables, as in the historical collector's log table. + Joins: map[string]JoinDef{ + "nodes": {MappingKey: "node"}, + "services": {MappingKey: "service"}, + }, }, } diff --git a/server/handlers/put_actions.go b/server/handlers/put_actions.go new file mode 100644 index 00000000..2f29b164 --- /dev/null +++ b/server/handlers/put_actions.go @@ -0,0 +1,229 @@ +package serverhandlers + +import ( + "bytes" + "context" + "encoding/json" + "errors" + "fmt" + "log/slog" + "net/http" + "strconv" + "strings" + + "github.com/labstack/echo/v4" + + "github.com/opensvc/oc3/cdb" + "github.com/opensvc/oc3/util/echolog" + "github.com/opensvc/oc3/util/logkey" +) + +// actionEntry is one action to enqueue, with the fields of the historical +// collector's PUT /actions (rest_put_action_queue). The keys it does not support +// are kept to be refused rather than silently dropped. +type actionEntry struct { + NodeID string `json:"node_id"` + SvcID string `json:"svc_id"` + Action string `json:"action"` + Rid string `json:"rid"` + VMName string `json:"vmname"` + + unsupported []string +} + +// unsupportedActionKeys are accepted by the historical collector but not ported: +// compliance runs and agent options. +var unsupportedActionKeys = []string{"module", "moduleset", "ruleset", "options"} + +func (e *actionEntry) UnmarshalJSON(data []byte) error { + type plain actionEntry + var fields plain + if err := json.Unmarshal(data, &fields); err != nil { + return err + } + var raw map[string]json.RawMessage + if err := json.Unmarshal(data, &raw); err != nil { + return err + } + *e = actionEntry(fields) + for _, key := range unsupportedActionKeys { + if _, ok := raw[key]; ok { + e.unsupported = append(e.unsupported, key) + } + } + return nil +} + +// queueActionEntry dispatches one entry as json_action_one() does: node and +// service make an instance action, a service alone a service action, a node alone +// a node action. vmname names the node in place of node_id. +func (a *Api) queueActionEntry(c echo.Context, log *slog.Logger, ctx context.Context, e actionEntry) (*queuedAction, error) { + if len(e.unsupported) > 0 { + return nil, refuseAction(http.StatusBadRequest, "unsupported keys: %s", strings.Join(e.unsupported, ", ")) + } + if e.Action == "" { + return nil, refuseAction(http.StatusBadRequest, "no action specified") + } + nodeID := e.NodeID + if e.VMName != "" { + nodeID = e.VMName + } + switch { + case e.SvcID != "" && nodeID != "": + return a.queueInstanceAction(c, log, ctx, nodeID, e.SvcID, e.Action, e.Rid) + case e.Rid != "": + return nil, refuseAction(http.StatusBadRequest, "rid requires both node_id and svc_id") + case nodeID != "": + return a.queueNodeAction(c, log, ctx, nodeID, e.Action) + case e.SvcID != "": + return a.queueServiceAction(c, log, ctx, e.SvcID, e.Action) + } + return nil, refuseAction(http.StatusBadRequest, "node_id or svc_id must be specified") +} + +// factorizeActionEntries merges the entries that target the same resources of an +// instance with the same action into one action on all of them, as +// factorize_actions() does: selecting three resources queues one agent run. +func factorizeActionEntries(entries []actionEntry) []actionEntry { + type key struct{ svcID, nodeID, action string } + var out []actionEntry + var order []key + rids := map[key][]string{} + for _, e := range entries { + nodeID := e.NodeID + if e.VMName != "" { + nodeID = e.VMName + } + if e.Rid == "" || e.SvcID == "" || nodeID == "" || len(e.unsupported) > 0 { + out = append(out, e) + continue + } + k := key{e.SvcID, nodeID, e.Action} + if _, seen := rids[k]; !seen { + order = append(order, k) + } + rids[k] = append(rids[k], e.Rid) + } + for _, k := range order { + out = append(out, actionEntry{NodeID: k.nodeID, SvcID: k.svcID, Action: k.action, Rid: strings.Join(rids[k], ",")}) + } + return out +} + +// queuedActionRows reads back the queued actions, with the default props of +// GET /actions/{id}. The caller has just created them: they are read without the +// node responsibility filter of the action list, which would hide an instance +// action queued on a node the caller is not responsible for. +func (a *Api) queuedActionRows(ctx context.Context, ids []int64) ([]map[string]any, ListQueryParameters, error) { + mapping := propsMapping["action_queue"] + query, err := buildListQueryParameters(nil, nil, nil, nil, nil, nil, nil, mapping) + if err != nil { + return nil, query, err + } + selectExprs, err := buildSelectClause(query.Props, mapping) + if err != nil { + return nil, query, err + } + rows := []map[string]any{} + for _, id := range ids { + items, err := a.ODB.GetActionOne(ctx, strconv.FormatInt(id, 10), cdb.ListParams{ + IsManager: true, + Limit: 1, + Props: query.Props, + SelectExprs: selectExprs, + TypeHints: buildTypeHints(query.Props, mapping), + }) + if err != nil { + return nil, query, err + } + rows = append(rows, items...) + } + return rows, query, nil +} + +// PutActions handles PUT /actions: enqueue agent actions, as the historical +// collector's REST API and action menu do. +func (a *Api) PutActions(c echo.Context) error { + log := echolog.GetLogHandler(c, "PutActions") + ctx, cancel := context.WithTimeout(c.Request().Context(), a.SyncTimeout) + defer cancel() + + if !IsAuthByUser(c) { + return JSONProblemf(c, http.StatusUnauthorized, "user authentication required") + } + + var raw json.RawMessage + if err := json.NewDecoder(c.Request().Body).Decode(&raw); err != nil { + return JSONProblem(c, http.StatusBadRequest, err.Error()) + } + + // A list: every entry is tried, and the answer collects what was queued and + // what was refused, as the historical handle_list() does. + if trimmed := bytes.TrimSpace(raw); len(trimmed) > 0 && trimmed[0] == '[' { + var entries []actionEntry + if err := json.Unmarshal(raw, &entries); err != nil { + return JSONProblem(c, http.StatusBadRequest, err.Error()) + } + var ids []int64 + refusals := []string{} + for _, e := range factorizeActionEntries(entries) { + queued, err := a.queueActionEntry(c, log, ctx, e) + if err != nil { + refusals = append(refusals, describeRefusal(e, err)) + continue + } + ids = append(ids, queued.ID) + } + if len(ids) > 0 { + if err := a.ODB.Session.NotifyChanges(ctx); err != nil { + log.Error("cannot notify changes", logkey.Error, err) + } + } + rows, _, err := a.queuedActionRows(ctx, ids) + if err != nil { + log.Error("cannot read the queued actions", logkey.Error, err) + return JSONProblemf(c, http.StatusInternalServerError, "actions queued, but cannot read them back") + } + return c.JSON(http.StatusOK, map[string]any{ + "info": []string{fmt.Sprintf("%d action(s) queued", len(ids))}, + "error": refusals, + "data": rows, + }) + } + + var entry actionEntry + if err := json.Unmarshal(raw, &entry); err != nil { + return JSONProblem(c, http.StatusBadRequest, err.Error()) + } + queued, err := a.queueActionEntry(c, log, ctx, entry) + if err != nil { + return actionProblem(c, err) + } + if err := a.ODB.Session.NotifyChanges(ctx); err != nil { + log.Error("cannot notify changes", logkey.Error, err) + } + rows, query, err := a.queuedActionRows(ctx, []int64{queued.ID}) + if err != nil { + log.Error("cannot read the queued action", "action_id", queued.ID, logkey.Error, err) + return JSONProblemf(c, http.StatusInternalServerError, "action %d queued, but cannot read it back", queued.ID) + } + return c.JSON(http.StatusOK, newListResponse(rows, propsMapping["action_queue"], query)) +} + +// describeRefusal names the refused entry in the message of a list answer. +func describeRefusal(e actionEntry, err error) string { + var target []string + for _, part := range []struct{ key, value string }{ + {"node_id", e.NodeID}, {"vmname", e.VMName}, {"svc_id", e.SvcID}, {"rid", e.Rid}, + } { + if part.value != "" { + target = append(target, part.key+"="+part.value) + } + } + msg := err.Error() + var refusal *actionRefusal + if errors.As(err, &refusal) { + msg = fmt.Sprintf("%d: %s", refusal.status, refusal.msg) + } + return fmt.Sprintf("%s on %s: %s", e.Action, strings.Join(target, " "), msg) +} diff --git a/server/handlers/queue_node_action.go b/server/handlers/queue_node_action.go new file mode 100644 index 00000000..f3e8f5e8 --- /dev/null +++ b/server/handlers/queue_node_action.go @@ -0,0 +1,183 @@ +package serverhandlers + +import ( + "context" + "errors" + "fmt" + "log/slog" + "net/http" + "strings" + + "github.com/google/uuid" + "github.com/labstack/echo/v4" + + "github.com/opensvc/oc3/cdb" + "github.com/opensvc/oc3/util/logkey" +) + +// nodeActions are the agent actions the API accepts, mirroring the node agent +// entries of the historical collector action menu. Actions that interrupt service +// (reboot, shutdown, drain, updatepkg...) are deliberately left out for now. +var nodeActions = map[string]bool{ + "pushasset": true, + "pushdisks": true, + "pushpkg": true, + "pushpatch": true, + "pushstats": true, + "checks": true, + "sysreport": true, + "scanscsi": true, + "freeze": true, + "thaw": true, +} + +// sshCmd is the ssh invocation the python collector uses to reach a push node +// (get_ssh_cmd, with the default of its ssh_cmd). +var sshCmd = []string{ + "ssh", + "-o", "StrictHostKeyChecking=no", + "-o", "CheckHostIP=no", + "-o", "ForwardX11=no", + "-o", "ConnectTimeout=5", + "-o", "PasswordAuthentication=no", +} + +// nodeActionCommand builds the queued command, as fmt_node_action() does: a pull or +// feed node reads the bare action from its queue, a push node is reached over ssh. +func nodeActionCommand(action, actionType, connectTo string) string { + var cmd []string + if actionType != "pull" && actionType != "feed" { + cmd = append(cmd, sshCmd...) + cmd = append(cmd, "opensvc@"+connectTo, "--", "sudo", "nodemgr") + } + cmd = append(cmd, action) + if action == "freeze" || action == "thaw" { + cmd = append(cmd, "--local") + } + return strings.Join(cmd, " ") +} + +// queuedAction is an action posted to the action queue. +type queuedAction struct { + ID int64 + Command string + NodeID string + Info string +} + +// actionRefusal is a queueing request that did not go through, with the HTTP +// status that says why. Internal failures are logged where they happen and +// refused with a 500 and a generic message. +type actionRefusal struct { + status int + msg string +} + +func (e *actionRefusal) Error() string { return e.msg } + +func refuseAction(status int, format string, args ...any) error { + return &actionRefusal{status: status, msg: fmt.Sprintf(format, args...)} +} + +// actionProblem writes the problem response of a refused queueing request. +func actionProblem(c echo.Context, err error) error { + var refusal *actionRefusal + if errors.As(err, &refusal) { + return JSONProblem(c, refusal.status, refusal.msg) + } + return JSONProblem(c, http.StatusInternalServerError, err.Error()) +} + +// actionTypeOf returns how the node reads its queue; an unset action_type means +// pull, as get_action_type() does. +func actionTypeOf(target *cdb.NodeActionTarget) string { + if target.ActionType == "" { + return "pull" + } + return target.ActionType +} + +// queueNodeAction queues an agent action on a node, as do_node_action() does: +// NodeExec privilege, responsibility for the node, and a command run by nodemgr. +func (a *Api) queueNodeAction(c echo.Context, log *slog.Logger, ctx context.Context, nodeID, action string) (*queuedAction, error) { + odb := a.ODB + if !nodeActions[action] { + return nil, refuseAction(http.StatusBadRequest, "unsupported action %q", action) + } + if !IsManager(c) && !HasGroup(c, "NodeExec") { + return nil, refuseAction(http.StatusForbidden, "user has no NodeExec privilege") + } + + node, err := odb.NodeByNodeIDOrNodename(ctx, nodeID) + if err != nil { + log.Error("cannot lookup node", logkey.Error, err) + return nil, refuseAction(http.StatusInternalServerError, "cannot lookup node") + } + if node == nil { + return nil, refuseAction(http.StatusNotFound, "node %s not found", nodeID) + } + + responsible, err := odb.NodeResponsible(ctx, node.NodeID, UserGroupsFromContext(c), IsManager(c)) + if err != nil { + log.Error("cannot check node responsibility", logkey.Error, err) + return nil, refuseAction(http.StatusInternalServerError, "cannot check node responsibility") + } + if !responsible { + return nil, refuseAction(http.StatusForbidden, "user is not responsible for node %s", nodeID) + } + + target, err := odb.NodeActionTargetByID(ctx, node.NodeID) + if err != nil { + log.Error("cannot read node action fields", logkey.Error, err) + return nil, refuseAction(http.StatusInternalServerError, "cannot read node %s", nodeID) + } + if target == nil { + return nil, refuseAction(http.StatusNotFound, "node %s not found", nodeID) + } + // A node feeding another collector queues its actions there; oc3 has no such + // push channel, so the caller is told rather than left with a dead entry. + if target.Collector != "" { + return nil, refuseAction(http.StatusBadRequest, + "node %s is attached to collector %s: queue the action there", target.Nodename, target.Collector) + } + + connectTo, err := odb.NodeReachableAddress(ctx, target) + if err != nil { + log.Error("cannot find a reachable address", logkey.Error, err) + return nil, refuseAction(http.StatusInternalServerError, "cannot find an address for node %s", nodeID) + } + + actionType := actionTypeOf(target) + command := nodeActionCommand(action, actionType, connectTo) + + // Who asked, as the python collector records it: the queue keeps the caller. + id, err := odb.EnqueueNodeAction(ctx, node.NodeID, actionType, command, connectTo, authUserID(c)) + if err != nil { + log.Error("cannot queue the action", logkey.Error, err) + return nil, refuseAction(http.StatusInternalServerError, "cannot queue action %s", action) + } + + log.Info("action queued", logkey.NodeID, node.NodeID, "action", action, "action_id", id) + + userEmail, _ := c.Get(XUserEmail).(string) + logEntry := cdb.LogEntry{ + Action: "node.action", + User: userEmail, + Fmt: "run %(action)s", + Dict: map[string]any{"action": action}, + Level: "info", + } + if parsed, parseErr := uuid.Parse(node.NodeID); parseErr == nil { + logEntry.NodeID = &parsed + } + if logErr := odb.Log(ctx, logEntry); logErr != nil { + log.Error("cannot write audit log", logkey.Error, logErr) + } + + return &queuedAction{ + ID: id, + Command: command, + NodeID: node.NodeID, + Info: "action " + action + " queued on node " + target.Nodename, + }, nil +} diff --git a/server/handlers/queue_service_action.go b/server/handlers/queue_service_action.go new file mode 100644 index 00000000..d72df3b3 --- /dev/null +++ b/server/handlers/queue_service_action.go @@ -0,0 +1,228 @@ +package serverhandlers + +import ( + "context" + "log/slog" + "net/http" + "regexp" + "strconv" + "strings" + + "github.com/google/uuid" + "github.com/labstack/echo/v4" + + "github.com/opensvc/oc3/cdb" + "github.com/opensvc/oc3/util/logkey" +) + +// serviceActions are the agent actions the API accepts on a service or on one of +// its instances. As for nodes, only what does not interrupt the service is exposed: +// start, stop, restart, switch, giveback, takeover, the sync and provisioning +// actions are deliberately left out for now. +var serviceActions = map[string]bool{ + "push resinfo": true, + "push config": true, + "freeze": true, + "thaw": true, +} + +// ridPattern bounds a resource id list ("fs#1,ip#0"): the command reaches a push +// node through a remote shell, where anything else could be interpreted. +var ridPattern = regexp.MustCompile(`^[A-Za-z0-9_#.:,-]+$`) + +// agentAtLeast19 reports whether the agent understands --local, as the python +// collector decides it from the leading digits of the reported version. The om3 +// agent reports "v3.0.0-...", whose leading "v" the python collector could not +// read: it then left --local out, and an instance freeze froze the whole object. +// The prefix is skipped here, om3 accepting --local on these actions. +func agentAtLeast19(version string) bool { + version = strings.TrimPrefix(strings.TrimPrefix(version, "v"), "V") + if len(version) < 3 { + return false + } + v, err := strconv.ParseFloat(version[:3], 64) + if err != nil { + return false + } + return v >= 1.9 +} + +// serviceActionCommand builds the queued command, as fmt_svc_action() does. A pull +// or feed node reads the bare action from its queue; a push node is reached over +// ssh. A resource id limits the action to those resources; otherwise `local` +// restricts it to the instance of that node, except for the actions that only +// make sense cluster-wide. +func serviceActionCommand(action, svcname, actionType, connectTo, agentVersion, rid string, local bool) string { + var cmd []string + if actionType != "pull" && actionType != "feed" { + cmd = append(cmd, sshCmd...) + cmd = append(cmd, "opensvc@"+connectTo, "--", "sudo", "svcmgr", "--service", svcname) + } + cmd = append(cmd, action) + switch { + case rid != "": + cmd = append(cmd, "--rid", rid) + case local && agentAtLeast19(agentVersion) && action != "create" && action != "takeover" && action != "switch": + cmd = append(cmd, "--local") + } + return strings.Join(cmd, " ") +} + +// enqueueServiceCommand is the part shared by service and instance actions: build +// the command for the target node and post it to the queue, as enqueue_svc_action() +// does, then write the audit log entry. +func (a *Api) enqueueServiceCommand( + c echo.Context, log *slog.Logger, ctx context.Context, + svc *cdb.DBService, target *cdb.NodeActionTarget, agentVersion, action, rid string, local bool, +) (*queuedAction, error) { + odb := a.ODB + + // A node feeding another collector queues its actions there; oc3 has no such + // push channel, so the caller is told rather than left with a dead entry. + if target.Collector != "" { + return nil, refuseAction(http.StatusBadRequest, + "node %s is attached to collector %s: queue the action there", target.Nodename, target.Collector) + } + + connectTo, err := odb.NodeReachableAddress(ctx, target) + if err != nil { + log.Error("cannot find a reachable address", logkey.Error, err) + return nil, refuseAction(http.StatusInternalServerError, "cannot find an address for node %s", target.Nodename) + } + + actionType := actionTypeOf(target) + command := serviceActionCommand(action, svc.Svcname, actionType, connectTo, agentVersion, rid, local) + + id, err := odb.EnqueueServiceAction(ctx, target.NodeID, svc.SvcID, actionType, command, connectTo, authUserID(c)) + if err != nil { + log.Error("cannot queue the action", logkey.Error, err) + return nil, refuseAction(http.StatusInternalServerError, "cannot queue action %s", action) + } + + log.Info("action queued", "svc_id", svc.SvcID, logkey.NodeID, target.NodeID, "action", action, "rid", rid, "action_id", id) + + userEmail, _ := c.Get(XUserEmail).(string) + logEntry := cdb.LogEntry{ + Action: "service.action", + User: userEmail, + Fmt: "run %(action)s", + Dict: map[string]any{"action": action}, + Level: "info", + } + if rid != "" { + logEntry.Action = "service.resource.action" + logEntry.Fmt = "run %(action)s on rid %(rid)s" + logEntry.Dict["rid"] = rid + } + if parsed, parseErr := uuid.Parse(svc.SvcID); parseErr == nil { + logEntry.SvcID = &parsed + } + if parsed, parseErr := uuid.Parse(target.NodeID); parseErr == nil { + logEntry.NodeID = &parsed + } + if logErr := odb.Log(ctx, logEntry); logErr != nil { + log.Error("cannot write audit log", logkey.Error, logErr) + } + + return &queuedAction{ + ID: id, + Command: command, + NodeID: target.NodeID, + Info: "action " + action + " queued on service " + svc.Svcname + " from node " + target.Nodename, + }, nil +} + +// checkServiceAction validates the action and the caller rights shared by service +// and instance actions: NodeExec privilege and responsibility for the service. +func (a *Api) checkServiceAction(c echo.Context, log *slog.Logger, ctx context.Context, svcID, action string) (*cdb.DBService, error) { + if !serviceActions[action] { + return nil, refuseAction(http.StatusBadRequest, "unsupported action %q", action) + } + if !IsManager(c) && !HasGroup(c, "NodeExec") { + return nil, refuseAction(http.StatusForbidden, "user has no NodeExec privilege") + } + if svcID == "" { + return nil, refuseAction(http.StatusBadRequest, "invalid svc_id: ''") + } + + svc, err := a.ODB.ServiceBySvcIDOrName(ctx, svcID) + if err != nil { + log.Error("cannot resolve service", "svc_id", svcID, logkey.Error, err) + return nil, refuseAction(http.StatusInternalServerError, "cannot resolve service %s", svcID) + } + if svc == nil { + return nil, refuseAction(http.StatusNotFound, "service %s not found", svcID) + } + + responsible, err := a.ODB.ServiceResponsible(ctx, svc.SvcID, UserGroupsFromContext(c), IsManager(c)) + if err != nil { + log.Error("cannot check service responsibility", logkey.Error, err) + return nil, refuseAction(http.StatusInternalServerError, "cannot check service responsibility") + } + if !responsible { + return nil, refuseAction(http.StatusForbidden, "user is not responsible for service %s", svcID) + } + return svc, nil +} + +// queueServiceAction queues an action on a whole service, as do_svc_action() +// does: posted for a node of the service seen alive in the last 15 minutes, +// without --local. +func (a *Api) queueServiceAction(c echo.Context, log *slog.Logger, ctx context.Context, svcID, action string) (*queuedAction, error) { + svc, err := a.checkServiceAction(c, log, ctx, svcID, action) + if err != nil { + return nil, err + } + + target, agentVersion, err := a.ODB.ServiceLiveNode(ctx, svc.SvcID) + if err != nil { + log.Error("cannot look for a live node", logkey.Error, err) + return nil, refuseAction(http.StatusInternalServerError, "cannot look for a live node of service %s", svcID) + } + if target == nil { + return nil, refuseAction(http.StatusConflict, + "no node of service %s has been seen in the last 15 minutes", svc.Svcname) + } + + return a.enqueueServiceCommand(c, log, ctx, svc, target, agentVersion, action, "", false) +} + +// queueInstanceAction queues an action on the instance of a service on one node, +// as do_instance_action() does: NodeExec privilege and responsibility for the +// service; the node only has to exist. The action acts on that instance only +// (--local), or on the given resources (--rid). +func (a *Api) queueInstanceAction(c echo.Context, log *slog.Logger, ctx context.Context, nodeID, svcID, action, rid string) (*queuedAction, error) { + if rid != "" && !ridPattern.MatchString(rid) { + return nil, refuseAction(http.StatusBadRequest, "invalid rid %q", rid) + } + svc, err := a.checkServiceAction(c, log, ctx, svcID, action) + if err != nil { + return nil, err + } + + node, err := a.ODB.NodeByNodeIDOrNodename(ctx, nodeID) + if err != nil { + log.Error("cannot lookup node", logkey.Error, err) + return nil, refuseAction(http.StatusInternalServerError, "cannot lookup node") + } + if node == nil { + return nil, refuseAction(http.StatusNotFound, "node %s not found", nodeID) + } + + target, err := a.ODB.NodeActionTargetByID(ctx, node.NodeID) + if err != nil { + log.Error("cannot read node action fields", logkey.Error, err) + return nil, refuseAction(http.StatusInternalServerError, "cannot read node %s", nodeID) + } + if target == nil { + return nil, refuseAction(http.StatusNotFound, "node %s not found", nodeID) + } + + agentVersion, err := a.ODB.NodeAgentVersion(ctx, node.NodeID) + if err != nil { + log.Error("cannot read the agent version", logkey.Error, err) + return nil, refuseAction(http.StatusInternalServerError, "cannot read node %s", nodeID) + } + + return a.enqueueServiceCommand(c, log, ctx, svc, target, agentVersion, action, rid, true) +} diff --git a/server/handlers/queue_service_action_test.go b/server/handlers/queue_service_action_test.go new file mode 100644 index 00000000..ba35e78e --- /dev/null +++ b/server/handlers/queue_service_action_test.go @@ -0,0 +1,63 @@ +package serverhandlers + +import "testing" + +func TestServiceActionCommand(t *testing.T) { + cases := []struct { + name string + action, actionType, version, rid string + local bool + want string + }{ + {"instance, python agent", "freeze", "pull", "2.1-1234", "", true, "freeze --local"}, + {"instance, om3 agent", "freeze", "feed", "v3.0.0-rc40-2-g2b577", "", true, "freeze --local"}, + {"instance, old agent", "freeze", "pull", "1.8-100", "", true, "freeze"}, + {"instance, unknown version", "freeze", "pull", "", "", true, "freeze"}, + {"instance, cluster-wide action", "switch", "pull", "2.1", "", true, "switch"}, + {"instance, resources", "freeze", "pull", "2.1", "fs#1,ip#0", true, "freeze --rid fs#1,ip#0"}, + {"service", "freeze", "pull", "2.1", "", false, "freeze"}, + {"push node", "thaw", "push", "2.1", "", true, + "ssh -o StrictHostKeyChecking=no -o CheckHostIP=no -o ForwardX11=no -o ConnectTimeout=5 -o PasswordAuthentication=no opensvc@10.0.0.1 -- sudo svcmgr --service svc1 thaw --local"}, + } + for _, c := range cases { + got := serviceActionCommand(c.action, "svc1", c.actionType, "10.0.0.1", c.version, c.rid, c.local) + if got != c.want { + t.Errorf("%s: got %q, want %q", c.name, got, c.want) + } + } +} + +func TestFactorizeActionEntries(t *testing.T) { + entries := []actionEntry{ + {NodeID: "n1", SvcID: "s1", Action: "freeze", Rid: "fs#1"}, + {NodeID: "n1", Action: "pushasset"}, + {NodeID: "n1", SvcID: "s1", Action: "freeze", Rid: "ip#0"}, + {NodeID: "n2", SvcID: "s1", Action: "freeze", Rid: "fs#1"}, + } + got := factorizeActionEntries(entries) + if len(got) != 3 { + t.Fatalf("got %d entries, want 3: %+v", len(got), got) + } + if got[0].Action != "pushasset" { + t.Errorf("entries without rid come first, as factorize_actions() does: %+v", got) + } + if got[1].Rid != "fs#1,ip#0" || got[1].NodeID != "n1" { + t.Errorf("rids of the same instance and action are merged: %+v", got[1]) + } + if got[2].Rid != "fs#1" || got[2].NodeID != "n2" { + t.Errorf("another instance keeps its own entry: %+v", got[2]) + } +} + +func TestActionEntryUnsupportedKeys(t *testing.T) { + var e actionEntry + if err := e.UnmarshalJSON([]byte(`{"node_id":"n1","action":"compliance_check","module":"m1"}`)); err != nil { + t.Fatal(err) + } + if e.NodeID != "n1" || e.Action != "compliance_check" { + t.Errorf("known fields are read: %+v", e) + } + if len(e.unsupported) != 1 || e.unsupported[0] != "module" { + t.Errorf("module is kept to be refused: %+v", e.unsupported) + } +} diff --git a/server/handlers/resolve.go b/server/handlers/resolve.go index 40437dc1..ac6d3f9a 100644 --- a/server/handlers/resolve.go +++ b/server/handlers/resolve.go @@ -15,6 +15,21 @@ import ( "github.com/opensvc/oc3/xauth" ) +// authUserID returns the authenticated user's auth_user.id, or nil when the +// request is not authenticated as a user (node credentials, public path) or the +// id does not parse. +func authUserID(c echo.Context) *int64 { + user := UserInfoFromContext(c) + if user == nil { + return nil + } + id, err := strconv.ParseInt(user.GetExtensions().Get(xauth.XUserID), 10, 64) + if err != nil { + return nil + } + return &id +} + // resolveUserGroupIDs returns the group ids the authenticated user belongs to. func (a *Api) resolveUserGroupIDs(c echo.Context, log *slog.Logger) ([]int64, error) { ctx := c.Request().Context() @@ -51,31 +66,38 @@ func (a *Api) resolveNode(c echo.Context, log *slog.Logger, nodeId string) (*cdb // resolveServiceRow resolves a service by svc_id or name func (a *Api) resolveServiceRow(c echo.Context, log *slog.Logger, ctx context.Context, svcId string) (*cdb.DBService, error) { if svcId == "" { - return nil, JSONProblemf(c, http.StatusBadRequest, "invalid svc_id: ''") + return nil, denyRequest(c, http.StatusBadRequest, "invalid svc_id: ''") } svc, err := a.ODB.ServiceBySvcIDOrName(ctx, svcId) if err != nil { log.Error("cannot resolve service", "svc_id", svcId, logkey.Error, err) - return nil, JSONProblemf(c, http.StatusInternalServerError, "cannot resolve service %s", svcId) + return nil, denyRequest(c, http.StatusInternalServerError, "cannot resolve service %s", svcId) } if svc == nil { - return nil, JSONProblemf(c, http.StatusNotFound, "service %s not found", svcId) + return nil, denyRequest(c, http.StatusNotFound, "service %s not found", svcId) } return svc, nil } -// resolveService verifies that a service exists and is accessible +// resolveService verifies that a service exists and is accessible. On failure the +// problem response is written and a non-nil error returned, so that the caller +// stops: JSONProblemf alone returns nil once the response is written. func (a *Api) resolveService(c echo.Context, log *slog.Logger, svcId string) error { ctx := c.Request().Context() groups := UserGroupsFromContext(c) isManager := IsManager(c) - svcs, err := a.ODB.GetService(ctx, svcId, cdb.ListParams{Limit: 1, Groups: groups, IsManager: isManager}) + // The query builder refuses a query without selected columns: only existence + // matters here, the id is enough. + svcs, err := a.ODB.GetService(ctx, svcId, cdb.ListParams{ + Limit: 1, Groups: groups, IsManager: isManager, + SelectExprs: []string{"services.svc_id"}, Props: []string{"svc_id"}, + }) if err != nil { log.Error("cannot resolve service", "svc_id", svcId, logkey.Error, err) - return JSONProblemf(c, http.StatusInternalServerError, "cannot resolve service") + return denyRequest(c, http.StatusInternalServerError, "cannot resolve service") } if len(svcs) == 0 { - return JSONProblemf(c, http.StatusNotFound, "service %s not found", svcId) + return denyRequest(c, http.StatusNotFound, "service %s not found", svcId) } return nil } diff --git a/server/handlers/search.go b/server/handlers/search.go new file mode 100644 index 00000000..fda4e55e --- /dev/null +++ b/server/handlers/search.go @@ -0,0 +1,325 @@ +package serverhandlers + +import ( + "context" + "fmt" + "net/http" + "slices" + "strconv" + "strings" + "sync" + "time" + "unicode/utf8" + + "github.com/labstack/echo/v4" + + "github.com/opensvc/oc3/cdb" + "github.com/opensvc/oc3/server" + "github.com/opensvc/oc3/util/echolog" + "github.com/opensvc/oc3/util/logkey" +) + +const ( + // searchMinLength is the shortest text searched: one character matches + // almost every row and tells nothing. + searchMinLength = 2 + // searchDefaultLimit and searchMaxLimit bound the hits returned per kind. + searchDefaultLimit = 5 + searchMaxLimit = 20 + // searchTimeout bounds the whole search, all kinds together. + searchTimeout = 5 * time.Second +) + +// searchKind says how the global search looks for one kind of object: the +// list of the collector it reads, with the access control of that list, the +// props whose value may contain the text and the props returned for each hit. +type searchKind struct { + kind string + mapping string + match []string + // idProp is also compared for equality when the text is an integer: a + // request is named by its number. + idProp string + props []string + orderby string + // extra conditions, ANDed with the match. + extra []cdb.ColumnFilter + // withUserID forwards the caller's id, for the lists whose access control + // references it. + withUserID bool + fetch func(a *Api, ctx context.Context, p cdb.ListParams) ([]map[string]any, error) + // search replaces the list query for a kind without one, the tags. + search func(a *Api, ctx context.Context, pattern string, limit int) ([]map[string]any, error) +} + +// searchKinds are the searched kinds, in the order the results are returned. +var searchKinds = []searchKind{ + { + kind: "node", mapping: "node", + match: []string{"nodename", "node_id", "fqdn"}, + props: []string{"node_id", "nodename", "app", "node_env", "cluster_id", "fqdn", "os_name"}, + orderby: "nodename", + fetch: func(a *Api, ctx context.Context, p cdb.ListParams) ([]map[string]any, error) { + return a.ODB.GetNodes(ctx, p) + }, + }, + { + kind: "service", mapping: "service", + match: []string{"svcname", "svc_id"}, + props: []string{"svc_id", "svcname", "svc_app", "svc_env", "cluster_id", "svc_availstatus", "svc_topology"}, + orderby: "svcname", + fetch: func(a *Api, ctx context.Context, p cdb.ListParams) ([]map[string]any, error) { + return a.ODB.GetServices(ctx, p) + }, + }, + { + kind: "instance", mapping: "instance", + match: []string{"services.svcname", "mon_vmname"}, + props: []string{"svc_id", "node_id", "mon_vmname", "mon_availstatus", "services.svcname", "nodes.nodename"}, + orderby: "services.svcname,nodes.nodename", + fetch: func(a *Api, ctx context.Context, p cdb.ListParams) ([]map[string]any, error) { + return a.ODB.GetServicesInstances(ctx, p) + }, + }, + { + kind: "app", mapping: "app", + match: []string{"app", "description"}, + props: []string{"id", "app", "app_domain", "description"}, + orderby: "app", + fetch: func(a *Api, ctx context.Context, p cdb.ListParams) ([]map[string]any, error) { + return a.ODB.GetApps(ctx, p) + }, + }, + { + kind: "network", mapping: "node_ip", + match: []string{"addr", "mac"}, + props: []string{"id", "addr", "mask", "intf", "node_id", "nodename", "net_name"}, + orderby: "addr", + fetch: func(a *Api, ctx context.Context, p cdb.ListParams) ([]map[string]any, error) { + return a.ODB.GetIps(ctx, p) + }, + }, + { + kind: "disk", mapping: "disk", + match: []string{"disk_id", "disk_name", "disk_devid"}, + props: []string{"disk_id", "disk_name", "disk_size", "disk_arrayid", "nodename", "svcname"}, + orderby: "disk_id", + fetch: func(a *Api, ctx context.Context, p cdb.ListParams) ([]map[string]any, error) { + return a.ODB.GetDisks(ctx, p) + }, + }, + { + kind: "tag", + search: func(a *Api, ctx context.Context, pattern string, limit int) ([]map[string]any, error) { + return a.ODB.SearchTags(ctx, pattern, limit) + }, + }, + { + kind: "user", mapping: "user", + match: []string{"email", "first_name", "last_name", "username"}, + props: []string{"id", "email", "first_name", "last_name", "username"}, + orderby: "email", + withUserID: true, + fetch: func(a *Api, ctx context.Context, p cdb.ListParams) ([]map[string]any, error) { + return a.ODB.GetUsers(ctx, p) + }, + }, + { + kind: "group", mapping: "auth_group", + match: []string{"role", "description"}, + props: []string{"id", "role", "privilege", "description"}, + orderby: "role", + // The private group of each user would drown the teams. + extra: []cdb.ColumnFilter{{Expr: `auth_group.role NOT LIKE 'user\_%'`}}, + fetch: func(a *Api, ctx context.Context, p cdb.ListParams) ([]map[string]any, error) { + return a.ODB.GetGroups(ctx, p) + }, + }, + { + kind: "request", mapping: "workflow", + match: []string{"form_name", "last_form_name"}, + idProp: "id", + props: []string{"id", "form_name", "last_form_name", "status", "creator", "last_update"}, + orderby: "-id", + fetch: func(a *Api, ctx context.Context, p cdb.ListParams) ([]map[string]any, error) { + return a.ODB.GetWorkflows(ctx, nil, "", p) + }, + }, + { + kind: "moduleset", mapping: "moduleset", + match: []string{"modset_name"}, + props: []string{"id", "modset_name", "modset_author"}, + orderby: "modset_name", + fetch: func(a *Api, ctx context.Context, p cdb.ListParams) ([]map[string]any, error) { + return a.ODB.GetComplianceModulesets(ctx, nil, p) + }, + }, + { + kind: "ruleset", mapping: "ruleset", + match: []string{"ruleset_name"}, + props: []string{"id", "ruleset_name", "ruleset_type", "ruleset_public"}, + orderby: "ruleset_name", + fetch: func(a *Api, ctx context.Context, p cdb.ListParams) ([]map[string]any, error) { + return a.ODB.GetComplianceRulesets(ctx, nil, p) + }, + }, + { + kind: "filterset", mapping: "filterset", + match: []string{"fset_name"}, + props: []string{"id", "fset_name", "fset_author"}, + orderby: "fset_name", + fetch: func(a *Api, ctx context.Context, p cdb.ListParams) ([]map[string]any, error) { + return a.ODB.GetFiltersets(ctx, p) + }, + }, + { + kind: "form", mapping: "form", + match: []string{"form_name", "form_folder"}, + props: []string{"id", "form_name", "form_type", "form_folder"}, + orderby: "form_name", + fetch: func(a *Api, ctx context.Context, p cdb.ListParams) ([]map[string]any, error) { + return a.ODB.GetForms(ctx, nil, p) + }, + }, +} + +// searchGroup is the result of the search for one kind. More tells that other +// objects of the kind match beyond the ones returned. +type searchGroup struct { + Kind string `json:"kind"` + Items []map[string]any `json:"items"` + More bool `json:"more"` + Error string `json:"error,omitempty"` +} + +// GetSearch handles GET /search: the objects of the main kinds whose name, or +// another identifying prop, contains the text, as the historical collector's +// search did. Each kind is read through its own list, with its access control, +// all kinds at once; a kind that fails is reported in its group without +// failing the others. +func (a *Api) GetSearch(c echo.Context, params server.GetSearchParams) error { + log := echolog.GetLogHandler(c, "GetSearch") + + text := strings.TrimSpace(params.Q) + limit := searchDefaultLimit + if params.Limit != nil { + limit = min(max(*params.Limit, 1), searchMaxLimit) + } + var wanted []string + if params.Kinds != nil && *params.Kinds != "" { + wanted = strings.Split(*params.Kinds, ",") + for _, k := range wanted { + if !slices.ContainsFunc(searchKinds, func(s searchKind) bool { return s.kind == k }) { + return JSONProblemf(c, http.StatusBadRequest, "unknown kind %q", k) + } + } + } + + groups := []searchGroup{} + if utf8.RuneCountInString(text) < searchMinLength { + return c.JSON(http.StatusOK, map[string]any{"data": groups}) + } + + ctx, cancel := context.WithTimeout(c.Request().Context(), searchTimeout) + defer cancel() + + base := cdb.ListParams{Groups: UserGroupsFromContext(c), IsManager: IsManager(c)} + userID := authUserID(c) + pattern := "%" + likeEscaper.Replace(text) + "%" + + kinds := make([]searchKind, 0, len(searchKinds)) + for _, k := range searchKinds { + if wanted == nil || slices.Contains(wanted, k.kind) { + kinds = append(kinds, k) + } + } + groups = make([]searchGroup, len(kinds)) + var wg sync.WaitGroup + for i, k := range kinds { + wg.Add(1) + go func() { + defer wg.Done() + items, err := a.searchOne(ctx, k, text, pattern, limit, base, userID) + groups[i] = searchGroup{Kind: k.kind, Items: items} + if err != nil { + log.Error("cannot search", "kind", k.kind, logkey.Error, err) + groups[i].Error = fmt.Sprintf("cannot search %s", k.kind) + groups[i].Items = []map[string]any{} + return + } + if len(items) > limit { + groups[i].Items = items[:limit] + groups[i].More = true + } + if groups[i].Items == nil { + groups[i].Items = []map[string]any{} + } + }() + } + wg.Wait() + log.Info("called", "text", text, "kinds", len(kinds), "limit", limit) + return c.JSON(http.StatusOK, map[string]any{"data": groups}) +} + +// searchOne runs the search of one kind, asking for one row more than limit +// to tell whether more match. +func (a *Api) searchOne(ctx context.Context, k searchKind, text, pattern string, limit int, base cdb.ListParams, userID *int64) ([]map[string]any, error) { + if k.search != nil { + return k.search(a, ctx, pattern, limit+1) + } + mapping := propsMapping[k.mapping] + props := strings.Join(k.props, ",") + orderby := k.orderby + fetchLimit := limit + 1 + query, err := buildListQueryParameters(&props, &fetchLimit, nil, nil, nil, &orderby, nil, mapping) + if err != nil { + return nil, err + } + selectExprs, err := buildSelectClause(query.Props, mapping) + if err != nil { + return nil, err + } + + var ( + conds []string + args []any + first *cdb.ColumnFilter + ) + for _, prop := range k.match { + col, err := resolvePropCol(prop, mapping, "search") + if err != nil { + return nil, err + } + if first == nil { + first = &cdb.ColumnFilter{Col: col} + } + conds = append(conds, col.Qualified()+" LIKE ?") + args = append(args, pattern) + } + if k.idProp != "" { + if id, err := strconv.ParseInt(text, 10, 64); err == nil { + col, err := resolvePropCol(k.idProp, mapping, "search") + if err != nil { + return nil, err + } + conds = append(conds, col.Qualified()+" = ?") + args = append(args, id) + } + } + match := cdb.ColumnFilter{Expr: "(" + strings.Join(conds, " OR ") + ")", Args: args} + if first != nil { + match.Col = first.Col + } + + p := base + p.Limit = query.Page.Limit + p.Props = query.Props + p.SelectExprs = selectExprs + p.TypeHints = buildTypeHints(query.Props, mapping) + p.OrderBy = query.OrderBy + p.Filters = append([]cdb.ColumnFilter{match}, k.extra...) + if k.withUserID { + p.UserID = userID + } + return k.fetch(a, ctx, p) +} diff --git a/util/git/track.go b/util/git/track.go new file mode 100644 index 00000000..faba58bb --- /dev/null +++ b/util/git/track.go @@ -0,0 +1,262 @@ +package git + +import ( + "bytes" + "fmt" + "os" + "os/exec" + "path/filepath" + "regexp" + "sort" + "strings" + + "github.com/spf13/viper" +) + +// Track keeps the history of one text document per object in git, as the +// historical collector's gittrack module does for forms: one repository per +// object id under Dir, holding the document in a file named File. +type Track struct { + Dir string + File string +} + +// revPattern bounds the revisions passed to git: a commit id, a ref and the +// usual suffixes, never an option. +var revPattern = regexp.MustCompile(`^[A-Za-z0-9][A-Za-z0-9._/^~@{}-]*$`) + +// ValidRev reports whether s may be passed to git as a revision. +func ValidRev(s string) bool { return revPattern.MatchString(s) } + +func (t Track) repo(id string) string { return filepath.Join(t.Dir, id) } + +func (t Track) git(id string, args ...string) (string, error) { + cmd := exec.Command("git", append([]string{"--git-dir=" + filepath.Join(t.repo(id), ".git")}, args...)...) + var out, errOut bytes.Buffer + cmd.Stdout = &out + cmd.Stderr = &errOut + if err := cmd.Run(); err != nil { + return out.String(), fmt.Errorf("git %s: %w: %s", args[0], err, strings.TrimSpace(errOut.String())) + } + return out.String(), nil +} + +func (t Track) gitIn(id string, args ...string) error { + cmd := exec.Command("git", args...) + cmd.Dir = t.repo(id) + if out, err := cmd.CombinedOutput(); err != nil { + return fmt.Errorf("git %s: %w: %s", args[0], err, strings.TrimSpace(string(out))) + } + return nil +} + +// Exists reports whether the object has a history. +func (t Track) Exists(id string) bool { + _, err := os.Stat(filepath.Join(t.repo(id), ".git")) + return err == nil +} + +// authorArg formats "Name " for git --author, which requires the angle +// brackets even without an address. +func authorArg(author string) []string { + if author == "" { + return nil + } + if !strings.Contains(author, "<") { + author += " <>" + } + return []string{"--author=" + author} +} + +func (t Track) init(id, author string) error { + if err := os.MkdirAll(t.repo(id), 0o755); err != nil { + return err + } + email := viper.GetString("git.user_email") + if email == "" { + email = "nobody@localhost.localdomain" + } + for _, args := range [][]string{ + {"init"}, + {"config", "user.email", email}, + {"config", "user.name", "collector"}, + } { + if err := t.gitIn(id, args...); err != nil { + return err + } + } + return nil +} + +// Commit records a new content of the object's document. +func (t Track) Commit(id, content, author string) error { + if !t.Exists(id) { + if err := t.init(id, author); err != nil { + return err + } + } + _ = os.Remove(filepath.Join(t.repo(id), ".git", "index.lock")) + if err := os.WriteFile(filepath.Join(t.repo(id), t.File), []byte(content), 0o644); err != nil { + return err + } + if err := t.gitIn(id, "add", t.File); err != nil { + return err + } + args := append([]string{"commit", "-m", "change"}, authorArg(author)...) + // An unchanged content leaves nothing to commit: not an error. + _ = t.gitIn(id, append(args, "-a")...) + return nil +} + +// Read returns the current content of the object's document. +func (t Track) Read(id string) (string, error) { + b, err := os.ReadFile(filepath.Join(t.repo(id), t.File)) + return string(b), err +} + +// Revision is one entry of an object's history, as gittrack's parse_log() +// returns them for objects other than sysreports. +type Revision struct { + ID string `json:"id"` + CID string `json:"cid"` + Start string `json:"start"` + Content string `json:"content,omitempty"` + Stat []string `json:"stat"` + Summary string `json:"summary,omitempty"` + Group string `json:"group"` +} + +// Timeline returns the last 300 revisions of the object, newest first. +func (t Track) Timeline(id string) ([]Revision, error) { + if !t.Exists(id) { + return []Revision{}, nil + } + out, err := t.git(id, "log", "-n", "300", "--stat=510,500", "--date=iso", "--all") + if err != nil { + return nil, err + } + return parseLog(out, id), nil +} + +func parseLog(s, id string) []Revision { + var data []Revision + var d Revision + var stat strings.Builder + flush := func() { + if d.Start == "" { + return + } + changed := map[string]bool{} + for _, line := range strings.Split(stat.String(), "\n") { + if strings.Contains(line, "files changed") { + d.Summary = strings.TrimSpace(line) + continue + } + if !strings.Contains(line, " | ") { + continue + } + fpath := strings.Trim(strings.TrimSpace(strings.SplitN(line, " | ", 2)[0]), `"`) + changed[fpath] = true + } + d.Stat = make([]string, 0, len(changed)) + for fpath := range changed { + d.Stat = append(d.Stat, fpath) + } + sort.Strings(d.Stat) + d.Group = id + data = append(data, d) + } + for _, line := range strings.Split(s, "\n") { + switch { + case strings.HasPrefix(line, "commit"): + flush() + d = Revision{} + stat.Reset() + if fields := strings.Fields(line); len(fields) > 1 { + d.CID = fields[1] + d.ID = fields[1] + } + case strings.HasPrefix(line, "Author:"): + d.Content = line + case strings.HasPrefix(strings.TrimSpace(line), "rollback"): + d.Content += "
" + line + case strings.HasPrefix(line, "Date:"): + if fields := strings.Fields(line); len(fields) >= 3 { + d.Start = fields[1] + "T" + fields[2] + } + case d.CID != "" && d.Start != "": + stat.WriteString(line + "\n") + } + } + flush() + if data == nil { + data = []Revision{} + } + return data +} + +// Blob is the content of the document at a revision. +type Blob struct { + OID string `json:"oid"` + Content string `json:"content"` +} + +// At returns the document at a revision, nil when the revision holds none. +func (t Track) At(id, rev string) (*Blob, error) { + if !t.Exists(id) { + return nil, nil + } + out, err := t.git(id, "ls-tree", "-r", rev) + if err != nil { + return nil, err + } + for _, line := range strings.Split(out, "\n") { + fields := strings.Fields(line) + if len(fields) < 4 { + continue + } + content, err := t.git(id, "show", fields[2]) + if err != nil { + return nil, err + } + return &Blob{OID: fields[2], Content: content}, nil + } + return nil, nil +} + +// Show returns the change made by a revision, with its stats, as git prints it. +func (t Track) Show(id, rev string) (string, error) { + if !t.Exists(id) { + return "", nil + } + return t.git(id, "show", "--pretty=format:%ci%n%b", rev, "--numstat", "--patch") +} + +// Diff returns the differences of the document between two revisions. +func (t Track) Diff(id, rev1, rev2 string) (string, error) { + if !t.Exists(id) { + return "", nil + } + return t.git(id, "diff", "--pretty=format:%ci%n%b", rev1, rev2, "--", t.File) +} + +// Rollback restores the document of a revision as a new commit. +func (t Track) Rollback(id, rev, author string) error { + if !t.Exists(id) { + return fmt.Errorf("no history for %s", id) + } + shown, err := t.git(id, "show", "--pretty=format:%ci%n%b", rev, "--patch") + if err != nil { + return err + } + date := "" + if first, _, _ := strings.Cut(shown, "\n"); !strings.Contains(first, "diff") { + date = first + } + if err := t.gitIn(id, "checkout", rev, "--", t.File); err != nil { + return err + } + args := append([]string{"commit", "-m", "rollback to " + date}, authorArg(author)...) + _ = t.gitIn(id, append(args, "-a")...) + return nil +} diff --git a/util/logkey/main.go b/util/logkey/main.go index d50a937b..965e2c65 100644 --- a/util/logkey/main.go +++ b/util/logkey/main.go @@ -22,4 +22,5 @@ const ( StatusCode = "status_code" TagID = "tag_id" URI = "uri" + UserID = "user_id" ) diff --git a/worker/brocade.go b/worker/brocade.go new file mode 100644 index 00000000..bbf9aca1 --- /dev/null +++ b/worker/brocade.go @@ -0,0 +1,396 @@ +package worker + +import ( + "fmt" + "strconv" + "strings" +) + +type ( + // brocadeSwitch is what the switchshow, nsshow and zoneshow outputs of a + // brocade switch say, as the old collector read them in + // init/modules/brocade.py: the switch, its ports, the aliases of every + // zoning configuration, and the zones of the effective one. + brocadeSwitch struct { + Name string + Model string + WWN string + + // Ports are keyed by port index. + Ports map[string]*brocadePort + + // Alias is the ports of each alias, by configuration name. + Alias map[string]map[string][]string + + // Cfg is the name of the effective zoning configuration, empty when + // the switch reports none. + Cfg string + + // Zone is the ports of each zone of the effective configuration. + Zone map[string][]string + } + + brocadePort struct { + Index string + Slot string + Port string + Type string + State string + RemotePortName string + + // Speed is in Gb/s, 0 when negotiated but not yet known. Nego says + // the speed is negotiated, and is empty when the output does not + // tell. + Speed int + Nego string + + // NSE are the port names the name server reports behind the port, + // as the devices logged in through an NPIV port. + NSE []string + + trunkMaster *[2]string + } +) + +// parseBrocade reads the outputs of the switchshow, nsshow and zoneshow +// commands of a brocade switch. +func parseBrocade(switchshow, nsshow, zoneshow string) (*brocadeSwitch, error) { + s := &brocadeSwitch{ + Ports: make(map[string]*brocadePort), + Alias: make(map[string]map[string][]string), + Zone: make(map[string][]string), + } + if err := s.loadSwitchshow(switchshow); err != nil { + return nil, err + } + s.loadNsshow(nsshow) + s.loadZoneshow(zoneshow) + return s, nil +} + +// loadSwitchshow reads the switch identity and its port table: +// +// switchName: sansw1 +// switchType: 71.2 +// switchWwn: 10:00:00:05:33:a0:e6:42 +// ... +// Index Port Address Media Speed State Proto +// ================================================== +// 0 0 010000 id N8 Online FC F-Port 50:01:43:80:07:2d:f5:e6 +// 1 1 010100 id N8 Online FC E-Port 10:00:00:05:33:a0:e6:43 "sansw2" (downstream) +// +// The words past the columns of the table are a comment saying the port +// type and the name of the port at the other end. +func (s *brocadeSwitch) loadSwitchshow(buff string) error { + lines := strings.Split(buff, "\n") + if len(lines) < 2 { + return fmt.Errorf("switchshow is empty") + } + var ( + start, commentIdx int + cols []string + ) + for i, line := range lines { + switch { + case strings.HasPrefix(line, "switchName:"): + s.Name = strings.ToLower(strings.TrimSpace(afterColon(line))) + case strings.HasPrefix(line, "switchType"): + s.Model = strings.TrimSpace(afterColon(line)) + case strings.HasPrefix(line, "switchWwn"): + _, v, _ := strings.Cut(line, ":") + s.WWN = strings.TrimSpace(strings.ReplaceAll(v, ":", "")) + case strings.HasPrefix(line, "===="): + start = i + 1 + commentIdx = len(line) + if i > 0 { + cols = strings.Fields(lines[i-1]) + } + } + if start > 0 { + break + } + } + // A label with no port table says nothing of the ports: parsed as a + // switch with no port, it would have the job delete all its rows. + if start == 0 || len(cols) == 0 { + return fmt.Errorf("switchshow has no port table") + } + rindex := make(map[[2]string]string) + for _, line := range lines[start:] { + // A line shorter than the rule under the header is passed over, as + // the old collector did: an unlit port has no comment and is one, + // and the tables have never held those. + if len(line) < commentIdx { + continue + } + var comment string + if words := strings.Fields(line); len(words) >= len(cols)+1 { + comment = strings.Join(words[len(cols):], " ") + } + values := make(map[string]string) + for i, v := range strings.Fields(line[:commentIdx]) { + if i >= len(cols) { + break + } + values[cols[i]] = v + } + port := &brocadePort{ + Index: values["Index"], + Slot: "0", + Port: values["Port"], + Type: values["Type"], + State: values["State"], + } + if v, ok := values["Slot"]; ok { + port.Slot = v + } + if v, ok := values["Area"]; ok { + port.Index = v + } + if comment != "" { + switch { + case strings.Contains(comment, "E-Port"): + port.Type = "E-Port" + case strings.Contains(comment, "F-Port"): + port.Type = "F-Port" + } + words := strings.Fields(comment) + if len(words) >= 2 && strings.Contains(words[1], ":") { + port.RemotePortName = portName(words[1]) + } else if len(words) >= 3 && strings.Contains(words[2], ":") { + port.RemotePortName = portName(words[2]) + } + if strings.Contains(comment, "master is Port") { + // (Trunk port, master is Port 3 ) + parts := strings.Split(comment, "Port") + master := strings.TrimSpace(strings.Trim(parts[len(parts)-1], ") ")) + port.trunkMaster = &[2]string{port.Slot, master} + } else if strings.Contains(comment, "master is Slot") { + // (Trunk port, master is Slot 1 Port 0 ) + slot, sport := wordAfter(words, "Slot"), wordAfter(words, "Port") + port.trunkMaster = &[2]string{slot, sport} + } + } + speed := values["Speed"] + switch { + case speed == "AN": + port.Speed, port.Nego = 0, "F" + case strings.HasPrefix(speed, "N"): + port.Speed, _ = strconv.Atoi(strings.TrimPrefix(speed, "N")) + port.Nego = "T" + case strings.HasSuffix(speed, "G"): + port.Speed, _ = strconv.Atoi(strings.TrimSuffix(speed, "G")) + port.Nego = "F" + } + rindex[[2]string{port.Slot, port.Port}] = port.Index + s.Ports[port.Index] = port + } + // A slave port of a trunk takes the remote port name of its master. + for _, port := range s.Ports { + if port.trunkMaster == nil { + continue + } + if i, ok := rindex[*port.trunkMaster]; ok { + if master, ok := s.Ports[i]; ok { + port.RemotePortName = master.RemotePortName + } + } + } + return nil +} + +// loadNsshow adds to each port the port names the name server reports +// behind it: +// +// Type Pid COS PortName NodeName TTL(sec) +// N 020f01; 3;50:01:43:80:07:2d:f5:e6;50:01:43:80:07:2d:f5:e7; na +// FC4s: FCP +// Port Index: 32 +func (s *brocadeSwitch) loadNsshow(buff string) { + var name string + for _, line := range strings.Split(buff, "\n") { + if len(line) <= 2 { + continue + } + if line[1] != ' ' { + // a new entry + if fields := strings.Split(line, ";"); len(fields) == 5 { + name = strings.ReplaceAll(fields[2], ":", "") + } + continue + } + if strings.HasPrefix(strings.TrimSpace(line), "Port Index:") { + index := strings.TrimSpace(afterLastColon(line)) + if port, ok := s.Ports[index]; ok && name != "" { + port.NSE = append(port.NSE, name) + } + } + } +} + +// loadZoneshow reads the aliases of each zoning configuration, from the +// defined configurations, and the zones of the effective configuration: +// +// Defined configuration: +// cfg: PROD_CFG +// alias: DMX0197_8A0 +// 50:06:04:84:52:A4:F9:47 +// alias: Wdms01 10:00:00:00:C9:24:32:8C +// alias: EVA04 50:00:1F:E1:50:21:90:19; 50:00:1F:E1:50:21:90:1F; +// 50:00:1F:E1:50:21:90:1B; 50:00:1F:E1:50:21:90:1D +// +// Effective configuration: +// cfg: PROD_CFG +// zone: Wzzs01_DMX1370_9B1 +// 50:06:04:84:52:a6:1e:b8 +// 10:00:00:00:c9:3a:12:72 +func (s *brocadeSwitch) loadZoneshow(buff string) { + lines := strings.Split(buff, "\n") + effective := 0 + cfg := "" + haveCfg := false +firstPass: + for i, raw := range lines { + line := strings.TrimSpace(raw) + switch { + case strings.HasPrefix(line, "alias:"): + if !haveCfg { + continue + } + words := strings.Fields(line) + var alias string + var ports []string + switch len(words) { + case 2: + alias = words[1] + if i+1 < len(lines) { + ports = []string{portName(strings.TrimSpace(lines[i+1]))} + } + case 3: + alias = words[1] + ports = []string{portName(words[2])} + case 4: + alias = words[1] + ports = []string{portName(words[2]), portName(words[3])} + for j := i + 1; j < len(lines); j++ { + next := lines[j] + if strings.Contains(next, "alias") || len(next) == 0 { + break + } + for _, w := range strings.Fields(next) { + ports = append(ports, portName(w)) + } + } + default: + continue + } + s.Alias[cfg][alias] = ports + case strings.HasPrefix(line, "Effective configuration:"): + effective = i + break firstPass + case strings.HasPrefix(line, "cfg:"): + cfg = strings.TrimSpace(afterLastColon(line)) + haveCfg = true + s.Alias[cfg] = make(map[string][]string) + } + } + + lines = lines[effective:] + for i, raw := range lines { + line := strings.TrimSpace(raw) + switch { + case strings.HasPrefix(line, "zone:"): + words := strings.Fields(line) + zone := words[len(words)-1] + members := make([]string, 0) + for _, next := range lines[i+1:] { + next = strings.TrimSpace(next) + if strings.HasPrefix(next, "zone:") || len(next) == 0 { + break + } + members = append(members, strings.ToLower(strings.ReplaceAll(next, ":", ""))) + } + s.Zone[zone] = members + case strings.HasPrefix(line, "cfg:"): + s.Cfg = strings.TrimSpace(afterLastColon(line)) + } + } +} + +// portName is a port wwn as the tables store it: lower case, without its +// colons and its list separator. +func portName(s string) string { + s = strings.ReplaceAll(s, ":", "") + s = strings.ReplaceAll(s, ";", "") + return strings.ToLower(s) +} + +// afterColon returns what follows the first colon of s. +func afterColon(s string) string { + _, v, _ := strings.Cut(s, ":") + return v +} + +// afterLastColon returns what follows the last colon of s. +func afterLastColon(s string) string { + if i := strings.LastIndex(s, ":"); i >= 0 { + return s[i+1:] + } + return s +} + +// wordAfter returns the word following word in words, without the closing +// parenthesis a comment may end it with. +func wordAfter(words []string, word string) string { + for i, w := range words { + if w == word && i+1 < len(words) { + return strings.TrimSpace(strings.Trim(words[i+1], ")")) + } + } + return "" +} + +// rows are the lines of the switches table the switch fills, one per device +// the name server reports behind a port, or one for the port when it +// reports none: the column sw_portname holds the switch wwn, as the old +// collector filled it. +func (s *brocadeSwitch) rows() []any { + l := make([]any, 0, len(s.Ports)) + for _, p := range s.Ports { + row := func(rportname string) map[string]any { + return map[string]any{ + "sw_name": s.Name, + "sw_portname": s.WWN, + "sw_index": atoiOrNil(p.Index), + "sw_slot": atoiOrNil(p.Slot), + "sw_port": atoiOrNil(p.Port), + "sw_portspeed": p.Speed, + "sw_portnego": p.Nego, + "sw_portstate": p.State, + "sw_porttype": p.Type, + "sw_rportname": rportname, + } + } + n := 0 + for _, nse := range p.NSE { + if nse == p.RemotePortName { + continue + } + l = append(l, row(nse)) + n++ + } + if n == 0 { + l = append(l, row(p.RemotePortName)) + } + } + return l +} + +// atoiOrNil returns the integer s writes, or nil for a column the output +// did not fill. +func atoiOrNil(s string) any { + if i, err := strconv.Atoi(s); err == nil { + return i + } + return nil +} diff --git a/worker/brocade_test.go b/worker/brocade_test.go new file mode 100644 index 00000000..8d45fc07 --- /dev/null +++ b/worker/brocade_test.go @@ -0,0 +1,156 @@ +package worker + +import ( + "reflect" + "sort" + "testing" +) + +// The outputs of a Fabric OS switch, as the agent pushes them, in the formats +// the old collector parser was written against. +const ( + testSwitchshow = `switchName: SANSW1 +switchType: 71.2 +switchState: Online +switchMode: Native +switchRole: Principal +switchDomain: 1 +switchId: fffc01 +switchWwn: 10:00:00:05:33:a0:e6:42 +zoning: ON (PROD_CFG) +switchBeacon: OFF + +Index Port Address Media Speed State Proto +================================================== + 0 0 010000 id N8 Online FC F-Port 50:01:43:80:07:2d:f5:e6 + 1 1 010100 id N16 Online FC F-Port 1 N Port + 2 NPIV public + 2 2 010200 id 8G Online FC E-Port 10:00:00:05:33:a0:e6:43 "sansw2" (downstream) + 3 3 010300 id 8G Online FC E-Port (Trunk port, master is Port 2 ) + 4 4 010400 id AN No_Light FC +` + testNsshow = `{ + Type Pid COS PortName NodeName TTL(sec) + N 010000; 3;50:01:43:80:07:2d:f5:e6;50:01:43:80:07:2d:f5:e7; na + FC4s: FCP + Port Index: 0 + N 010100; 3;20:00:00:25:b5:00:00:01;20:00:00:25:b5:00:00:ff; na + FC4s: FCP + Port Index: 1 + N 010101; 3;20:00:00:25:b5:00:00:02;20:00:00:25:b5:00:00:ff; na + FC4s: FCP + Port Index: 1 + N 019900; 3;20:00:00:25:b5:00:00:09;20:00:00:25:b5:00:00:ff; na + Port Index: 99 +The Local Name Server has 4 entries } +` + testZoneshow = `Defined configuration: + cfg: PROD_CFG + alias: DMX0197_8A0 + 50:06:04:84:52:A4:F9:47 + alias: Wdms01 10:00:00:00:C9:24:32:8C + alias: EVA04 50:00:1F:E1:50:21:90:19; 50:00:1F:E1:50:21:90:1F; + 50:00:1F:E1:50:21:90:1B; 50:00:1F:E1:50:21:90:1D + +Effective configuration: + cfg: PROD_CFG + zone: Wzzs01_DMX1370_9B1 + 50:06:04:84:52:a6:1e:b8 + 10:00:00:00:c9:3a:12:72 + zone: Wdms01_EVA04 + 10:00:00:00:c9:24:32:8c + 50:00:1f:e1:50:21:90:19 + +` +) + +func equal(t *testing.T, what string, got, want any) { + t.Helper() + if !reflect.DeepEqual(got, want) { + t.Errorf("%s: got %#v, want %#v", what, got, want) + } +} + +func parseTestBrocade(t *testing.T) *brocadeSwitch { + t.Helper() + s, err := parseBrocade(testSwitchshow, testNsshow, testZoneshow) + if err != nil { + t.Fatalf("parse: %s", err) + } + return s +} + +func TestParseBrocadeSwitch(t *testing.T) { + s := parseTestBrocade(t) + equal(t, "name", s.Name, "sansw1") + equal(t, "model", s.Model, "71.2") + equal(t, "wwn", s.WWN, "1000000533a0e642") + equal(t, "port count, the unlit port 4 passed over as the old collector did", len(s.Ports), 4) + + p := s.Ports["0"] + equal(t, "port 0 type", p.Type, "F-Port") + equal(t, "port 0 state", p.State, "Online") + equal(t, "port 0 remote", p.RemotePortName, "5001438007"+"2df5e6") + equal(t, "port 0 speed", p.Speed, 8) + equal(t, "port 0 nego", p.Nego, "T") + + p = s.Ports["1"] + equal(t, "port 1 speed", p.Speed, 16) + equal(t, "port 1 remote, no wwn in the comment of an npiv port", p.RemotePortName, "") + equal(t, "port 1 name server entries", p.NSE, []string{"20000025b5000001", "20000025b5000002"}) + + p = s.Ports["2"] + equal(t, "port 2 type", p.Type, "E-Port") + equal(t, "port 2 speed", p.Speed, 8) + equal(t, "port 2 nego", p.Nego, "F") + equal(t, "port 2 remote", p.RemotePortName, "1000000533a0e643") + + p = s.Ports["3"] + equal(t, "port 3 type", p.Type, "E-Port") + equal(t, "port 3 remote, taken from its trunk master", p.RemotePortName, "1000000533a0e643") +} + +func TestParseBrocadeZoning(t *testing.T) { + s := parseTestBrocade(t) + equal(t, "effective cfg", s.Cfg, "PROD_CFG") + equal(t, "aliases", s.Alias["PROD_CFG"], map[string][]string{ + "DMX0197_8A0": {"5006048452a4f947"}, + "Wdms01": {"10000000c924328c"}, + "EVA04": {"50001fe150219019", "50001fe15021901f", "50001fe15021901b", "50001fe15021901d"}, + }) + equal(t, "zones", s.Zone, map[string][]string{ + "Wzzs01_DMX1370_9B1": {"5006048452a61eb8", "10000000c93a1272"}, + "Wdms01_EVA04": {"10000000c924328c", "50001fe150219019"}, + }) +} + +// A port behind which the name server reports devices gets a row per +// device, and a port with none gets one row, with the port at the other end. +func TestBrocadeRows(t *testing.T) { + s := parseTestBrocade(t) + var got []string + for _, r := range s.rows() { + m := r.(map[string]any) + equal(t, "sw_name", m["sw_name"], "sansw1") + equal(t, "sw_portname", m["sw_portname"], "1000000533a0e642") + got = append(got, m["sw_rportname"].(string)) + } + sort.Strings(got) + equal(t, "remote port names", got, []string{ + "1000000533a0e643", + "1000000533a0e643", + "20000025b5000001", + "20000025b5000002", + "50014380072df5e6", + }) +} + +// A switchshow without its port table is refused rather than read as a +// switch without ports, which would have the job delete them all. +func TestParseBrocadeRefusesATruncatedSwitchshow(t *testing.T) { + if _, err := parseBrocade("switchName: sansw1\nswitchWwn: 10:00:00:05:33:a0:e6:42\n", "", ""); err == nil { + t.Error("a switchshow without a port table is accepted") + } + if _, err := parseBrocade("", "", ""); err == nil { + t.Error("an empty switchshow is accepted") + } +} diff --git a/worker/job_feed_san_switch.go b/worker/job_feed_san_switch.go new file mode 100644 index 00000000..9e21f6cd --- /dev/null +++ b/worker/job_feed_san_switch.go @@ -0,0 +1,218 @@ +package worker + +import ( + "context" + "encoding/json" + "fmt" + "log/slog" + + "github.com/go-redis/redis/v8" + + "github.com/opensvc/oc3/cachekeys" + "github.com/opensvc/oc3/feeder" + "github.com/opensvc/oc3/mariadb" + "github.com/opensvc/oc3/util/logkey" +) + +type ( + // jobFeedSANSwitch parses the configuration of a SAN switch an agent + // reported, and stores it in the switches, san_zone and san_zone_alias + // tables, as the old collector did from the update_brocade rpc. + jobFeedSANSwitch struct { + JobBase + JobRedis + JobDB + + // idx is @, the key of the report in FeedSANSwitchH. + idx string + + data feeder.SANSwitch + brocade *brocadeSwitch + } +) + +func newSANSwitch(idx string) *jobFeedSANSwitch { + return &jobFeedSANSwitch{ + JobBase: JobBase{ + name: jtSANSwitch, + detail: "switch: " + idx, + logger: slog.With(logkey.Object, idx, logkey.JobName, jtSANSwitch), + }, + JobRedis: JobRedis{ + cachePendingH: cachekeys.FeedSANSwitchPendingH, + cachePendingIDX: idx, + }, + idx: idx, + } +} + +func (d *jobFeedSANSwitch) Operations() []operation { + return []operation{ + {name: "dropPending", do: d.dropPending}, + {name: "getData", do: d.getData}, + {name: "parse", do: d.parse}, + {name: "dbNow", do: d.dbNow}, + {name: "updateDB", do: d.updateDB}, + {name: "pushFromTableChanges", do: d.pushFromTableChanges}, + } +} + +func (d *jobFeedSANSwitch) getData(ctx context.Context) error { + result, err := d.redis.HGet(ctx, cachekeys.FeedSANSwitchH, d.idx).Result() + switch err { + case nil: + case redis.Nil: + return fmt.Errorf("HGET: no results") + default: + return fmt.Errorf("HGET: %w", err) + } + if err := json.Unmarshal([]byte(result), &d.data); err != nil { + return fmt.Errorf("unmarshal: %w", err) + } + return nil +} + +// parse reads the command outputs of the switch, with the parser of its +// type. +func (d *jobFeedSANSwitch) parse(context.Context) error { + switch d.data.Type { + case feeder.Brocade: + s, err := parseBrocade(d.data.Data["switchshow"], d.data.Data["nsshow"], d.data.Data["zoneshow"]) + if err != nil { + return fmt.Errorf("parse %s: %w", d.idx, err) + } + if s.Name == "" { + // The switch did not say its name: keep the one it was + // reached by, as the old collector named it after the + // directory its report was stored in. + s.Name = d.data.Name + } + d.brocade = s + return nil + default: + return fmt.Errorf("unsupported switch type %q", d.data.Type) + } +} + +// updateDB replaces the rows of the switch, of the aliases of each of its +// configurations, and of the zones of its effective configuration, by the +// ones just parsed: the rows written now are upserted, and the older ones +// of the same switch or configuration deleted. +// +// CREATE TABLE `switches` ( +// `id` int(11) NOT NULL AUTO_INCREMENT, +// `sw_name` varchar(64) NOT NULL, +// `sw_slot` int(11) DEFAULT NULL, +// `sw_port` int(11) DEFAULT NULL, +// `sw_portspeed` int(11) DEFAULT NULL, +// `sw_portnego` varchar(1) DEFAULT '', +// `sw_porttype` varchar(16) DEFAULT '', +// `sw_portstate` varchar(16) DEFAULT '', +// `sw_portname` varchar(16) DEFAULT '', +// `sw_rportname` varchar(128) DEFAULT NULL, +// `sw_updated` datetime NOT NULL, +// `sw_fabric` varchar(128) DEFAULT NULL, +// `sw_index` int(11) DEFAULT NULL, +// PRIMARY KEY (`id`), +// UNIQUE KEY `idx1` (`sw_name`,`sw_slot`,`sw_port`,`sw_rportname`), +// KEY `idx2` (`sw_portname`,`sw_rportname`) +// ) +// +// CREATE TABLE `san_zone` ( +// `id` int(11) NOT NULL AUTO_INCREMENT, +// `cfg` varchar(128) DEFAULT '', +// `zone` varchar(128) DEFAULT '', +// `port` varchar(16) DEFAULT '', +// `updated` datetime NOT NULL, +// PRIMARY KEY (`id`), +// UNIQUE KEY `idx1` (`cfg`,`zone`,`port`) +// ) +// +// CREATE TABLE `san_zone_alias` ( +// `id` int(11) NOT NULL AUTO_INCREMENT, +// `cfg` varchar(128) DEFAULT '', +// `alias` varchar(128) DEFAULT '', +// `port` varchar(16) DEFAULT '', +// `updated` datetime NOT NULL, +// PRIMARY KEY (`id`), +// UNIQUE KEY `idx1` (`cfg`,`alias`,`port`) +// ) +func (d *jobFeedSANSwitch) updateDB(ctx context.Context) error { + s := d.brocade + now := d.now + + for cfg, aliases := range s.Alias { + rows := make([]any, 0) + for alias, ports := range aliases { + for _, port := range ports { + rows = append(rows, map[string]any{"cfg": cfg, "alias": alias, "port": port, "updated": now}) + } + } + if err := d.upsert(ctx, "san_zone_alias", []string{"cfg", "alias", "port"}, []string{"cfg", "alias", "port", "updated"}, rows); err != nil { + return err + } + if err := d.deleteOlder(ctx, "san_zone_alias", "cfg", cfg, "updated", now); err != nil { + return err + } + } + + if s.Cfg != "" { + rows := make([]any, 0) + for zone, ports := range s.Zone { + for _, port := range ports { + rows = append(rows, map[string]any{"cfg": s.Cfg, "zone": zone, "port": port, "updated": now}) + } + } + if err := d.upsert(ctx, "san_zone", []string{"cfg", "zone", "port"}, []string{"cfg", "zone", "port", "updated"}, rows); err != nil { + return err + } + if err := d.deleteOlder(ctx, "san_zone", "cfg", s.Cfg, "updated", now); err != nil { + return err + } + } + + rows := s.rows() + for _, row := range rows { + row.(map[string]any)["sw_updated"] = now + } + columns := []string{"sw_name", "sw_portname", "sw_index", "sw_slot", "sw_port", "sw_portspeed", "sw_portnego", "sw_portstate", "sw_porttype", "sw_rportname", "sw_updated"} + if err := d.upsert(ctx, "switches", []string{"sw_name", "sw_slot", "sw_port", "sw_rportname"}, columns, rows); err != nil { + return err + } + return d.deleteOlder(ctx, "switches", "sw_name", s.Name, "sw_updated", now) +} + +// upsert inserts or updates rows in table, on the unique key keys. +func (d *jobFeedSANSwitch) upsert(ctx context.Context, table string, keys, columns []string, rows []any) error { + if len(rows) == 0 { + return nil + } + mappings := make(mariadb.Mappings, len(columns)) + for i, column := range columns { + mappings[i] = mariadb.Mapping{To: column} + } + request := mariadb.InsertOrUpdate{ + Table: table, + Mappings: mappings, + Keys: keys, + Data: rows, + } + if count, err := request.ExecContextAndCountRowsAffected(ctx, d.db); err != nil { + return fmt.Errorf("upsert %s: %w", table, err) + } else if count > 0 { + d.oDb.SetChange(table) + } + return nil +} + +// deleteOlder deletes the rows of table whose column key is value, updated +// before the rows just written. +func (d *jobFeedSANSwitch) deleteOlder(ctx context.Context, table, key string, value any, updated string, now any) error { + query := fmt.Sprintf("DELETE FROM `%s` WHERE `%s` = ? AND `%s` < ?", table, key, updated) + if count, err := d.oDb.ExecContextAndCountRowsAffected(ctx, query, value, now); err != nil { + return fmt.Errorf("query %s: %w", query, err) + } else if count > 0 { + d.oDb.SetChange(table) + } + return nil +} diff --git a/worker/metrics.go b/worker/metrics.go index 942ff185..54d4c1c3 100644 --- a/worker/metrics.go +++ b/worker/metrics.go @@ -15,7 +15,7 @@ var ( Namespace: "oc3", Name: "feed_job_executions_total", Help: fmt.Sprintf("Total number of feed job executions (job_type={%s}, status={%s})", - strings.Join([]string{jtDaemonPing, jtDaemonStatus, jtNodeSystem, jtInstanceAction, jtInstanceResourceInfo, jtInstanceStatus, jtNodeDisk, jtObjectConfig}, "|"), + strings.Join([]string{jtDaemonPing, jtDaemonStatus, jtNodeSystem, jtInstanceAction, jtInstanceResourceInfo, jtInstanceStatus, jtNodeDisk, jtObjectConfig, jtSANSwitch}, "|"), strings.Join([]string{jobStatusFailed, jobStatusOk}, "|")), }, []string{"job_type", "status"}, @@ -27,7 +27,7 @@ var ( Namespace: "oc3", Name: "feed_job_duration_seconds", Help: fmt.Sprintf("Duration of entire feed job executions in seconds (job_type={%s}, status={%s})", - strings.Join([]string{jtDaemonPing, jtDaemonStatus, jtNodeSystem, jtInstanceAction, jtInstanceResourceInfo, jtInstanceStatus, jtNodeDisk, jtObjectConfig}, "|"), + strings.Join([]string{jtDaemonPing, jtDaemonStatus, jtNodeSystem, jtInstanceAction, jtInstanceResourceInfo, jtInstanceStatus, jtNodeDisk, jtObjectConfig, jtSANSwitch}, "|"), strings.Join([]string{jobStatusFailed, jobStatusOk}, "|")), Buckets: prometheus.DefBuckets, }, @@ -40,7 +40,7 @@ var ( Namespace: "oc3", Name: "feed_job_step_duration_seconds", Help: fmt.Sprintf("Duration of individual steps within feed jobs in seconds (job_type={%s}, status={%s}, job_step={main|...}})", - strings.Join([]string{jtDaemonPing, jtDaemonStatus, jtNodeSystem, jtInstanceAction, jtInstanceResourceInfo, jtInstanceStatus, jtNodeDisk, jtObjectConfig}, "|"), + strings.Join([]string{jtDaemonPing, jtDaemonStatus, jtNodeSystem, jtInstanceAction, jtInstanceResourceInfo, jtInstanceStatus, jtNodeDisk, jtObjectConfig, jtSANSwitch}, "|"), strings.Join([]string{jobStatusFailed, jobStatusOk}, "|")), Buckets: prometheus.DefBuckets, }, diff --git a/worker/worker.go b/worker/worker.go index f442d33d..effb9182 100644 --- a/worker/worker.go +++ b/worker/worker.go @@ -74,6 +74,7 @@ const ( jtNodeDisk = "nodeDisk" jtNodeSystem = "nodeSystem" jtObjectConfig = "objectConfig" + jtSANSwitch = "sanSwitch" // job or job step statuses jobStatusOk = "ok" @@ -145,6 +146,14 @@ func (w *Worker) runJob(unqueuedJob []string) error { return fmt.Errorf("invalid feed node disk index expected `nodename`@`nodeID`@`clusterID` found: %s", unqueuedJob[1]) } j = newNodeDisk(l[0], l[1], l[2]) + case cachekeys.FeedSANSwitchQ: + // expected unqueuedJob[1]: @ + if l := strings.SplitN(unqueuedJob[1], "@", 2); len(l) != 2 || l[0] == "" || l[1] == "" { + err := fmt.Errorf("invalid feed san switch index expected `type`@`name` found: %s", unqueuedJob[1]) + slog.Warn(err.Error()) + return err + } + j = newSANSwitch(unqueuedJob[1]) case cachekeys.FeedObjectConfigQ: objectName, nodeID, ClusterID, err := w.jobToInstanceAndClusterID(unqueuedJob[1]) if err != nil { diff --git a/xauth/w2p.go b/xauth/w2p.go index a770b6a4..56cac972 100644 --- a/xauth/w2p.go +++ b/xauth/w2p.go @@ -4,6 +4,7 @@ import ( "context" "crypto/hmac" "crypto/md5" + "crypto/rand" "crypto/sha1" "crypto/sha256" "crypto/sha512" @@ -153,6 +154,12 @@ func toSHA1(b []byte) []byte { return a[:] } +// VerifyWeb2pyPassword tells whether password matches a hash stored by web2py +// or by HashWeb2pyPassword, as the sign-in does. +func VerifyWeb2pyPassword(password, storedHash, hmacKey string) bool { + return verifyWeb2pyPassword(password, storedHash, hmacKey) +} + func verifyWeb2pyPassword(password, storedHash, hmacKey string) bool { if storedHash == "" { return false @@ -214,3 +221,29 @@ func verifyWeb2pyPassword(password, storedHash, hmacKey string) bool { computedHash := prefix + hex.EncodeToString(digestBytes) return hmac.Equal([]byte(computedHash), []byte(storedHash)) } + +// HashWeb2pyPassword returns a password hash in the web2py format that +// verifyWeb2pyPassword accepts: "sha512$$", the digest being an +// HMAC-SHA512 keyed with hmacKey and the salt when a key is configured, as web2py's +// CRYPT does, and a salted SHA-512 otherwise. +func HashWeb2pyPassword(password, hmacKey string) (string, error) { + saltBytes := make([]byte, 8) + if _, err := rand.Read(saltBytes); err != nil { + return "", fmt.Errorf("HashWeb2pyPassword: %w", err) + } + salt := hex.EncodeToString(saltBytes) + var digest []byte + if hmacKey != "" { + alg, keyPart := "sha512", hmacKey + if a, k, ok := strings.Cut(hmacKey, ":"); ok { + alg, keyPart = a, k + } + if alg != "sha512" { + return "", fmt.Errorf("HashWeb2pyPassword: unsupported hmac algorithm %q", alg) + } + digest = toHMACSHA512([]byte(keyPart+salt), []byte(password)) + } else { + digest = toSHA512([]byte(password + salt)) + } + return "sha512$" + salt + "$" + hex.EncodeToString(digest), nil +}