VirtualService

API

Macro API allows the user to create an object hierarchy, which consists of a top level object and a set of objects it refers to in a recursive fashion. An example usage would be to create a VirtualService, Pool, and a set of custom profiles such as ApplicationProfile, NetworkProfile for every tenant. Instead of using multiple APIs to create the profiles, pool and the virtualservice, the user can just use one API to create the entire hierarchy of objects. This API is transactional in nature in that if there is an error in the creation of any of the objects, the entire transaction will be rolled back. User has the flexibility to refer to an existing object (eg. system profiles), or create a new object as a part of this object hierarchy. Additionally, the same API can be used to modify any of the objects.

In the following example, the MACRO API is used to create a VirtualService, Pool and associated HealthMonitor object. The VirtualService refers to existing ApplicationProfile and NetworkProfile objects.


POST /api/macro
{
    "model_name": "VirtualService",
    "data": {
        "name": "n_vs",
        "services": [
            {
                "port": 80
            }
        ],
        "vip": [
            "ip_address": {
                "type": "V4",
                "addr": "2.2.2.2"
            },
        ],
        "application_profile_ref": "/api/applicationprofile?name=n_app_http", "pool_ref_data": { "name": "n_pool", "servers": [ { "ip": { "type": "V4", "addr": "1.1.1.1" } } ], "health_monitor_refs_data": [ { "type": "HEALTH_MONITOR_HTTP", "name": "n_http", "http_monitor": { "http_response_code": [ { "code": "HTTP_2XX" } ] } } ]  }  } }