VirtualService

API

Macro API allows the user to create or delete 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 or delete a VirtualService, Pool, and a set of custom profiles such as ApplicationProfile, NetworkProfile for every tenant. Instead of using multiple APIs to create/delete the profiles, pool and the virtualservice, the user can just use one API to operate on the entire hierarchy of objects. This API is transactional in nature in that if there is an error for any of the objects, the entire transaction will be rolled back. During deletion, default profiles and profiles that are in use by other objects will not be deleted. Macro delete will not delete Tenant, Cloud, ServiceEngine, Network, NetworkRuntime, or VIMgr objects. During creation, 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 using PUT.

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" } ] } } ] } 
    }
}

In the following example, the MACRO API is used to delete the VirtualService from the POST example above. The Pool and associated HealthMonitor object will also be deleted. The existing ApplicationProfile and NetworkProfile objects will not be deleted as they are in use by another VirtualService. The MACRO API will automatically calculate which objects to delete from the uuid of the top level object.


DELETE /api/macro
{
    "model_name": "VirtualService",
    "data": {
        "uuid": "n_vs_uuid"
    }
}