File tree Expand file tree Collapse file tree 6 files changed +16
-12
lines changed Expand file tree Collapse file tree 6 files changed +16
-12
lines changed Original file line number Diff line number Diff line change @@ -3,8 +3,6 @@ import { RawTencentCcn } from './data'
3
3
import services from '../../enums/services'
4
4
import aliases from '../../enums/serviceAliases'
5
5
6
- const serviceName = 'ccn'
7
-
8
6
export default ( {
9
7
service,
10
8
data,
@@ -16,7 +14,7 @@ export default ({
16
14
} ) : {
17
15
[ property : string ] : ServiceConnection [ ]
18
16
} => {
19
- const { id } = service
17
+ const { id, CcnId } = service
20
18
const connections : ServiceConnection [ ] = [ ]
21
19
22
20
const instances : {
@@ -26,12 +24,12 @@ export default ({
26
24
27
25
if ( instances ?. data ?. [ region ] ) {
28
26
for ( const service of instances . data [ region ] ) {
29
- if ( id === service . CcnId ) {
27
+ if ( CcnId === service . CcnId ) {
30
28
connections . push ( {
31
29
id : service . id ,
32
- resourceType : serviceName ,
30
+ resourceType : services . ccnAttachment ,
33
31
relation : 'child' ,
34
- field : aliases [ serviceName ] ? aliases [ serviceName ] : serviceName ,
32
+ field : aliases [ services . ccnAttachment ] ? aliases [ services . ccnAttachment ] : services . ccnAttachment ,
35
33
} )
36
34
}
37
35
}
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import CloudGraph from '@cloudgraph/sdk'
4
4
import groupBy from 'lodash/groupBy'
5
5
import isEmpty from 'lodash/isEmpty'
6
6
import { CCN } from 'tencentcloud-sdk-nodejs/tencentcloud/services/vpc/v20170312/vpc_models'
7
+ import cuid from 'cuid'
7
8
import loggerText from '../../properties/logger'
8
9
import { TencentServiceInput } from '../../types'
9
10
import { initTestEndpoint , generateTencentErrorLog } from '../../utils'
@@ -37,7 +38,7 @@ export default async ({
37
38
if ( response && ! isEmpty ( response . CcnSet ) ) {
38
39
for ( const instance of response . CcnSet ) {
39
40
ccnList . push ( {
40
- id : instance . CcnId ,
41
+ id : cuid ( ) ,
41
42
...instance ,
42
43
region,
43
44
} )
Original file line number Diff line number Diff line change @@ -11,7 +11,8 @@ export default ({
11
11
} ) : TencentCcn => {
12
12
const {
13
13
id,
14
- CcnName : ccnName ,
14
+ CcnId : ccnId ,
15
+ CcnName : name ,
15
16
CcnDescription : ccnDescription ,
16
17
InstanceCount : instanceCount ,
17
18
CreateTime : createTime ,
@@ -28,7 +29,8 @@ export default ({
28
29
return {
29
30
id,
30
31
region,
31
- ccnName,
32
+ ccnId,
33
+ name,
32
34
ccnDescription,
33
35
instanceCount,
34
36
createTime,
Original file line number Diff line number Diff line change 1
1
type tencentCcn implements tencentBaseService @key (fields : " id" ) {
2
- ccnName : String @search (by : [hash , regexp ])
2
+ ccnId : String @search (by : [hash , regexp ])
3
+ name : String @search (by : [hash , regexp ])
3
4
ccnDescription : String @search (by : [hash , regexp ])
4
5
instanceCount : Int @search
5
6
createTime : String @search (by : [hash , regexp ])
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import CloudGraph from '@cloudgraph/sdk'
4
4
import groupBy from 'lodash/groupBy'
5
5
import isEmpty from 'lodash/isEmpty'
6
6
import { CcnAttachedInstance } from 'tencentcloud-sdk-nodejs/tencentcloud/services/vpc/v20170312/vpc_models'
7
+ import cuid from 'cuid'
7
8
import loggerText from '../../properties/logger'
8
9
import { TencentServiceInput } from '../../types'
9
10
import { initTestEndpoint , generateTencentErrorLog } from '../../utils'
@@ -37,7 +38,7 @@ export default async ({
37
38
if ( response && ! isEmpty ( response . InstanceSet ) ) {
38
39
for ( const instance of response . InstanceSet ) {
39
40
ccnAttachmentList . push ( {
40
- id : ` ${ instance . CcnId } - ${ instance . InstanceId } ` ,
41
+ id : cuid ( ) ,
41
42
...instance ,
42
43
region,
43
44
} )
Original file line number Diff line number Diff line change @@ -51,10 +51,11 @@ export type TencentCcn = TencentBaseService & {
51
51
bandwidthLimitType ?: Maybe < Scalars [ 'String' ] > ;
52
52
ccnAttachments ?: Maybe < Array < Maybe < TencentCcnAttachment > > > ;
53
53
ccnDescription ?: Maybe < Scalars [ 'String' ] > ;
54
- ccnName ?: Maybe < Scalars [ 'String' ] > ;
54
+ ccnId ?: Maybe < Scalars [ 'String' ] > ;
55
55
createTime ?: Maybe < Scalars [ 'String' ] > ;
56
56
instanceChargeType ?: Maybe < Scalars [ 'String' ] > ;
57
57
instanceCount ?: Maybe < Scalars [ 'Int' ] > ;
58
+ name ?: Maybe < Scalars [ 'String' ] > ;
58
59
qosLevel ?: Maybe < Scalars [ 'String' ] > ;
59
60
routePriorityFlag ?: Maybe < Scalars [ 'Boolean' ] > ;
60
61
routeTableCount ?: Maybe < Scalars [ 'Int' ] > ;
You can’t perform that action at this time.
0 commit comments