Import API Specification
-
Open API - Swagger 2.0, OAS 3.0,3.1
-
ProtoBuf - v3 and v2
Manage API specification files
-
Import the API specification - Import an API specification to NetScaler through a URL or from the system.
-
Add the API specification to NetScaler - When you add an API specification to NetScaler, the file is validated, converted into an internal format, and an API specification entity is created. The API specification entity created will be used in policy expressions and Web App Firewall profiles.
Manage API specification files using the CLI
-
Name - Name of the API specification file that is uploaded.
-
Source - URL (protocol, host, path, and name) for the location to store the imported specification file.
-
Spec Name - The name of the entity that is created from the uploaded API specification.
-
Type - Input format of the API specification. Default Value: OAS
import api specFile <name> <src>
import apispec testapispec.json http://www.example.com/testapispec.json
add api spec <Name> -File <string> -Type <string>
add api spec testapispec -File testapispec.json -Type OAS
update api spec <specName> -File <string> -Type <string>
update api spec testapispec -File testapispec.json -Type OAS
show api spec <specName>
show api spec testapispec
rm api spec <specName>
rm api spec testapispec
Manage API specification files using the GUI
-
Navigate to Security > NetScaler Web App Firewall > Imports.
-
On the Imports page, select the API Spec Import Page tab, and then click Add.
-
On the API Spec Import Object page, select any one of the following options for the Import From parameter:
-
URL: A web URL on a website accessible to the appliance.
-
File: A file on a local or networked hard disk or other storage device.
-
-
Click Continue.
-
On the API Spec Import Object page, enter the following details:
-
API Spec Name – The name of the entity that is created from the uploaded API specification. Note: Both the API file name and the API Spec Name entered should be the same.
-
API Spec Type – Select the type of specification.Types: REST (OpenAPI/Swagger), and gRPC(PROTO).Default Type: REST (OpenAPI/Swagger)
-
Click Done.
-
View the statistics of API specification and API endpoints
-
API specifications hits - Requests matching any endpoint of the API specification.
-
API specification successful validations - Requests matching any endpoint of the API specification and in conformance with the API schema.
-
API specification unmatched requests - Requests not matching any endpoint of the API specification.
-
API endpoints hits - Requests matching a specific endpoint.
-
API endpoints successful validations - Requests matching a specific endpoint and in conformance with the API schema.
View API specifications and API endpoint statistics using the CLI
stat apispec <apispec name>
stat apispec testapispec
View API specifications and API endpoint statistics using the GUI
-
Navigate to Security > NetScaler Web App Firewall > Imports.
-
On the Imports page, select the API Spec Import tab, and then click Statistics.The API specification summary is displayed.
-
To view the endpoint summary, click any of the API specifications.The API endpoint summary is displayed for the selected API specification.