ADC CLI Commands

api-spec

The following operations can be performed on “api-spec”:

update rm show add stat

update api spec

Updates the api spec with latest specfile. In a high availability configuration, the path to the specfile must be the same on the primary and secondary nodes.

Synopsis

update api spec -file \[-type ] \[-skipvalidation \( YES | NO )]

Arguments

name Name for the spec. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. Cannot be changed after the spec is created.

The following requirement applies only to the Citrix ADC CLI: If the name includes one or more spaces, enclose the name in double or single quotation marks (for example, “my spec” or ‘my spec’).

file Name of and, optionally, path to the api spec file. The spec file should be present on the appliance’s hard-disk drive or solid-state drive. Storing a spec file in any location other than the default might cause inconsistency in a high availability setup. /nsconfig/apispec/ is the default path.

type Input format of the spec file. The three formats supported by the appliance are: PROTO OAS/Swagger GRAPHQL

Possible values: PROTO, OAS, GRAPHQL Default value: OAS

skipvalidation Disabling openapi spec validation while adding it

Possible values: YES, NO Default value: NO

Example

1)update api spec example_spec01 -file /nsconfig/apispec/example_spec01.proto -type PROTO The above command loads a spec file of type PROTO.

rm api spec

Removes all the spec, or the specified spec, from the appliance. The spec is removed only if it is not referenced by an app firewall profile.

Synopsis

rm api spec ...

Arguments

name Name of the spec to remove.

Example

1)rm api spec example_spec01 The above command removes the spec example_spec01 from the system.

show api spec

Displays information about all the spec configured on the appliance, or displays detailed information about the specified spec.

Synopsis

show api spec []

Arguments

name Name of the spec for which to show detailed information.

Output

file Name of and, optionally, path to the api spec file. The spec file should be present on the appliance’s hard-disk drive or solid-state drive. Storing a spec file in any location other than the default might cause inconsistency in a high availability setup. /nsconfig/apispec/ is the default path.

type Input format of the spec file. The three formats supported by the appliance are: PROTO OAS/Swagger GRAPHQL

apiname API method used for display purposes

apiService API endpoint (could be GRPC service, REST path) used for display purposes

httpMethod GRPC API option method: REST way to reach GRPC Service. One per service/method combination

httpUrlPath GRPC API option endpoint: REST way to reach GRPC Service. One per service/method combination

skipvalidation Disabling openapi spec validation while adding it

encrypted Specify the encrypted API spec. Must be in NetScaler format

devno count stateflag

Example

1) An example of the output of the show api spec command is shown below: 2 configured specs: 1)Name: example_spec01 File: example_spec01.proto Type: PROTO 2)Name: example_spec02 File: example_spec02.oas Type: OAS

2) An example of the output of the show api spec example_spec01 command is shown below: Name: example_spec01 File: example_spec01.proto Type: PROTO 1) GRPS Method: SayHello GRPC Service: Greeter

add api spec

Adds a specfile to memory. After it is bound to a profile it can be used for validations. In a high-availability configuration, the path to spec file must be the same on the primary and the secondary appliance.

Synopsis

add api spec -file \[-type ] \[-skipvalidation \( YES | NO )] \[-encrypted]

Arguments

name Name for the spec. Must begin with an ASCII alphanumeric or underscore (_) character, and must contain only ASCII alphanumeric, underscore, hash (#), period (.), space, colon (:), at (@), equals (=), and hyphen (-) characters. Cannot be changed after the spec is created.

The following requirement applies only to the Citrix ADC CLI: If the name includes one or more spaces, enclose the name in double or single quotation marks (for example, “my spec” or ‘my spec’).

file Name of and, optionally, path to the api spec file. The spec file should be present on the appliance’s hard-disk drive or solid-state drive. Storing a spec file in any location other than the default might cause inconsistency in a high availability setup. /nsconfig/apispec/ is the default path.

type Input format of the spec file. The three formats supported by the appliance are: PROTO OAS/Swagger GRAPHQL

Possible values: PROTO, OAS, GRAPHQL Default value: OAS

skipvalidation Disabling openapi spec validation while adding it

Possible values: YES, NO Default value: NO

encrypted Specify the encrypted API spec. Must be in NetScaler format

Example

1)add api spec example_spec01 -file /nsconfig/apispec/example_spec01.proto -type PROTO The above command loads a spec file of type PROTO.

stat api spec

Synopsis

stat api spec [] \[-detail] \[-fullValues] \[-ntimes <positive\_integer>] \[-logFile <input\_filename>] \[-clearstats \( basic | full )]

Arguments

name Name of the api spec for which to display stats.

detail Specifies detailed output (including more statistics). The output can be quite voluminous. Without this argument, the output will show only a summary.

fullValues Specifies that numbers and strings should be displayed in their full form. Without this option, long strings are shortened and large numbers are abbreviated

ntimes The number of times, in intervals of seven seconds, the statistics should be displayed. Default value: 1 Minimum value: 0

logFile The name of the log file to be used as input.

clearstats Clear the statsistics / counters

Possible values: basic, full

Output

count devno stateflag

Counters

API specification hits (hits) Number of received requests for the API specification.

API specification successful validations (validated) Number of successfully validated requests for the API specification.

API specification unmatched requests (unmatched) Number of requests non matching this API specification.

api-spec