How to search products by a proxy

Not applicable

@Dino

Thank you for a useful tool you have posted at github. I was trying both the nodejs and powershell options and getting below errors. Can you please take a look?

Powershell - After org name, user name, pass and, proxy name is entered

Set-EdgeConnection : The term 'Set-EdgeConnection' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\git\apigee\utilities\EdgeTools\findProxy.ps1:17 char:1
+ Set-EdgeConnection @connection
+ ~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Set-EdgeConnection:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Proxy to find: Utility-SMC-CORE-v1
Get-EdgeApiProduct : The term 'Get-EdgeApiProduct' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At C:\git\apigee\utilities\EdgeTools\findProxy.ps1:23 char:12
+ $prods = @(Get-EdgeApiProduct -Params @{ expand = 'true' }).apiProduct
+ ~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Get-EdgeApiProduct:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException
Total Products: 0
Exception calling "Format" with "2" argument(s): "Value cannot be null.
Parameter name: args"
At C:\git\apigee\utilities\EdgeTools\findProxy.ps1:30 char:1
+ Write-Output ([string]::Format('Products: {0}', (ConvertTo-Json $filteredProds) ...
+~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : ArgumentNullException

NodeJS (findApiProductForProxy.j) - after user name and pass is entered

You must specify an Edge organization
Usage: node findApiProductForProxy.js
Solved Solved
0 5 369
1 ACCEPTED SOLUTION

Hi -

I'm sorry to hear you are having troubles.

The Set-EdgeConnection is a powershell cmdlet (that's a cute abbreviation that is pronounced "command-let" - I guess it implies a small command. It's a powershell thing, not an Apigee thing). You can use powershell cmdlets

  • if you have a Windows machine
  • if you can import a module (you may need admin rights to do so)

This is in the readme for the Powershell module, along with specific instructions for how to import the module. If you are seeing the message like this:

Set-EdgeConnection:The term 'Set-EdgeConnection'isnot recognized as the name of a cmdlet,function, script file,or operable program.Check the spelling of the name,orif a path was included, verify that the path is correct andtry again.

...then it seems like you have not successfully imported the module. Check the readme maybe?

Regarding the findApiProductForProxy.js - there are other required arguments. I Think perhaps you did not paste in the entire message that was returned by findApiProductForProxy.js. When I run it I see this:

You must specify an Edge organization
Usage: node findApiProductForProxy.js


  -M, --mgmtserver=ARG  the base path, including optional port, of the Edge mgmt server. Defaults to https://api.enterprise.apigee.com . 
  -u, --username=ARG    org user with permissions to read Edge configuration.
  -p, --password=ARG    password for the org user.
  -n, --netrc           retrieve the username + password from the .netrc file. In lieu of -u/-p
  -o, --org=ARG         the Edge organization.
  -P, --proxy=ARG       the proxy to find.
  -v, --verbose         
  -h, --help            

And the script is complaining that you did not use the -o option.

Check the readme on that one, too. I've just updated it to try to make it clearer.

Good luck!

View solution in original post

5 REPLIES 5

Not applicable

Hi @Dino, Did you get a chance to take a look?

Hi -

I'm sorry to hear you are having troubles.

The Set-EdgeConnection is a powershell cmdlet (that's a cute abbreviation that is pronounced "command-let" - I guess it implies a small command. It's a powershell thing, not an Apigee thing). You can use powershell cmdlets

  • if you have a Windows machine
  • if you can import a module (you may need admin rights to do so)

This is in the readme for the Powershell module, along with specific instructions for how to import the module. If you are seeing the message like this:

Set-EdgeConnection:The term 'Set-EdgeConnection'isnot recognized as the name of a cmdlet,function, script file,or operable program.Check the spelling of the name,orif a path was included, verify that the path is correct andtry again.

...then it seems like you have not successfully imported the module. Check the readme maybe?

Regarding the findApiProductForProxy.js - there are other required arguments. I Think perhaps you did not paste in the entire message that was returned by findApiProductForProxy.js. When I run it I see this:

You must specify an Edge organization
Usage: node findApiProductForProxy.js


  -M, --mgmtserver=ARG  the base path, including optional port, of the Edge mgmt server. Defaults to https://api.enterprise.apigee.com . 
  -u, --username=ARG    org user with permissions to read Edge configuration.
  -p, --password=ARG    password for the org user.
  -n, --netrc           retrieve the username + password from the .netrc file. In lieu of -u/-p
  -o, --org=ARG         the Edge organization.
  -P, --proxy=ARG       the proxy to find.
  -v, --verbose         
  -h, --help            

And the script is complaining that you did not use the -o option.

Check the readme on that one, too. I've just updated it to try to make it clearer.

Good luck!

Thank you! The Nodejs is working now. Is there anyway to make this deployed to the apigee ui?

Hmm, I agree, that would be a good feature to add! Let me add it to the backlog.

Awesome!!! Please let me know when it is available.