About the API Explorer

About the API Explorer

The API Explorer provides a limited interface for the REST API as well as giving a view of the abilities of the REST API.

As part of the Open API Specification, you can use CodeGen to generate sample code. CodeGen is a utility provided with Swagger which generates API client libraries and code from the Open API Specification. For more information, see "Obtaining code with CodeGen".

This explorer provides the list of APIs available on the Firewall Management Center, and their details.

Note that in Security Cloud Control the API Explorer runs on the Security Cloud Control platform, and any calls made to the API Explorer affect the cloud-delivered Firewall Management Center.

Connecting to API Explorer in Cloud-Delivered Firewall Management Center

Connects to API Explorer in Cloud-Delivered Firewall Management Center

Before you begin

You must have an account on the Security Cloud Control tenant and be able to access the Cloud-Delivered Firewall Management Center.

You must generate an API Token.

You must allow popups from Security Cloud Control.

Procedure


Step 1

Log in to Security Cloud Control tenant.

Step 2

From the menu on the left select Administration > Integrations > Firewall Management Center.

Step 3

In the table which comes up, select Cloud-Delivered FMC.

Step 4

In the Actions pane on the right, click on API Explorer.


Obtaining Sample Code with CodeGen

You can use the CodeGen utility on the Open API Spec to generate sample code in a number of different languages. This utility is an open-source tool you can download online. The resultant code is meant primarily as an educational and bootstrapping tool.

The CodeGen utility creates sample code for the entire Open API Spec. As such, it generates sample code for every allowed method and endpoint in the REST API. The sample code can be in a variety of languages, including HTML, Perl, Python, and Java.

For complete documentation of the CodeGen utility go to https://repo1.maven.org/maven2/io/swagger/swagger-codegen-cli/

Downloading the Open API Spec

The Open API Spec is a standardized specification of a REST API. The Open API Spec for the Firewall Management Center REST API contains details about the endpoints, fields, parameters, and requirements of the API. You can use the API Spec to generate sample code as well as find specific information about API functionality.

The Open API Spec is a JSON file. It can be read by most text editors.

Before you begin

Have an account on the Firewall Management Center which is able to access the API Explorer.

Make sure that your browser is able to download from sites with self-signed certificates.

Procedure


Step 1

Open API Explorer using the steps given in Connecting to API Explorer in Cloud-Delivered Firewall Management Center

Step 2

Click on Download Spec in the upper right corner. Depending on your browser configuration, you will either be given a prompt to save the file, or be shown the file directly.

Step 3

Save the file. Be sure to note the destination and filename.


What to do next

Run the CodeGen utility on the downloaded file.

Generating Sample Code with the CodeGen Utility

The Swagger CodeGen utility allows you to generate sample code from an Open API Spec. This sample code can be in a variety of languages including Java, HTML, Python, and Perl.

Before you begin

Download the Swagger CodeGen Utility. See Obtaining Sample Code with CodeGen.

Have a Jave Runtime Environment installed on your computer

Download the Firewall Management Center REST API Open API Spec. See Downloading the Open API Spec.

Set environment variables to allow you to run the CodeGen utility

Procedure


From the command line, run the command java -jar ./swagger-codegen-cli-<VERSION>.jar generate -o <OUTPUT_PATH> -l <LANGUAGE> -i <OPEN_API_SPEC_FILE>

Example:

java -jar ./swagger-codegen-cli-2.3.1.jar generate -o C:\work\code\api_schema\html -l html -i fmc_swagger.json 

<VERSION> is the specific version of the CodeGen utility you are using. It must match the filename of the CodeGen .jar file.

<OUTPUT_PATH> is the path to which you want to output the generated code.

<LANGUAGE> is the language which you want CodeGen to generate. Suggested options include html, java, perl, and python. Other options are possible, check the CodeGen documentation for the complete list of choices.

<OPEN_API_SPEC_FILE> is the Open API Spec file which you downloaded. This is the source from which CodeGen is generating example code. Without it, CodeGen cannot provide output.


What to do next

Find the generated code in the output path and use as desired. Generated code should be considered an example, and may not perform as desired unless modified to meet your needs.

Viewing API Parameters

Each resource has a set of parameters and fields associated with it. You can view the parameters and fields by performing any of the supported operations for that resource within API Explorer.

Before you begin

You must have a configured Firewall Management Center and an account on that management center with the permissions required to use the desired REST API functions.

Procedure


Step 1

Open API Explorer. See Connecting to API Explorer in Cloud-Delivered Firewall Management Center.

Step 2

Select the desired resource.

Step 3

Select one of the supported operations for that resource.