File tree Expand file tree Collapse file tree 2 files changed +43
-0
lines changed Expand file tree Collapse file tree 2 files changed +43
-0
lines changed Original file line number Diff line number Diff line change
1
+ // Copyright 2019 Yunion
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+
15
+ package providerdriver
16
+
17
+ import (
18
+ api "yunion.io/x/onecloud/pkg/apis/compute"
19
+ )
20
+
21
+ type ZettaKitCollect struct {
22
+ SCollectByResourceIdDriver
23
+ }
24
+
25
+ func (self * ZettaKitCollect ) GetProvider () string {
26
+ return api .CLOUD_PROVIDER_ZETTAKIT
27
+ }
28
+
29
+ func (self * ZettaKitCollect ) IsSupportMetrics () bool {
30
+ return true
31
+ }
32
+
33
+ func init () {
34
+ Register (& ZettaKitCollect {})
35
+ }
Original file line number Diff line number Diff line change 15
15
package regiondrivers
16
16
17
17
import (
18
+ "yunion.io/x/sqlchemy"
19
+
18
20
api "yunion.io/x/onecloud/pkg/apis/compute"
19
21
"yunion.io/x/onecloud/pkg/compute/models"
20
22
)
@@ -39,3 +41,9 @@ func (self *SZettaKitRegionDriver) IsSupportedElasticcacheSecgroup() bool {
39
41
func (self * SZettaKitRegionDriver ) GetMaxElasticcacheSecurityGroupCount () int {
40
42
return 1
41
43
}
44
+
45
+ func (self * SZettaKitRegionDriver ) GetSecurityGroupFilter (vpc * models.SVpc ) (func (q * sqlchemy.SQuery ) * sqlchemy.SQuery , error ) {
46
+ return func (q * sqlchemy.SQuery ) * sqlchemy.SQuery {
47
+ return q .Equals ("cloudregion_id" , vpc .CloudregionId ).Equals ("manager_id" , vpc .ManagerId )
48
+ }, nil
49
+ }
You can’t perform that action at this time.
0 commit comments