namirasoft-cost 1.4.27 → 1.4.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.ns-sdkg-dir-deep +3 -3
- package/.ns-sdkg-file-keep +36 -26
- package/dist/NamirasoftCostServer.js +1 -1
- package/dist/NamirasoftCostServerBillWatchAWS.d.ts +4 -15
- package/dist/NamirasoftCostServerBillWatchAWS.js +2 -2
- package/dist/NamirasoftCostServerBillWatchAWS.js.map +1 -1
- package/dist/NamirasoftCostServerBillWatchAzure.d.ts +4 -15
- package/dist/NamirasoftCostServerBillWatchAzure.js +2 -2
- package/dist/NamirasoftCostServerBillWatchAzure.js.map +1 -1
- package/dist/NamirasoftCostServerBillWatchGCP.d.ts +4 -15
- package/dist/NamirasoftCostServerBillWatchGCP.js +2 -2
- package/dist/NamirasoftCostServerBillWatchGCP.js.map +1 -1
- package/dist/NamirasoftCostServerCost.d.ts +0 -2
- package/dist/NamirasoftCostServerCost.js +0 -8
- package/dist/NamirasoftCostServerCost.js.map +1 -1
- package/dist/NamirasoftCostServerFieldCategory.d.ts +4 -15
- package/dist/NamirasoftCostServerFieldCategory.js +2 -2
- package/dist/NamirasoftCostServerFieldCategory.js.map +1 -1
- package/dist/NamirasoftCostServerFieldField.d.ts +4 -15
- package/dist/NamirasoftCostServerFieldField.js +2 -2
- package/dist/NamirasoftCostServerFieldField.js.map +1 -1
- package/dist/NamirasoftCostServerSecretSecret.d.ts +6 -29
- package/dist/NamirasoftCostServerSecretSecret.js +2 -2
- package/dist/NamirasoftCostServerSecretSecret.js.map +1 -1
- package/dist/command/BillWatchAWSCommand.d.ts +4 -0
- package/dist/command/BillWatchAWSCommand.js +17 -0
- package/dist/command/BillWatchAWSCommand.js.map +1 -0
- package/dist/command/BillWatchAWSEstimateRecordCommand.d.ts +5 -0
- package/dist/command/BillWatchAWSEstimateRecordCommand.js +103 -0
- package/dist/command/BillWatchAWSEstimateRecordCommand.js.map +1 -0
- package/dist/command/BillWatchAWS_CreateForRecordCommand.d.ts +5 -0
- package/dist/command/BillWatchAWS_CreateForRecordCommand.js +112 -0
- package/dist/command/BillWatchAWS_CreateForRecordCommand.js.map +1 -0
- package/dist/command/BillWatchAzureCommand.d.ts +4 -0
- package/dist/command/BillWatchAzureCommand.js +17 -0
- package/dist/command/BillWatchAzureCommand.js.map +1 -0
- package/dist/command/BillWatchAzureEstimateRecordCommand.d.ts +5 -0
- package/dist/command/BillWatchAzureEstimateRecordCommand.js +103 -0
- package/dist/command/BillWatchAzureEstimateRecordCommand.js.map +1 -0
- package/dist/command/BillWatchAzure_CreateForRecordCommand.d.ts +5 -0
- package/dist/command/BillWatchAzure_CreateForRecordCommand.js +112 -0
- package/dist/command/BillWatchAzure_CreateForRecordCommand.js.map +1 -0
- package/dist/command/BillWatchGCPCommand.d.ts +4 -0
- package/dist/command/BillWatchGCPCommand.js +17 -0
- package/dist/command/BillWatchGCPCommand.js.map +1 -0
- package/dist/command/BillWatchGCPEstimateRecordCommand.d.ts +5 -0
- package/dist/command/BillWatchGCPEstimateRecordCommand.js +103 -0
- package/dist/command/BillWatchGCPEstimateRecordCommand.js.map +1 -0
- package/dist/command/BillWatchGCP_CreateForRecordCommand.d.ts +5 -0
- package/dist/command/BillWatchGCP_CreateForRecordCommand.js +112 -0
- package/dist/command/BillWatchGCP_CreateForRecordCommand.js.map +1 -0
- package/dist/command/CostCommand.d.ts +4 -0
- package/dist/command/CostCommand.js +15 -0
- package/dist/command/CostCommand.js.map +1 -0
- package/dist/command/CostListCommand.d.ts +5 -0
- package/dist/command/CostListCommand.js +38 -0
- package/dist/command/CostListCommand.js.map +1 -0
- package/dist/command/FieldCategoryCommand.d.ts +4 -0
- package/dist/command/FieldCategoryCommand.js +17 -0
- package/dist/command/FieldCategoryCommand.js.map +1 -0
- package/dist/command/FieldCategoryEstimateRecordCommand.d.ts +5 -0
- package/dist/command/FieldCategoryEstimateRecordCommand.js +103 -0
- package/dist/command/FieldCategoryEstimateRecordCommand.js.map +1 -0
- package/dist/command/FieldCategory_CreateForRecordCommand.d.ts +5 -0
- package/dist/command/FieldCategory_CreateForRecordCommand.js +112 -0
- package/dist/command/FieldCategory_CreateForRecordCommand.js.map +1 -0
- package/dist/command/FieldFieldCommand.d.ts +4 -0
- package/dist/command/FieldFieldCommand.js +17 -0
- package/dist/command/FieldFieldCommand.js.map +1 -0
- package/dist/command/FieldFieldEstimateRecordCommand.d.ts +5 -0
- package/dist/command/FieldFieldEstimateRecordCommand.js +103 -0
- package/dist/command/FieldFieldEstimateRecordCommand.js.map +1 -0
- package/dist/command/FieldField_CreateForRecordCommand.d.ts +5 -0
- package/dist/command/FieldField_CreateForRecordCommand.js +112 -0
- package/dist/command/FieldField_CreateForRecordCommand.js.map +1 -0
- package/dist/command/HealthzCommand.d.ts +4 -0
- package/dist/command/HealthzCommand.js +15 -0
- package/dist/command/HealthzCommand.js.map +1 -0
- package/dist/command/HealthzGetCommand.d.ts +5 -0
- package/dist/command/HealthzGetCommand.js +38 -0
- package/dist/command/HealthzGetCommand.js.map +1 -0
- package/dist/command/MetricsCommand.d.ts +4 -0
- package/dist/command/MetricsCommand.js +15 -0
- package/dist/command/MetricsCommand.js.map +1 -0
- package/dist/command/MetricsGetCommand.d.ts +5 -0
- package/dist/command/MetricsGetCommand.js +38 -0
- package/dist/command/MetricsGetCommand.js.map +1 -0
- package/dist/command/SecretSecretCommand.d.ts +4 -0
- package/dist/command/SecretSecretCommand.js +21 -0
- package/dist/command/SecretSecretCommand.js.map +1 -0
- package/dist/command/SecretSecretEstimateReadCommand.d.ts +5 -0
- package/dist/command/SecretSecretEstimateReadCommand.js +103 -0
- package/dist/command/SecretSecretEstimateReadCommand.js.map +1 -0
- package/dist/command/SecretSecretEstimateRecordCommand.d.ts +5 -0
- package/dist/command/SecretSecretEstimateRecordCommand.js +103 -0
- package/dist/command/SecretSecretEstimateRecordCommand.js.map +1 -0
- package/dist/command/SecretSecret_CreateForReadCommand.d.ts +5 -0
- package/dist/command/SecretSecret_CreateForReadCommand.js +112 -0
- package/dist/command/SecretSecret_CreateForReadCommand.js.map +1 -0
- package/dist/command/SecretSecret_CreateForRecordCommand.d.ts +5 -0
- package/dist/command/SecretSecret_CreateForRecordCommand.js +112 -0
- package/dist/command/SecretSecret_CreateForRecordCommand.js.map +1 -0
- package/dist/command/ValueCommand.d.ts +4 -0
- package/dist/command/ValueCommand.js +15 -0
- package/dist/command/ValueCommand.js.map +1 -0
- package/dist/command/ValueListCommand.d.ts +5 -0
- package/dist/command/ValueListCommand.js +38 -0
- package/dist/command/ValueListCommand.js.map +1 -0
- package/dist/command/cli.d.ts +2 -0
- package/dist/command/cli.js +32 -0
- package/dist/command/cli.js.map +1 -0
- package/dist/index.d.ts +47 -12
- package/dist/index.js +47 -12
- package/dist/index.js.map +1 -1
- package/package.json +28 -28
- package/src/NamirasoftCostServer.ts +59 -59
- package/src/NamirasoftCostServerBase.ts +29 -29
- package/src/NamirasoftCostServerBillWatchAWS.ts +47 -46
- package/src/NamirasoftCostServerBillWatchAzure.ts +47 -46
- package/src/NamirasoftCostServerBillWatchGCP.ts +47 -46
- package/src/NamirasoftCostServerCost.ts +41 -49
- package/src/NamirasoftCostServerFieldCategory.ts +47 -46
- package/src/NamirasoftCostServerFieldField.ts +47 -46
- package/src/NamirasoftCostServerHealthz.ts +35 -35
- package/src/NamirasoftCostServerMetrics.ts +35 -35
- package/src/NamirasoftCostServerSecretSecret.ts +61 -60
- package/src/NamirasoftCostServerValue.ts +36 -36
- package/src/bonus/BaseBonus.ts +13 -13
- package/src/bonus/DeactiveBonus.ts +14 -14
- package/src/bonus/FreeCountBonus.ts +14 -14
- package/src/bonus/FreeTotalValueBonus.ts +28 -28
- package/src/bonus/LowAmountBonus.ts +14 -14
- package/src/bonus/LowSecondsBonus.ts +14 -14
- package/src/bonus/LowTotalCountBonus.ts +14 -14
- package/src/bonus/LowTotalValueBonus.ts +14 -14
- package/src/bonus/TrialBonus.ts +18 -18
- package/src/command/BillWatchAWSCommand.ts +34 -0
- package/src/command/BillWatchAWSEstimateRecordCommand.ts +110 -0
- package/src/command/BillWatchAWS_CreateForRecordCommand.ts +119 -0
- package/src/command/BillWatchAzureCommand.ts +34 -0
- package/src/command/BillWatchAzureEstimateRecordCommand.ts +110 -0
- package/src/command/BillWatchAzure_CreateForRecordCommand.ts +119 -0
- package/src/command/BillWatchGCPCommand.ts +34 -0
- package/src/command/BillWatchGCPEstimateRecordCommand.ts +110 -0
- package/src/command/BillWatchGCP_CreateForRecordCommand.ts +119 -0
- package/src/{row/CostCreateRow.ts → command/CostCommand.ts} +32 -38
- package/src/command/CostListCommand.ts +45 -0
- package/src/command/FieldCategoryCommand.ts +34 -0
- package/src/command/FieldCategoryEstimateRecordCommand.ts +110 -0
- package/src/command/FieldCategory_CreateForRecordCommand.ts +119 -0
- package/src/command/FieldFieldCommand.ts +34 -0
- package/src/command/FieldFieldEstimateRecordCommand.ts +110 -0
- package/src/command/FieldField_CreateForRecordCommand.ts +119 -0
- package/src/command/HealthzCommand.ts +32 -0
- package/src/command/HealthzGetCommand.ts +45 -0
- package/src/command/MetricsCommand.ts +32 -0
- package/src/command/MetricsGetCommand.ts +45 -0
- package/src/command/SecretSecretCommand.ts +38 -0
- package/src/command/SecretSecretEstimateReadCommand.ts +110 -0
- package/src/command/SecretSecretEstimateRecordCommand.ts +110 -0
- package/src/command/SecretSecret_CreateForReadCommand.ts +119 -0
- package/src/command/SecretSecret_CreateForRecordCommand.ts +119 -0
- package/src/command/ValueCommand.ts +32 -0
- package/src/command/ValueListCommand.ts +45 -0
- package/src/command/cli.ts +51 -0
- package/src/estimator/BaseEstimator.ts +62 -62
- package/src/estimator/BillWatchAWSRecordEstimator.ts +4 -4
- package/src/estimator/BillWatchAzureRecordEstimator.ts +4 -4
- package/src/estimator/BillWatchBaseRecordEstimator.ts +25 -25
- package/src/estimator/BillWatchGCPRecordEstimator.ts +4 -4
- package/src/estimator/FieldBaseRecordEstimator.ts +20 -20
- package/src/estimator/FieldCategoryRecordEstimator.ts +9 -9
- package/src/estimator/FieldFieldRecordEstimator.ts +9 -9
- package/src/estimator/SecretSecretReadEstimator.ts +25 -25
- package/src/estimator/SecretSecretRecordEstimator.ts +24 -24
- package/src/index.ts +89 -54
- package/src/meta/CostMetaTable.ts +81 -81
- package/src/meta/NamirasoftCostMetaDatabase.ts +50 -50
- package/src/row/CostRow.ts +40 -40
- package/src/type/Bonus.ts +20 -20
- package/src/type/CalculationOption.ts +34 -34
- package/src/type/Estimation.ts +35 -35
- package/src/type/EstimationOption.ts +31 -31
- package/src/type/EstimationUsage.ts +22 -22
- package/src/type/Period.ts +101 -101
- package/src/type/SimulationOption.ts +29 -29
- package/src/type/Usage.ts +24 -24
- package/dist/row/CostCreateRow.d.ts +0 -17
- package/dist/row/CostCreateRow.js +0 -3
- package/dist/row/CostCreateRow.js.map +0 -1
@@ -0,0 +1,110 @@
|
|
1
|
+
/****************************************************************/
|
2
|
+
/* */
|
3
|
+
/* This is an Auto-Generated File */
|
4
|
+
/* Made By */
|
5
|
+
/* Namirasoft SDK Generator NPM Package */
|
6
|
+
/* */
|
7
|
+
/****************************************************************/
|
8
|
+
/****************************************************************/
|
9
|
+
/* */
|
10
|
+
/* Please do not make any change to this file */
|
11
|
+
/* If any change is required, ns-sdkg command must be used */
|
12
|
+
/* */
|
13
|
+
/****************************************************************/
|
14
|
+
/****************************************************************/
|
15
|
+
/* */
|
16
|
+
/* Namira Software Corporation */
|
17
|
+
/* https://namirasoft.com */
|
18
|
+
/* */
|
19
|
+
/****************************************************************/
|
20
|
+
|
21
|
+
import { BaseFinalCommand } from "namirasoft-node-cli";
|
22
|
+
import { IStorageMemoryDedicated } from "namirasoft-core";
|
23
|
+
import { NamirasoftCostServer } from "../NamirasoftCostServer";
|
24
|
+
import { TokenManager } from "namirasoft-account";
|
25
|
+
|
26
|
+
export class SecretSecretEstimateReadCommand extends BaseFinalCommand
|
27
|
+
{
|
28
|
+
constructor(argv: string[])
|
29
|
+
{
|
30
|
+
super(argv, [], [
|
31
|
+
{
|
32
|
+
name: "period",
|
33
|
+
short: "",
|
34
|
+
description: "Provides the value of 'period' in body",
|
35
|
+
optional: false,
|
36
|
+
args: ["period"],
|
37
|
+
defaults: [""]
|
38
|
+
},
|
39
|
+
{
|
40
|
+
name: "total_count",
|
41
|
+
short: "",
|
42
|
+
description: "Provides the value of 'total_count' in body",
|
43
|
+
optional: false,
|
44
|
+
args: ["total_count"],
|
45
|
+
defaults: [""]
|
46
|
+
},
|
47
|
+
{
|
48
|
+
name: "number",
|
49
|
+
short: "",
|
50
|
+
description: "Provides the value of 'number' in body",
|
51
|
+
optional: false,
|
52
|
+
args: ["number"],
|
53
|
+
defaults: [""]
|
54
|
+
},
|
55
|
+
{
|
56
|
+
name: "total_value",
|
57
|
+
short: "",
|
58
|
+
description: "Provides the value of 'total_value' in body",
|
59
|
+
optional: false,
|
60
|
+
args: ["total_value"],
|
61
|
+
defaults: [""]
|
62
|
+
},
|
63
|
+
{
|
64
|
+
name: "value",
|
65
|
+
short: "",
|
66
|
+
description: "Provides the value of 'value' in body",
|
67
|
+
optional: false,
|
68
|
+
args: ["value"],
|
69
|
+
defaults: [""]
|
70
|
+
},
|
71
|
+
{
|
72
|
+
name: "active",
|
73
|
+
short: "",
|
74
|
+
description: "Provides the value of 'active' in body",
|
75
|
+
optional: false,
|
76
|
+
args: ["active"],
|
77
|
+
defaults: [""]
|
78
|
+
},
|
79
|
+
{
|
80
|
+
name: "trial_started_at",
|
81
|
+
short: "",
|
82
|
+
description: "Provides the value of 'trial_started_at' in body",
|
83
|
+
optional: true,
|
84
|
+
args: ["trial_started_at"],
|
85
|
+
defaults: [""]
|
86
|
+
}
|
87
|
+
]);
|
88
|
+
}
|
89
|
+
override async exec()
|
90
|
+
{
|
91
|
+
let token = this.app.storage.getNSAToken();
|
92
|
+
if (token == null)
|
93
|
+
throw new Error("Token is not available. Please login first using:\nns-cost account config \nor \nns-cost account login.");
|
94
|
+
let storage = new IStorageMemoryDedicated();
|
95
|
+
let manager = new TokenManager(storage, () => { });
|
96
|
+
manager.setValue(token, false);
|
97
|
+
let url = this.app.storage.getItem("ns-cost-server-url");
|
98
|
+
let server = new NamirasoftCostServer(url, manager, e => this.app.logger.error(e.message));
|
99
|
+
let ans = await server.secret_secret.EstimateRead({
|
100
|
+
period: this.option_values.period,
|
101
|
+
total_count: this.option_values.total_count,
|
102
|
+
number: this.option_values.number,
|
103
|
+
total_value: this.option_values.total_value,
|
104
|
+
value: this.option_values.value,
|
105
|
+
active: this.option_values.active,
|
106
|
+
trial_started_at: this.option_values.trial_started_at
|
107
|
+
});
|
108
|
+
this.app.logger.success(JSON.stringify(ans));
|
109
|
+
}
|
110
|
+
};
|
@@ -0,0 +1,110 @@
|
|
1
|
+
/****************************************************************/
|
2
|
+
/* */
|
3
|
+
/* This is an Auto-Generated File */
|
4
|
+
/* Made By */
|
5
|
+
/* Namirasoft SDK Generator NPM Package */
|
6
|
+
/* */
|
7
|
+
/****************************************************************/
|
8
|
+
/****************************************************************/
|
9
|
+
/* */
|
10
|
+
/* Please do not make any change to this file */
|
11
|
+
/* If any change is required, ns-sdkg command must be used */
|
12
|
+
/* */
|
13
|
+
/****************************************************************/
|
14
|
+
/****************************************************************/
|
15
|
+
/* */
|
16
|
+
/* Namira Software Corporation */
|
17
|
+
/* https://namirasoft.com */
|
18
|
+
/* */
|
19
|
+
/****************************************************************/
|
20
|
+
|
21
|
+
import { BaseFinalCommand } from "namirasoft-node-cli";
|
22
|
+
import { IStorageMemoryDedicated } from "namirasoft-core";
|
23
|
+
import { NamirasoftCostServer } from "../NamirasoftCostServer";
|
24
|
+
import { TokenManager } from "namirasoft-account";
|
25
|
+
|
26
|
+
export class SecretSecretEstimateRecordCommand extends BaseFinalCommand
|
27
|
+
{
|
28
|
+
constructor(argv: string[])
|
29
|
+
{
|
30
|
+
super(argv, [], [
|
31
|
+
{
|
32
|
+
name: "period",
|
33
|
+
short: "",
|
34
|
+
description: "Provides the value of 'period' in body",
|
35
|
+
optional: false,
|
36
|
+
args: ["period"],
|
37
|
+
defaults: [""]
|
38
|
+
},
|
39
|
+
{
|
40
|
+
name: "total_count",
|
41
|
+
short: "",
|
42
|
+
description: "Provides the value of 'total_count' in body",
|
43
|
+
optional: false,
|
44
|
+
args: ["total_count"],
|
45
|
+
defaults: [""]
|
46
|
+
},
|
47
|
+
{
|
48
|
+
name: "number",
|
49
|
+
short: "",
|
50
|
+
description: "Provides the value of 'number' in body",
|
51
|
+
optional: false,
|
52
|
+
args: ["number"],
|
53
|
+
defaults: [""]
|
54
|
+
},
|
55
|
+
{
|
56
|
+
name: "total_value",
|
57
|
+
short: "",
|
58
|
+
description: "Provides the value of 'total_value' in body",
|
59
|
+
optional: false,
|
60
|
+
args: ["total_value"],
|
61
|
+
defaults: [""]
|
62
|
+
},
|
63
|
+
{
|
64
|
+
name: "value",
|
65
|
+
short: "",
|
66
|
+
description: "Provides the value of 'value' in body",
|
67
|
+
optional: false,
|
68
|
+
args: ["value"],
|
69
|
+
defaults: [""]
|
70
|
+
},
|
71
|
+
{
|
72
|
+
name: "active",
|
73
|
+
short: "",
|
74
|
+
description: "Provides the value of 'active' in body",
|
75
|
+
optional: false,
|
76
|
+
args: ["active"],
|
77
|
+
defaults: [""]
|
78
|
+
},
|
79
|
+
{
|
80
|
+
name: "trial_started_at",
|
81
|
+
short: "",
|
82
|
+
description: "Provides the value of 'trial_started_at' in body",
|
83
|
+
optional: true,
|
84
|
+
args: ["trial_started_at"],
|
85
|
+
defaults: [""]
|
86
|
+
}
|
87
|
+
]);
|
88
|
+
}
|
89
|
+
override async exec()
|
90
|
+
{
|
91
|
+
let token = this.app.storage.getNSAToken();
|
92
|
+
if (token == null)
|
93
|
+
throw new Error("Token is not available. Please login first using:\nns-cost account config \nor \nns-cost account login.");
|
94
|
+
let storage = new IStorageMemoryDedicated();
|
95
|
+
let manager = new TokenManager(storage, () => { });
|
96
|
+
manager.setValue(token, false);
|
97
|
+
let url = this.app.storage.getItem("ns-cost-server-url");
|
98
|
+
let server = new NamirasoftCostServer(url, manager, e => this.app.logger.error(e.message));
|
99
|
+
let ans = await server.secret_secret.EstimateRecord({
|
100
|
+
period: this.option_values.period,
|
101
|
+
total_count: this.option_values.total_count,
|
102
|
+
number: this.option_values.number,
|
103
|
+
total_value: this.option_values.total_value,
|
104
|
+
value: this.option_values.value,
|
105
|
+
active: this.option_values.active,
|
106
|
+
trial_started_at: this.option_values.trial_started_at
|
107
|
+
});
|
108
|
+
this.app.logger.success(JSON.stringify(ans));
|
109
|
+
}
|
110
|
+
};
|
@@ -0,0 +1,119 @@
|
|
1
|
+
/****************************************************************/
|
2
|
+
/* */
|
3
|
+
/* This is an Auto-Generated File */
|
4
|
+
/* Made By */
|
5
|
+
/* Namirasoft SDK Generator NPM Package */
|
6
|
+
/* */
|
7
|
+
/****************************************************************/
|
8
|
+
/****************************************************************/
|
9
|
+
/* */
|
10
|
+
/* Please do not make any change to this file */
|
11
|
+
/* If any change is required, ns-sdkg command must be used */
|
12
|
+
/* */
|
13
|
+
/****************************************************************/
|
14
|
+
/****************************************************************/
|
15
|
+
/* */
|
16
|
+
/* Namira Software Corporation */
|
17
|
+
/* https://namirasoft.com */
|
18
|
+
/* */
|
19
|
+
/****************************************************************/
|
20
|
+
|
21
|
+
import { BaseFinalCommand } from "namirasoft-node-cli";
|
22
|
+
import { IStorageMemoryDedicated } from "namirasoft-core";
|
23
|
+
import { NamirasoftCostServer } from "../NamirasoftCostServer";
|
24
|
+
import { TokenManager } from "namirasoft-account";
|
25
|
+
|
26
|
+
export class SecretSecret_CreateForReadCommand extends BaseFinalCommand
|
27
|
+
{
|
28
|
+
constructor(argv: string[])
|
29
|
+
{
|
30
|
+
super(argv, ["user_id"], [
|
31
|
+
{
|
32
|
+
name: "period",
|
33
|
+
short: "",
|
34
|
+
description: "Provides the value of 'period' in body",
|
35
|
+
optional: false,
|
36
|
+
args: ["period"],
|
37
|
+
defaults: [""]
|
38
|
+
},
|
39
|
+
{
|
40
|
+
name: "total_count",
|
41
|
+
short: "",
|
42
|
+
description: "Provides the value of 'total_count' in body",
|
43
|
+
optional: false,
|
44
|
+
args: ["total_count"],
|
45
|
+
defaults: [""]
|
46
|
+
},
|
47
|
+
{
|
48
|
+
name: "number",
|
49
|
+
short: "",
|
50
|
+
description: "Provides the value of 'number' in body",
|
51
|
+
optional: false,
|
52
|
+
args: ["number"],
|
53
|
+
defaults: [""]
|
54
|
+
},
|
55
|
+
{
|
56
|
+
name: "total_value",
|
57
|
+
short: "",
|
58
|
+
description: "Provides the value of 'total_value' in body",
|
59
|
+
optional: false,
|
60
|
+
args: ["total_value"],
|
61
|
+
defaults: [""]
|
62
|
+
},
|
63
|
+
{
|
64
|
+
name: "value",
|
65
|
+
short: "",
|
66
|
+
description: "Provides the value of 'value' in body",
|
67
|
+
optional: false,
|
68
|
+
args: ["value"],
|
69
|
+
defaults: [""]
|
70
|
+
},
|
71
|
+
{
|
72
|
+
name: "active",
|
73
|
+
short: "",
|
74
|
+
description: "Provides the value of 'active' in body",
|
75
|
+
optional: false,
|
76
|
+
args: ["active"],
|
77
|
+
defaults: [""]
|
78
|
+
},
|
79
|
+
{
|
80
|
+
name: "workspace_id",
|
81
|
+
short: "",
|
82
|
+
description: "Provides the value of 'workspace_id' in body",
|
83
|
+
optional: true,
|
84
|
+
args: ["workspace_id"],
|
85
|
+
defaults: [""]
|
86
|
+
},
|
87
|
+
{
|
88
|
+
name: "resource_id",
|
89
|
+
short: "",
|
90
|
+
description: "Provides the value of 'resource_id' in body",
|
91
|
+
optional: true,
|
92
|
+
args: ["resource_id"],
|
93
|
+
defaults: [""]
|
94
|
+
}
|
95
|
+
]);
|
96
|
+
}
|
97
|
+
override async exec()
|
98
|
+
{
|
99
|
+
let token = this.app.storage.getNSAToken();
|
100
|
+
if (token == null)
|
101
|
+
throw new Error("Token is not available. Please login first using:\nns-cost account config \nor \nns-cost account login.");
|
102
|
+
let storage = new IStorageMemoryDedicated();
|
103
|
+
let manager = new TokenManager(storage, () => { });
|
104
|
+
manager.setValue(token, false);
|
105
|
+
let url = this.app.storage.getItem("ns-cost-server-url");
|
106
|
+
let server = new NamirasoftCostServer(url, manager, e => this.app.logger.error(e.message));
|
107
|
+
let ans = await server.secret_secret._CreateForRead(this.arg_values[0], {
|
108
|
+
period: this.option_values.period,
|
109
|
+
total_count: this.option_values.total_count,
|
110
|
+
number: this.option_values.number,
|
111
|
+
total_value: this.option_values.total_value,
|
112
|
+
value: this.option_values.value,
|
113
|
+
active: this.option_values.active,
|
114
|
+
workspace_id: this.option_values.workspace_id,
|
115
|
+
resource_id: this.option_values.resource_id
|
116
|
+
});
|
117
|
+
this.app.logger.success(JSON.stringify(ans));
|
118
|
+
}
|
119
|
+
};
|
@@ -0,0 +1,119 @@
|
|
1
|
+
/****************************************************************/
|
2
|
+
/* */
|
3
|
+
/* This is an Auto-Generated File */
|
4
|
+
/* Made By */
|
5
|
+
/* Namirasoft SDK Generator NPM Package */
|
6
|
+
/* */
|
7
|
+
/****************************************************************/
|
8
|
+
/****************************************************************/
|
9
|
+
/* */
|
10
|
+
/* Please do not make any change to this file */
|
11
|
+
/* If any change is required, ns-sdkg command must be used */
|
12
|
+
/* */
|
13
|
+
/****************************************************************/
|
14
|
+
/****************************************************************/
|
15
|
+
/* */
|
16
|
+
/* Namira Software Corporation */
|
17
|
+
/* https://namirasoft.com */
|
18
|
+
/* */
|
19
|
+
/****************************************************************/
|
20
|
+
|
21
|
+
import { BaseFinalCommand } from "namirasoft-node-cli";
|
22
|
+
import { IStorageMemoryDedicated } from "namirasoft-core";
|
23
|
+
import { NamirasoftCostServer } from "../NamirasoftCostServer";
|
24
|
+
import { TokenManager } from "namirasoft-account";
|
25
|
+
|
26
|
+
export class SecretSecret_CreateForRecordCommand extends BaseFinalCommand
|
27
|
+
{
|
28
|
+
constructor(argv: string[])
|
29
|
+
{
|
30
|
+
super(argv, ["user_id"], [
|
31
|
+
{
|
32
|
+
name: "period",
|
33
|
+
short: "",
|
34
|
+
description: "Provides the value of 'period' in body",
|
35
|
+
optional: false,
|
36
|
+
args: ["period"],
|
37
|
+
defaults: [""]
|
38
|
+
},
|
39
|
+
{
|
40
|
+
name: "total_count",
|
41
|
+
short: "",
|
42
|
+
description: "Provides the value of 'total_count' in body",
|
43
|
+
optional: false,
|
44
|
+
args: ["total_count"],
|
45
|
+
defaults: [""]
|
46
|
+
},
|
47
|
+
{
|
48
|
+
name: "number",
|
49
|
+
short: "",
|
50
|
+
description: "Provides the value of 'number' in body",
|
51
|
+
optional: false,
|
52
|
+
args: ["number"],
|
53
|
+
defaults: [""]
|
54
|
+
},
|
55
|
+
{
|
56
|
+
name: "total_value",
|
57
|
+
short: "",
|
58
|
+
description: "Provides the value of 'total_value' in body",
|
59
|
+
optional: false,
|
60
|
+
args: ["total_value"],
|
61
|
+
defaults: [""]
|
62
|
+
},
|
63
|
+
{
|
64
|
+
name: "value",
|
65
|
+
short: "",
|
66
|
+
description: "Provides the value of 'value' in body",
|
67
|
+
optional: false,
|
68
|
+
args: ["value"],
|
69
|
+
defaults: [""]
|
70
|
+
},
|
71
|
+
{
|
72
|
+
name: "active",
|
73
|
+
short: "",
|
74
|
+
description: "Provides the value of 'active' in body",
|
75
|
+
optional: false,
|
76
|
+
args: ["active"],
|
77
|
+
defaults: [""]
|
78
|
+
},
|
79
|
+
{
|
80
|
+
name: "workspace_id",
|
81
|
+
short: "",
|
82
|
+
description: "Provides the value of 'workspace_id' in body",
|
83
|
+
optional: true,
|
84
|
+
args: ["workspace_id"],
|
85
|
+
defaults: [""]
|
86
|
+
},
|
87
|
+
{
|
88
|
+
name: "resource_id",
|
89
|
+
short: "",
|
90
|
+
description: "Provides the value of 'resource_id' in body",
|
91
|
+
optional: true,
|
92
|
+
args: ["resource_id"],
|
93
|
+
defaults: [""]
|
94
|
+
}
|
95
|
+
]);
|
96
|
+
}
|
97
|
+
override async exec()
|
98
|
+
{
|
99
|
+
let token = this.app.storage.getNSAToken();
|
100
|
+
if (token == null)
|
101
|
+
throw new Error("Token is not available. Please login first using:\nns-cost account config \nor \nns-cost account login.");
|
102
|
+
let storage = new IStorageMemoryDedicated();
|
103
|
+
let manager = new TokenManager(storage, () => { });
|
104
|
+
manager.setValue(token, false);
|
105
|
+
let url = this.app.storage.getItem("ns-cost-server-url");
|
106
|
+
let server = new NamirasoftCostServer(url, manager, e => this.app.logger.error(e.message));
|
107
|
+
let ans = await server.secret_secret._CreateForRecord(this.arg_values[0], {
|
108
|
+
period: this.option_values.period,
|
109
|
+
total_count: this.option_values.total_count,
|
110
|
+
number: this.option_values.number,
|
111
|
+
total_value: this.option_values.total_value,
|
112
|
+
value: this.option_values.value,
|
113
|
+
active: this.option_values.active,
|
114
|
+
workspace_id: this.option_values.workspace_id,
|
115
|
+
resource_id: this.option_values.resource_id
|
116
|
+
});
|
117
|
+
this.app.logger.success(JSON.stringify(ans));
|
118
|
+
}
|
119
|
+
};
|
@@ -0,0 +1,32 @@
|
|
1
|
+
/****************************************************************/
|
2
|
+
/* */
|
3
|
+
/* This is an Auto-Generated File */
|
4
|
+
/* Made By */
|
5
|
+
/* Namirasoft SDK Generator NPM Package */
|
6
|
+
/* */
|
7
|
+
/****************************************************************/
|
8
|
+
/****************************************************************/
|
9
|
+
/* */
|
10
|
+
/* Please do not make any change to this file */
|
11
|
+
/* If any change is required, ns-sdkg command must be used */
|
12
|
+
/* */
|
13
|
+
/****************************************************************/
|
14
|
+
/****************************************************************/
|
15
|
+
/* */
|
16
|
+
/* Namira Software Corporation */
|
17
|
+
/* https://namirasoft.com */
|
18
|
+
/* */
|
19
|
+
/****************************************************************/
|
20
|
+
|
21
|
+
import { BaseNavigatorCommand } from "namirasoft-node-cli";
|
22
|
+
import { ValueListCommand } from "./ValueListCommand";
|
23
|
+
|
24
|
+
export class ValueCommand extends BaseNavigatorCommand
|
25
|
+
{
|
26
|
+
constructor(argv: string[])
|
27
|
+
{
|
28
|
+
super(argv, {
|
29
|
+
"list": ValueListCommand,
|
30
|
+
});
|
31
|
+
}
|
32
|
+
};
|
@@ -0,0 +1,45 @@
|
|
1
|
+
/****************************************************************/
|
2
|
+
/* */
|
3
|
+
/* This is an Auto-Generated File */
|
4
|
+
/* Made By */
|
5
|
+
/* Namirasoft SDK Generator NPM Package */
|
6
|
+
/* */
|
7
|
+
/****************************************************************/
|
8
|
+
/****************************************************************/
|
9
|
+
/* */
|
10
|
+
/* Please do not make any change to this file */
|
11
|
+
/* If any change is required, ns-sdkg command must be used */
|
12
|
+
/* */
|
13
|
+
/****************************************************************/
|
14
|
+
/****************************************************************/
|
15
|
+
/* */
|
16
|
+
/* Namira Software Corporation */
|
17
|
+
/* https://namirasoft.com */
|
18
|
+
/* */
|
19
|
+
/****************************************************************/
|
20
|
+
|
21
|
+
import { BaseFinalCommand } from "namirasoft-node-cli";
|
22
|
+
import { IStorageMemoryDedicated } from "namirasoft-core";
|
23
|
+
import { NamirasoftCostServer } from "../NamirasoftCostServer";
|
24
|
+
import { TokenManager } from "namirasoft-account";
|
25
|
+
|
26
|
+
export class ValueListCommand extends BaseFinalCommand
|
27
|
+
{
|
28
|
+
constructor(argv: string[])
|
29
|
+
{
|
30
|
+
super(argv, ["table", "column", "search", "field_id", "limit"], []);
|
31
|
+
}
|
32
|
+
override async exec()
|
33
|
+
{
|
34
|
+
let token = this.app.storage.getNSAToken();
|
35
|
+
if (token == null)
|
36
|
+
throw new Error("Token is not available. Please login first using:\nns-cost account config \nor \nns-cost account login.");
|
37
|
+
let storage = new IStorageMemoryDedicated();
|
38
|
+
let manager = new TokenManager(storage, () => { });
|
39
|
+
manager.setValue(token, false);
|
40
|
+
let url = this.app.storage.getItem("ns-cost-server-url");
|
41
|
+
let server = new NamirasoftCostServer(url, manager, e => this.app.logger.error(e.message));
|
42
|
+
let ans = await server.value.List(this.arg_values[0], this.arg_values[1], this.arg_values[2], this.arg_values[3], this.arg_values[4]);
|
43
|
+
this.app.logger.success(JSON.stringify(ans));
|
44
|
+
}
|
45
|
+
};
|
@@ -0,0 +1,51 @@
|
|
1
|
+
#!/usr/bin/env node
|
2
|
+
/****************************************************************/
|
3
|
+
/* */
|
4
|
+
/* This is an Auto-Generated File */
|
5
|
+
/* Made By */
|
6
|
+
/* Namirasoft SDK Generator NPM Package */
|
7
|
+
/* */
|
8
|
+
/****************************************************************/
|
9
|
+
/****************************************************************/
|
10
|
+
/* */
|
11
|
+
/* Please do not make any change to this file */
|
12
|
+
/* If any change is required, ns-sdkg command must be used */
|
13
|
+
/* */
|
14
|
+
/****************************************************************/
|
15
|
+
/****************************************************************/
|
16
|
+
/* */
|
17
|
+
/* Namira Software Corporation */
|
18
|
+
/* https://namirasoft.com */
|
19
|
+
/* */
|
20
|
+
/****************************************************************/
|
21
|
+
|
22
|
+
import { AccountCommand } from "namirasoft-account";
|
23
|
+
import { Application, BaseStorage } from "namirasoft-node-cli";
|
24
|
+
import { BillWatchAWSCommand } from "./BillWatchAWSCommand";
|
25
|
+
import { BillWatchAzureCommand } from "./BillWatchAzureCommand";
|
26
|
+
import { BillWatchGCPCommand } from "./BillWatchGCPCommand";
|
27
|
+
import { ConfigCommand } from "namirasoft-node-cli";
|
28
|
+
import { CostCommand } from "./CostCommand";
|
29
|
+
import { FieldCategoryCommand } from "./FieldCategoryCommand";
|
30
|
+
import { FieldFieldCommand } from "./FieldFieldCommand";
|
31
|
+
import { HealthzCommand } from "./HealthzCommand";
|
32
|
+
import { MetricsCommand } from "./MetricsCommand";
|
33
|
+
import { SecretSecretCommand } from "./SecretSecretCommand";
|
34
|
+
import { ValueCommand } from "./ValueCommand";
|
35
|
+
|
36
|
+
let app = new Application("ns-cost", new BaseStorage(),
|
37
|
+
{
|
38
|
+
"healthz": HealthzCommand,
|
39
|
+
"metrics": MetricsCommand,
|
40
|
+
"value": ValueCommand,
|
41
|
+
"billwatchaws": BillWatchAWSCommand,
|
42
|
+
"billwatchazure": BillWatchAzureCommand,
|
43
|
+
"billwatchgcp": BillWatchGCPCommand,
|
44
|
+
"fieldcategory": FieldCategoryCommand,
|
45
|
+
"fieldfield": FieldFieldCommand,
|
46
|
+
"secretsecret": SecretSecretCommand,
|
47
|
+
"cost": CostCommand,
|
48
|
+
"account": AccountCommand,
|
49
|
+
"config": (argv: string[]) => new ConfigCommand(argv, ["ns-cost-server-url"])
|
50
|
+
});
|
51
|
+
app.run();
|