File tree Expand file tree Collapse file tree
src/services/apiGatewayApiConfig Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -65,6 +65,9 @@ CloudGraph GCP Provider will ask you what regions you would like to crawl and wi
6565| Service | Relations |
6666| ------------------------------------- | -------------------------------------------------------------------------------- |
6767| alertPolicy | project |
68+ | apiGatewayGateways | project, apiGatewayApis, apiGatewayApiConfigs |
69+ | apiGatewayApis | project, apiGatewayGateways |
70+ | apiGatewayApiConfigs | project, apiGatewayGateways |
6871| apiKeys | project |
6972| assets | project |
7073| bigQueryDataset | project |
Original file line number Diff line number Diff line change @@ -49,20 +49,22 @@ export default async ({
4949
5050 try {
5151 for await ( const api of apis ) {
52- const apiIdSessions = api . id . split ( '/' )
53- const apiName = apiIdSessions [ apiIdSessions . length - 1 ]
54- const apiConfigIter = apiGatewayClient . listApiConfigsAsync ( {
55- parent : `projects/${ projectId } /locations/${ GLOBAL_REGION } /apis/${ apiName } ` ,
56- } )
57-
58- for await ( const { name, labels, ...apiConfig } of apiConfigIter ) {
59- routerData . push ( {
60- id : name ,
61- projectId,
62- region : GLOBAL_REGION ,
63- Labels : labels ,
64- ...apiConfig ,
52+ const apiIdSessions = api ?. id ?. split ( '/' ) || [ ]
53+ if ( ! isEmpty ( apiIdSessions ) ) {
54+ const apiName = apiIdSessions [ apiIdSessions . length - 1 ]
55+ const apiConfigIter = apiGatewayClient . listApiConfigsAsync ( {
56+ parent : `projects/${ projectId } /locations/${ GLOBAL_REGION } /apis/${ apiName } ` ,
6557 } )
58+
59+ for await ( const { name, labels, ...apiConfig } of apiConfigIter ) {
60+ routerData . push ( {
61+ id : name ,
62+ projectId,
63+ region : GLOBAL_REGION ,
64+ Labels : labels ,
65+ ...apiConfig ,
66+ } )
67+ }
6668 }
6769 }
6870 } catch ( error ) {
You can’t perform that action at this time.
0 commit comments