-
Notifications
You must be signed in to change notification settings - Fork 0
/
bean.go
133 lines (119 loc) · 6.27 KB
/
bean.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
/*
* Copyright (c) 2020 Devtron Labs
*
* 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 appstore
import (
"github.com/devtron-labs/devtron/internal/sql/repository"
"github.com/devtron-labs/devtron/internal/sql/repository/appstore"
"github.com/devtron-labs/devtron/internal/sql/repository/cluster"
"time"
)
//v1
type InstallAppVersionDTO struct {
Id int `json:"id,omitempty"`
AppId int `json:"appId,omitempty"`
AppName string `json:"appName,omitempty"`
TeamId int `json:"teamId,omitempty"`
EnvironmentId int `json:"environmentId,omitempty"`
InstalledAppId int `json:"installedAppId,omitempty,notnull"`
InstalledAppVersionId int `json:"installedAppVersionId,omitempty,notnull"`
AppStoreVersion int `json:"appStoreVersion,omitempty,notnull"`
ValuesOverrideYaml string `json:"valuesOverrideYaml,omitempty"`
Readme string `json:"readme,omitempty"`
UserId int32 `json:"-"`
ReferenceValueId int `json:"referenceValueId, omitempty" validate:"required,number"`
ReferenceValueKind string `json:"referenceValueKind, omitempty" validate:"oneof=DEFAULT TEMPLATE DEPLOYED EXISTING"`
ACDAppName string `json:"-"`
Environment *cluster.Environment `json:"-"`
ChartGroupEntryId int `json:"-"`
DefaultClusterComponent bool `json:"-"`
Status appstore.AppstoreDeploymentStatus `json:"-"`
AppStoreId int `json:"appStoreId"`
AppStoreName string `json:"appStoreName"`
Deprecated bool `json:"deprecated"`
}
/// bean for v2
type ChartGroupInstallRequest struct {
ProjectId int `json:"projectId" validate:"required,number"`
ChartGroupInstallChartRequest []*ChartGroupInstallChartRequest `json:"charts" validate:"dive,required"`
ChartGroupId int `json:"chartGroupId"` //optional
UserId int32 `json:"-"`
}
type ChartGroupInstallChartRequest struct {
AppName string `json:"appName,omitempty" validate:"name-component,max=100" `
EnvironmentId int `json:"environmentId,omitempty" validate:"required,number" `
AppStoreVersion int `json:"appStoreVersion,omitempty,notnull" validate:"required,number" `
ValuesOverrideYaml string `json:"valuesOverrideYaml,omitempty"` //optional
ReferenceValueId int `json:"referenceValueId, omitempty" validate:"required,number"`
ReferenceValueKind string `json:"referenceValueKind, omitempty" validate:"oneof=DEFAULT TEMPLATE DEPLOYED"`
ChartGroupEntryId int `json:"chartGroupEntryId"` //optional
DefaultClusterComponent bool `json:"-"`
}
type ChartGroupInstallAppRes struct {
}
///
type RefChartProxyDir string
var CHART_PROXY_TEMPLATE = "reference-chart-proxy"
var REQUIREMENTS_YAML_FILE = "requirements.yaml"
var VALUES_YAML_FILE = "values.yaml"
type InstalledAppsResponse struct {
AppStoreApplicationName string `json:"appStoreApplicationName"`
ChartName string `json:"chartName"`
Icon string `json:"icon"`
Status string `json:"status"`
AppName string `json:"appName"`
InstalledAppVersionId int `json:"installedAppVersionId"`
AppStoreApplicationVersionId int `json:"appStoreApplicationVersionId"`
EnvironmentName string `json:"environmentName"`
DeployedAt time.Time `json:"deployedAt"`
DeployedBy string `json:"deployedBy"`
InstalledAppsId int `json:"installedAppId"`
Readme string `json:"readme"`
EnvironmentId int `json:"environmentId"`
Deprecated bool `json:"deprecated"`
}
type AppNames struct {
Name string `json:"name,omitempty"`
Exists bool `json:"exists"`
SuggestedName string `json:"suggestedName,omitempty"`
}
type Dependencies struct {
Dependencies []Dependency `json:"dependencies"`
}
type Dependency struct {
Name string `json:"name"`
Version string `json:"version"`
Repository string `json:"repository"`
}
const BULK_APPSTORE_DEPLOY_TOPIC = "ORCHESTRATOR.APP-STORE.BULK-DEPLOY"
const BULK_APPSTORE_DEPLOY_GROUP = "ORCHESTRATOR.APP-STORE.BULK-DEPLOY-GROUP-1"
const BULK_APPSTORE_DEPLOY_DURABLE = "ORCHESTRATOR.APP-STORE.BULK-DEPLOY.DURABLE-1"
type DeployPayload struct {
InstalledAppVersionId int
}
type ChartRepoDto struct {
Id int `json:"id,omitempty" validate:"number"`
Name string `json:"name,omitempty" validate:"required"`
Url string `json:"url,omitempty"`
UserName string `json:"userName,omitempty"`
Password string `json:"password,omitempty"`
SshKey string `json:"sshKey,omitempty"`
AccessToken string `json:"accessToken,omitempty"`
AuthMode repository.AuthMode `json:"authMode,omitempty" validate:"required"`
Active bool `json:"active"`
Default bool `json:"default"`
UserId int32 `json:"-"`
}