-
Notifications
You must be signed in to change notification settings - Fork 350
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
186 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
server/controller/db/mysql/migration/rawsql/issu/6.6.1.8.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
CREATE TABLE IF NOT EXISTS license_func_log ( | ||
id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, | ||
team_id INTEGER DEFAULT 1, | ||
agent_name VARCHAR(256) NOT NULL, | ||
agent_id INTEGER NOT NULL, | ||
user_id INTEGER NOT NULL, | ||
license_function INTEGER NOT NULL COMMENT '1.traffic distribution 2.network monitoring 3.call monitoring 4.function monitoring 5.application monitoring 6.indicator monitoring 7.database monitoring 8.log monitoring 9.max', | ||
enabled INTEGER NOT NULL COMMENT '0.false 1.true', | ||
created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP | ||
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8; | ||
|
||
BEGIN | ||
DECLARE current_db_name VARCHAR(255); | ||
|
||
-- check whether current db is default, @defaultDatabaseName variable will be added by code when sql is executed | ||
SELECT DATABASE() INTO current_db_name; | ||
IF @defaultDatabaseName = current_db_name THEN | ||
UPDATE vtap | ||
SET license_functions = '1,2,3,4,5,6,7,8' | ||
WHERE EXISTS ( | ||
SELECT 1 | ||
FROM consumer_bill | ||
) AND (license_functions IS NULL OR license_functions = ''); | ||
|
||
END IF; | ||
-- do migration in default and non-default dbs | ||
END; | ||
|
||
-- whether default db or not, update db_version to latest, remember update DB_VERSION_EXPECT in migrate/init.go | ||
UPDATE db_version SET version='6.6.1.8'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
server/controller/http/service/agentlicense/agent_license_func.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
* Copyright (c) 2024 Yunshan Networks | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package agentlicense | ||
|
||
import ( | ||
"github.com/deepflowio/deepflow/server/controller/config" | ||
"github.com/deepflowio/deepflow/server/controller/db/mysql" | ||
) | ||
|
||
func GetAgentLicenseFunctions(cfg *config.ControllerConfig, userID int, agent *mysql.VTap, | ||
licenseFunctions []interface{}) (string, []mysql.LicenseFuncLog, error) { | ||
|
||
return "", nil, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module github.com/deepflowio/deepflow/server/controller/http/service/agentlicense | ||
|
||
go 1.18 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.