Skip to main content

Analyzing an Exported Apigee API Proxy

Hands-On Lab

 

Photo of Joseph Lowery

Joseph Lowery

Google Cloud Training Architect II in Content

Length

00:30:00

Difficulty

Beginner

Before deploying your API proxy to production, you need to make sure that it is thoroughly reviewed and tested. Static code analysis is an important procedure you can run that helps to ensure your code is consistent and clean. This process is known as linting, and Apigee API proxies can take advantage of an open-source tool called apigeelint. In this hands-on lab, we'll take the preliminary steps necessary to run apigeelint, exporting our API proxy using the Apigee Edge Management APIs. Then, we'll install apigeelint and use it to validate our code, displaying the results in a table format.

What are Hands-On Labs?

Hands-On Labs are scenario-based learning environments where learners can practice without consequences. Don't compromise a system or waste money on expensive downloads. Practice real-world skills without the real-world risk, no assembly required.

Analyzing an Exported Apigee API Proxy

Introduction

Before deploying your API proxy to production, you need to make sure that it is thoroughly reviewed and tested. Static code analysis is an important procedure you can run that helps to ensure your code is consistent and clean. This process is known as linting, and Apigee API proxies can take advantage of an open-source tool called apigeelint. In this hands-on lab, we'll take the preliminary steps necessary to run apigeelint, exporting our API proxy using the Apigee Edge Management APIs. Then, we'll install apigeelint and use it to validate our code, displaying the results in a table format.

Connecting to the Lab

  1. Navigate to https://cloud.google.com/apigee.
  2. Click the Try it free button.
  3. Create a free Apigee account.

Export the API Proxy

  1. On the Apigee dashboard page, click API Proxies.
  2. Click the link for the proxy you want to analyze.
  3. Review the name and revision number.
  4. In your browser, navigate to https://apidocs.apigee.com/management/apis.
  5. In the Apigee Management APIs navigation menu, select API Proxies > Export API Proxy.
  6. Scroll down the page to the Resource URL section.
  7. Complete the Resource URL by filling in the following elements:
    • Your organization name
    • Your API proxy name
    • Your proxy's revision number
  8. In the HTTP Basic box, click Set...
  9. In the Set Authentication dialog, enter your Apigee email and password.
  10. Click Save.
  11. Click Send this request.
  12. Select the cURL tab.
  13. Copy the generated cURL command to your clipboard.
  14. In your terminal, paste the copied cURL command, and add the following: -o ~/downloads/LAproxy.zip

Install and Run apigeelint

  1. Change to your Downloads directory. cd ~/downloads
  2. Verify that the LAproxy.zip file is in the Downloads directory. ls
  3. Install apigeelint. sudo npm install -g apigeelint
  4. Enter your password at the prompt.
  5. Unzip the downloaded proxy. unzip LAproxy.zip
  6. Run apigeelint on the proxy folder. apigeelint -s apiproxy/ -f table.js
  7. Review the results.

Conclusion

Congratulations, you've successfully completed this hands-on lab!