Basic Usage

This chapter provides an overview of how to use the Configuration Importer.

Introducing Configuration Documents

Configuration documents describe Traffic Manager configuration in a syntax that allows an administrator to create, read, alter, and maintain configuration definitions within version control systems. The configuration is expressed in either YAML (YAML Ain’t Markup Language) or JSON (JavaScript Object Notation) format, based upon the REST API schema defined in the Pulse Secure Virtual Traffic Manager: REST API Guide.

The following example configuration document describes a simple Traffic Manager configuration, containing a single virtual server and a TrafficScript rule, in both YAML and JSON formats:

example-config.yaml

example-config.json

version: 6.1

 

virtual_servers:

- name: example-service

properties:

basic:

enabled: true

port: 80

protocol: http

pool: discard

request_rules: [ basic-response ]

 

rules:

- name: basic-response

content: |

http.sendResponse("200 OK", "text/plain",       "Hello World\n",

      "X-Served-By: Ivanti vTM");

{

"version": 6.1,

"virtual_servers": [

{

"name": "example-service",

"properties": {

"basic": {

"enabled": true,

"port": 80,

"protocol": "http",

"pool": "discard",

"request_rules": [

"basic-response"

]

}

}

}

],

"rules": [

{

"name": "basic-response",

"content": "http.sendResponse(\"200 OK\",         \"text/plain\", \"Hello World\\n\",

        \"X-Served-By: Ivanti vTM\");\n"

}

]

}

Configuration documents have a few key differences to the REST API format. The following table lists some key concepts and a comparison of how they are implemented in configuration documents and the REST API:

Concept

Configuration Documents

REST API

Configuring Multiple Objects

A configuration document can describe many resources of different types together in a single document.

Each object has its own API endpoint. Multiple API calls are needed to configure multiple objects.

Unstructured Resources

The content for unstructured resources, such as TrafficScript rules, is expressed inline in the "content" field.

The resource is uploaded to the object's API endpoint with a content-type of "octet-stream" instead of JSON.

Declarative VS Imperative

Configuration documents express the desired state of the Traffic Manager in its entirety.

REST API calls make incremental changes to the existing configuration.

For a more detailed description of the differences between configuration documents and the REST API, see Comparison with the REST API.

To learn more about YAML, see www.yaml.org. To learn more about JSON, see www.json.org.