AS3 Template

Overview

Use this API to define an Application Services 3 Extension (AS3) template on BIG-IQ. You can use AS3 on BIG-IQ in largely the same way as on BIG-IP and described in the AS3 documentation: Using AS3 with BIG-IQ. With BIG-IQ, declarations use an AS3 template which is defined in BIG-IQ. For an example of an AS3 declaration that uses an AS3 template, see the AS3 documentation: Using declarations with AS3 templates . You can use the AS3 Declare API to post the AS3 declaration to BIG-IP.

You can find examples of default templates in the f5devcentral/f5-big-iq repository on GitHub.

REST Endpoint: /mgmt/cm/global/appsvcs-templates

Requests

POST /mgmt/cm/global/appsvcs-templates

This creates an AS3 template on BIG-IQ.

Request Parameters

Name Type Required Description
isUICompatible boolean False This field is not required to create a template using the API. If isUICompatible is present, its value must be false to create a template using the API. The purpose of isUICompatible is to distinguish templates that can be used in the UI. Note that templates available online may have this field set as true.
name string True The name of the AS3 template. This is the only field required by BIG-IQ.
published boolean True If true, this template has been published.
schemaOverlay various False The various subfields of schemaOverlay change depending upon the application. The AS3 application declarations are validated using the contents of this field and the contents must be a valid JSON Schema draft 7 .
tenant object False Tenant details, for example {“name”: “default”, “override”: false, “editable”: true}. Note: When using the generic service with DNS templates, the dnsMain field must be set in the name of the application.

Query Parameters

None

Response

HTTP/1.1 200 OK

Name Type Description
isUICompatible boolean This field is not required to create a template using the API. If isUICompatible is present, its value must be false to create a template using the API. The purpose of isUICompatible is to distinguish templates that can be used in the UI. Note that templates available online may have this field set as true.
name string The name of the AS3 template. This is the only field required by BIG-IQ.
published boolean If true, this template has been published.
schemaOverlay various The various subfields of schemaOverlay change depending upon the application. The AS3 application declarations are validated using the contents of this field and the contents must be a valid JSON Schema draft 7.
tenant object Tenant details, for example {“name”: “default”, “override”: false, “editable”: true}. Note: When using the generic service with DNS templates, the dnsMain field must be set in the name of the application.

Permissions

Role Allow
Application_Creator Yes
Application_Manager Yes

GET /mgmt/cm/global/appsvcs-templates

This lists the collection of AS3 templates on BIG-IQ.

Request Parameters

None

Query Parameters

None

Response

HTTP/1.1 200 OK

Name Type Description
isUICompatible boolean This field is not required to create a template using the API. If isUICompatible is present, its value must be false to create a template using the API. The purpose of isUICompatible is to distinguish templates that can be used in the UI. Note that templates available online may have this field set as true.
name string The name of the AS3 template. This is the only field required by BIG-IQ.
schemaOverlay various The various subfields of schemaOverlay change depending upon the application. The AS3 application declarations are validated using the contents of this field and the contents must be a valid JSON Schema draft 7.
tenant object Tenant details, for example {“name”: “default”, “override”: false, “editable”: true}

Permissions

Role Allow
Application_Creator Yes
Application_Manager Yes

GET /mgmt/cm/global/appsvcs-templates/<id>

This lists a specific AS3 template on BIG-IQ.

Request Parameters

None

Query Parameters

None

Response

HTTP/1.1 200 OK

Name Type Description
isUICompatible boolean This field is not required to create a template using the API. If isUICompatible is present, its value must be false to create a template using the API. The purpose of isUICompatible is to distinguish templates that can be used in the UI. Note that templates available online may have this field set as true.
name string The name of the AS3 template. This is the only field required by BIG-IQ.
schemaOverlay various The various subfields of schemaOverlay change depending upon the application. The AS3 application declarations are validated using the contents of this field and the contents must be a valid JSON Schema draft 7.
tenant object Tenant details, for example {“name”: “default”, “override”: false, “editable”: true}

Permissions

Role Allow
Application_Creator Yes
Application_Manager Yes

DELETE /mgmt/cm/global/appsvcs-templates/<id>

This deletes a specific AS3 template on BIG-IQ.

Request Parameters

None

Query Parameters

None

Response

HTTP/1.1 200 OK

Name Type Description
isUICompatible boolean This field is not required to create a template using the API. If isUICompatible is present, its value must be false to create a template using the API. The purpose of isUICompatible is to distinguish templates that can be used in the UI. Note that templates available online may have this field set as true.
name string The name of the AS3 template. This is the only field required by BIG-IQ.
schemaOverlay various The various subfields of schemaOverlay change depending upon the application. The AS3 application declarations are validated using the contents of this field and the contents must be a valid JSON Schema draft 7.
tenant object Tenant details, for example {“name”: “default”, “override”: false, “editable”: true}

Permissions

Role Allow
Application_Creator No
Application_Manager Yes

Examples

Example 1: Simple HTTP application template

This example creates a simple http template and makes use of the following template features.

Feature Meaning
additionalProperties Applications created using this example template will not provide classes or properties other than those defined in this template because the value of additionalProperties has been set to false.
serviceMain.class Any declaration which uses this example template will always use “Service_HTTP” as the serviceMain.class because the values of const and default have both been set to “Service_HTTP”.
serviceMain.pool This specifies the serviceMain.pool.
     const The field const is absent in the example template, which means the serviceMain.pool can be changed.
     default In this example, the default web_pool will be used for the serviceMain.pool because const has not been specified.
virtualAddresses The example allows any value to be specified at declaration time, because this field in the example template has a blank schema. Note that this does not mean any value provided in a declaration will succeed during deployment, only that the template will not prevent it.
virtualPort The example allows any value to be specified at declaration time, because this field in the example template has a blank schema. Note that this does not mean any value provided in a declaration will succeed during deployment, only that the template will not prevent it.
members The example allows any value to be specified at declaration time, because this field in the example template has a blank schema. Note that this does not mean any value provided in a declaration will succeed during deployment, only that the template will not prevent it.
POST http://<bigiq-address>/mgmt/cm/global/appsvcs-templates
{
    "name": "http-template",
    "schemaOverlay": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
            "template": {
                "const": "http",
                "default": "http"
            },
            "class": {},
            "schemaOverlay": {},
            "serviceMain": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                    "class": {
                        "const": "Service_HTTP",
                        "default": "Service_HTTP"
                    },
                    "virtualPort": {},
                    "virtualAddresses": {},
                    "pool": {
                        "default": "web_pool"
                    }
                }
            },
            "web_pool": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                    "class": {
                        "const": "Pool",
                        "default": "Pool"
                    },
                    "members": {}
                }
            }
        }
    }
}

Example 2: HTTPS application template

This example creates an HTTPS template.

POST http://<bigiq-address>/mgmt/cm/global/appsvcs-templates
{
    "name": "https-template",
    "schemaOverlay": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
            "template": {
                "const": "https",
                "default": "https"
            },
            "class": {},
            "schemaOverlay": {},
            "serviceMain": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                    "class": {
                        "const": "Service_HTTPS",
                        "default": "Service_HTTPS"
                    },
                    "virtualPort": {},
                    "virtualAddresses": {},
                    "serverTLS": {
                        "default": "webtls",
                        "const": "webtls"
                    }
                    "pool": {
                        "default": "web_pool"
                    }
                }
            },
            "web_pool": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                    "class": {
                        "const": "Pool",
                        "default": "Pool"
                    },
                    "loadBalancingMode": {
                        "default": "predictive-node"
                    },
                    "monitors": {
                        "default": ["http"],
                    },
                    "members": {}
                }
            },
            "webtls": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                    "class": {
                        "const": "TLS_Server",
                        "default": "TLS_Server"
                    },
                    "certificates": {
                        "type": "array",
                        "default": [{
                            "certificate": "webcert"
                        }]
                    }
                }
            },
            "webcert": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                    "class": {
                        "const": "Certificate",
                        "default": "Certificate"
                    },
                    "certificate": {},
                    "privateKey": {},
                    "passphrase": {}
                }
            }
        }
    }
}