Original Message:
Sent: Thu July 20, 2023 05:16 PM
From: Steve Linn
Subject: custom modules
Hi Santhoshkumar,
Thank you for opening the PMR. So your previous post makes sense. Your gateway extension doesn't have the std-post-invoke UDP deployed globally. You're deploying nested-custmodule.yaml globally and it uses std-post-invoke, but you don't have std-post-invoke in your gateway extension. To be on the safe side, ordering may also be important, so in your manifest, I'd have the dependent UDP std-post-invoke first so it would be deployed, then your nested-custmodule.yaml when it is deployed, std-post-invoke exists. I must say you're breaking some new territory for me as my recreate was using the invoke_1.5.0 emulated policy which is in the deployed-policies section of the manifest and gets deployed first. I was not using another custom UDP, but hopefully that will work if both are in the gateway extension.
Best Regards,
Steve Linn
------------------------------
Steve Linn
Senior Consulting I/T Specialist
IBM
------------------------------
Original Message:
Sent: Thu July 20, 2023 03:00 PM
From: santhoshkumar surisetty
Subject: custom modules
yes , you are right , I uploaded on catalog level and when i try to use UDP in API is not getting deployed and giving the below error . I tried to deploy global level getting the different error. Please find files attached. I will create PMR .Kindly let me know if there is anything wrong with files attached.
Getting below error when i try to publish API Which is having nested UDP.
0x88e00127 apic-gw-service (default): Stack trace for previous error: at new AssemblyAction (/root/gateway-director/apic2dp/lib/compiler/api.js:1030:15) at /root/gateway-director/apic2dp/lib/compiler/api.js:978:15 at Array.map (<anonymous>) at new APIRule (/root/gateway-director/apic2dp/lib/compiler/api.js:977:26) at new Assembly (/root/gateway-director/apic2dp/lib/compiler/api.js:925:17) at APIDefinition.build (/root/gateway-director/apic2dp/lib/compiler/api.js:399:23) at new APIDefinition (/root/gateway-director/apic2dp/lib/compiler/api.js:121:12) at Object.exports [as compileAPI] (/root/gateway-director/apic2dp/lib/compiler/api.js:2071:12) at Object.module.exports.compileAPI (/root/gateway-director/apic2dp/lib/index.js:393:22) at /root/gateway-director/lib/gateway-controller/apigateway/ApiGatewayController.js:2290:28 at arrayMap (/root/gateway-director/node_modules/lodash/lodash.js:653:23) at Function.map (/root/gateway-director/node_modules/lodash/lodash.js:9622:14) at compileApis (/root/gateway-director/lib/gateway-controller/apigateway/ApiGatewayController.js:2288:22) at compileArtifacts (/root/gateway-director/lib/gateway-controller/apigateway/ApiGatewayController.js:2164:20) at getSnapshotArtifacts (/root/gateway-director/lib/gateway-controller/apigateway/ApiGatewayController.js:2584:18) at async ApiGatewayController._refresh (/root/gateway-director/lib/gateway-controller/apigateway/ApiGatewayController.js:842:23) at async ApiGatewayController.refresh (/root/gateway-director/lib/gateway-controller/apigateway/ApiGatewayController.js:746:18) at async /root/gateway-director/lib/queueProcessor.js:1190:17 at async run (/root/gateway-director/node_modules/p-queue/dist/index.js:163:29)
6:27:48 PM apic-gw-service error 784 0x88e00240 apic-gw-service (default): Unable to refresh gateway. Error: Assembly action nested-custmodule:2.0.0 is not supported.
Getting the below error when try to upload global level
| 6:43:02 PM |
|
|
784 |
|
|
0x80e0084c |
apic-gw-service (default): lib:gateway-controller:apigateway:GatewayVectorExtensionController: Start processing updates: [] |
| 6:43:02 PM |
|
|
784 |
|
|
0x88e00273 |
apic-gw-service (default): Unable to deploy gateway extensions. Failed extension data: [{"info":"Failed to deploy extension.","extension":{"filename":"nested-custmodule.yaml","deploy":"immediate","type":"user-defined-policy-yaml","assemblyFunctions":[],"hash":"sha256-NB0Iozjv5afCIlhvKFsQR3i36IFRmrcffpquLJvyi6A=","policyInfo":{"policy":{"info":{"name":"nested-custmodule","version":"2.0.0"}},"type":"assembly"}}}] |
| 6:43:02 PM |
|
|
784 |
|
|
0x88e00127 |
apic-gw-service (default): Stack trace for previous error: at new AssemblyAction (/root/gateway-director/apic2dp/lib/compiler/api.js:1030:15) at /root/gateway-director/apic2dp/lib/compiler/api.js:978:15 at Array.map (<anonymous>) at new APIRule (/root/gateway-director/apic2dp/lib/compiler/api.js:977:26) at new Assembly (/root/gateway-director/apic2dp/lib/compiler/api.js:925:17) at Object.exports [as compileAPI] (/root/gateway-director/apic2dp/lib/compiler/api.js:2067:23) at Object.module.exports.compileUserDefinedPolicyServiceLevel (/root/gateway-director/apic2dp/lib/index.js:292:20) at ApigwCustomPolicyYaml.getCfg (/root/gateway-director/lib/gateway-controller/apigateway/ApigwCustomPolicyYaml.js:89:23) at ApigwCustomPolicyYaml.generateFilestore (/root/gateway-director/lib/gateway-controller/apigateway/ApigwCustomPolicyYaml.js:133:26) at processNew (/root/gateway-director/lib/gateway-controller/apigateway/GatewayVectorExtensionController.js:557:44) at async processEventMap (/root/gateway-director/lib/gateway-controller/apigateway/GatewayVectorExtensionController.js:289:7) at async GatewayVectorExtensionController.refresh (/root/gateway-director/lib/gateway-controller/apigateway/GatewayVectorExtensionController.js:127:23) at async GatewayExtensionDeployer.extend (/root/gateway-director/lib/gateway-controller/apigateway/GatewayExtensionDeployer.js:525:33) at async runImmediateExtDeploy (/root/gateway-director/lib/gateway-controller/apigateway/ApiGatewayController.js:3231:7) at async handleGwExtMessage (/root/gateway-director/lib/gateway-controller/apigateway/ApiGatewayController.js:3188:15) at async ApiGatewayController.onMessage (/root/gateway-director/lib/gateway-controller/apigateway/ApiGatewayController.js:1768:7) |
| 6:43:02 PM |
|
|
784 |
|
|
0x88e00272 |
apic-gw-service (default): Unable to deploy gateway extension. Error: Assembly action std-post-invoke:1.0.0 is not supported. (Extension data: {"filename":"nested-custmodule.yaml","deploy":"immediate","type":"user-defined-policy-yaml","assemblyFunctions":[],"hash":"sha256-NB0Iozjv5afCIlhvKFsQR3i36IFRmrcffpquLJvyi6A=","policyInfo":{"policy":{"info":{"name":"nested-custmodule","version":"2.0.0"}},"type":"assembly"}}) |
------------------------------
santhoshkumar surisetty
Original Message:
Sent: Wed July 19, 2023 05:47 PM
From: Steve Linn
Subject: custom modules
Hi Santhoshkumar,
We've determined that this is a defect. Please confirm in your case that you uploaded your user defined policy to your catalog. We found in this case, you would get an error that the referenced UDP was not supported (actually not deployed) when it really was. A fix is under development, but you really should open a PMR for this issue. As a work around, if you deploy your UDP globally, it should deploy with no issue. Since I already use a gateway extension with my gateway, I took my UDP yaml, included it in my gateway-extension.zip file, and updated the manifest.json file's section to add a reference to that file with a type of user-defined-policy-yaml. I then updated the gateway's gateway extension using the CMC Cloud Manager.
"files": [ { "filename": "forum-udp-in-udp.yaml", "deploy": "immediate", "type": "user-defined-policy-yaml" },
Best Regards,
Steve Linn
------------------------------
Steve Linn
Senior Consulting I/T Specialist
IBM
Original Message:
Sent: Wed July 19, 2023 02:44 PM
From: Steve Linn
Subject: custom modules
Hi Santhoshkumar,
I tried a simple use case and it didn't work either. I was surprised as I think it should. Please open a PMR. In the meantime, we're looking into it to understand why.
Best Regards,
Steve Linn
------------------------------
Steve Linn
Senior Consulting I/T Specialist
IBM
Original Message:
Sent: Tue July 18, 2023 12:33 PM
From: santhoshkumar surisetty
Subject: custom modules
Hi Linn,
Custom module is working fine but nested user defined policy is not working . do you have any examples. Could you please share ?
------------------------------
santhoshkumar surisetty
Original Message:
Sent: Mon July 17, 2023 08:48 AM
From: Steve Linn
Subject: custom modules
My apologies for missing the second question. You should be able to use a UDP within a UDP.
Best Regards,
Steve Linn
------------------------------
Steve Linn
Senior Consulting I/T Specialist
IBM
Original Message:
Sent: Fri July 14, 2023 12:00 PM
From: santhoshkumar surisetty
Subject: custom modules
thank you , i will try and let you know . My second question is that i created multiple custom policies . can i use these custom policies in another custom policy ?
------------------------------
santhoshkumar surisetty
Original Message:
Sent: Thu July 13, 2023 05:38 PM
From: Steve Linn
Subject: custom modules
Hi Santhoshkumar,
Yes you can. To deploy them to your gateway the file will need to be in a gateway extension. Then you'd just do a standard require to the path where you placed the file, ie local:///mypath/mymodule.js in your GatewayScript code that uses it. The module can be used by any API, including within user defined policies.
Best Regards,
Steve
------------------------------
Steve Linn
Senior Consulting I/T Specialist
IBM