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'
33import services from '../../enums/services'
44import aliases from '../../enums/serviceAliases'
55
6- const serviceName = 'ccn'
7-
86export default ( {
97 service,
108 data,
@@ -16,7 +14,7 @@ export default ({
1614} ) : {
1715 [ property : string ] : ServiceConnection [ ]
1816} => {
19- const { id } = service
17+ const { id, CcnId } = service
2018 const connections : ServiceConnection [ ] = [ ]
2119
2220 const instances : {
@@ -26,12 +24,12 @@ export default ({
2624
2725 if ( instances ?. data ?. [ region ] ) {
2826 for ( const service of instances . data [ region ] ) {
29- if ( id === service . CcnId ) {
27+ if ( CcnId === service . CcnId ) {
3028 connections . push ( {
3129 id : service . id ,
32- resourceType : serviceName ,
30+ resourceType : services . ccnAttachment ,
3331 relation : 'child' ,
34- field : aliases [ serviceName ] ? aliases [ serviceName ] : serviceName ,
32+ field : aliases [ services . ccnAttachment ] ? aliases [ services . ccnAttachment ] : services . ccnAttachment ,
3533 } )
3634 }
3735 }
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import CloudGraph from '@cloudgraph/sdk'
44import groupBy from 'lodash/groupBy'
55import isEmpty from 'lodash/isEmpty'
66import { CCN } from 'tencentcloud-sdk-nodejs/tencentcloud/services/vpc/v20170312/vpc_models'
7+ import cuid from 'cuid'
78import loggerText from '../../properties/logger'
89import { TencentServiceInput } from '../../types'
910import { initTestEndpoint , generateTencentErrorLog } from '../../utils'
@@ -37,7 +38,7 @@ export default async ({
3738 if ( response && ! isEmpty ( response . CcnSet ) ) {
3839 for ( const instance of response . CcnSet ) {
3940 ccnList . push ( {
40- id : instance . CcnId ,
41+ id : cuid ( ) ,
4142 ...instance ,
4243 region,
4344 } )
Original file line number Diff line number Diff line change @@ -11,7 +11,8 @@ export default ({
1111} ) : TencentCcn => {
1212 const {
1313 id,
14- CcnName : ccnName ,
14+ CcnId : ccnId ,
15+ CcnName : name ,
1516 CcnDescription : ccnDescription ,
1617 InstanceCount : instanceCount ,
1718 CreateTime : createTime ,
@@ -28,7 +29,8 @@ export default ({
2829 return {
2930 id,
3031 region,
31- ccnName,
32+ ccnId,
33+ name,
3234 ccnDescription,
3335 instanceCount,
3436 createTime,
Original file line number Diff line number Diff line change 11type 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 ])
34 ccnDescription : String @search (by : [hash , regexp ])
45 instanceCount : Int @search
56 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'
44import groupBy from 'lodash/groupBy'
55import isEmpty from 'lodash/isEmpty'
66import { CcnAttachedInstance } from 'tencentcloud-sdk-nodejs/tencentcloud/services/vpc/v20170312/vpc_models'
7+ import cuid from 'cuid'
78import loggerText from '../../properties/logger'
89import { TencentServiceInput } from '../../types'
910import { initTestEndpoint , generateTencentErrorLog } from '../../utils'
@@ -37,7 +38,7 @@ export default async ({
3738 if ( response && ! isEmpty ( response . InstanceSet ) ) {
3839 for ( const instance of response . InstanceSet ) {
3940 ccnAttachmentList . push ( {
40- id : ` ${ instance . CcnId } - ${ instance . InstanceId } ` ,
41+ id : cuid ( ) ,
4142 ...instance ,
4243 region,
4344 } )
Original file line number Diff line number Diff line change @@ -51,10 +51,11 @@ export type TencentCcn = TencentBaseService & {
5151 bandwidthLimitType ?: Maybe < Scalars [ 'String' ] > ;
5252 ccnAttachments ?: Maybe < Array < Maybe < TencentCcnAttachment > > > ;
5353 ccnDescription ?: Maybe < Scalars [ 'String' ] > ;
54- ccnName ?: Maybe < Scalars [ 'String' ] > ;
54+ ccnId ?: Maybe < Scalars [ 'String' ] > ;
5555 createTime ?: Maybe < Scalars [ 'String' ] > ;
5656 instanceChargeType ?: Maybe < Scalars [ 'String' ] > ;
5757 instanceCount ?: Maybe < Scalars [ 'Int' ] > ;
58+ name ?: Maybe < Scalars [ 'String' ] > ;
5859 qosLevel ?: Maybe < Scalars [ 'String' ] > ;
5960 routePriorityFlag ?: Maybe < Scalars [ 'Boolean' ] > ;
6061 routeTableCount ?: Maybe < Scalars [ 'Int' ] > ;
You can’t perform that action at this time.
0 commit comments