Example: Creating and Activating a NaaS Service Request
This example shows how to create a Network as a Service (NaaS) service request for a tenant in a multitier application network managed by the Juniper Networks Network Director application. A multitier application network contains logical entities or tier groups that are belong in different VLANs. In this example, there are three tier groups, each providing a specific function. The application tier group provides network applications support, the Web tier group provides Internet access, and the client tier group provides client support.
The tier groups are typically connected to different physical compute servers and virtual machines (VMs). In turn, the servers and VMs are connected to devices (such as an MX router) that are managed by the Network Director. The NaaS service is provided to the servers and VMs through the revenue ports on the managed devices.
Requirements
This example uses the following hardware and software components:
- Hardware components:
- An MX Series router
- A QFabric system
- An SRX Series Services Gateway
- Two compute servers and four VMs
- Software components:
- Junos Space Release 13.1P5
- Network Director API Release 1.5
- REST HTTP client software
Before you begin to create the multitier application NaaS request, be sure that:
- Network Director API Release 1.5 is installed and operating.
- NaaS service is initialized (the physical network topology has been imported into the NaaS service repository and the NaaS domain is created).
- Static configurations are pushed to network devices.
Overview
In this example, the multitier application network contains three tier groups. Each group belongs to a VLAN, and is connected to a physical server or a VM. To configure and manage a multitier application network using the Network Director API, you must send NaaS service requests to create resources for connectivity groups, Layer 2 and Layer 3 connectivity services, security policies, and security policy rules for the tier groups. Once the resources are created, you activate the NaaS services.
Topology
Figure 1 shows the topology of a multitier application network.
Figure 1: Multitier Application Network Topology

This example uses the following physical components:
- A QFabric system
- An MX Series router
- An SRX Series Services Gateway
- Two physical servers
- Four VMs (running on two other physical servers)
This example uses the following logical components:
- Web tier group
- Client tier group
- Application tier group
Creating a Multitier Application NaaS Request
From your REST HTTP client, perform the following tasks.
![]() | Note: The IP address used in this example is that of the host server on which the Network Director API software is installed. |
- Creating General Resources
- Creating the Connectivity Group and Port Resources
- Creating the Layer 2 and Layer 3 Connectivity Services
- Creating Security Policy and Security Policy Rule Resources
- Activating the NaaS Services
Creating General Resources
Step-by-Step Procedure
This section describes the steps for creating general resources.
- Send a POST request to create a tenant resource (if one
is not already created).
- Content type = application/vnd.juniper.nd.tenant+xml;version=1;charset=UTF-8
- URL = https://172.68.52.10/api/juniper/nd/tenants
- Request parameters: name=”Tenant A”
- Response parameters: tenantID=”tenantA”
- Send a POST request to create a NaaS service request resource
that represents the multitier application network:
- Content type = application/vnd.juniper.nd.naas-services+xml;version=1;charset=UTF-8
- URL = https://172.68.52.10/api/juniper/nd/tenants/{tenant-id}/naas-services
- Request parameters: name=”Multitier App Network”, naasDomainID=”Multitier Domain1”
- Response parameters: naasServiceID=”multitierAppNetwork”
Creating the Connectivity Group and Port Resources
Step-by-Step Procedure
This section describes the steps for creating a connectivity group and port resources for each connectivity group.
- Send a POST request to create a ConnectivityGroup resource
that corresponds to the Web tier group:
- Content type =
application/vnd.juniper.nd.connectivity-groups+xml;version=1;charset=UTF-8 - URL = https://172.68.52.10/api/juniper/nd/tenants/{tenant-id}/naas-services/
{naas-service-id}/connectivity-groups - Request parameters: group name=”Web Tier Group”
- Response parameters: connectivityGroupID=”webTierGroup”
- Content type =
- Send a POST request to create a port resource for webTierGroup
that represents the attachment point for the host VM of the Web tier
group:
- Content type =
application/vnd.juniper.nd.ports+xml;version=1;charset=UTF-8 - URL = https://172.68.52.10/api/juniper/nd/tenants/{tenant-id}/naas-services/
{naas-service-id}/connectivity-groups/{connectivity-group-id}/ports - Request parameters: port name=”xe-0/0/1”
- Response parameters: portID=”webServer1-port”
- Content type =
- Send a POST request to create a ConnectivityGroup resource
for the client group:
- Content type =
application/vnd.juniper.nd.connectivity-groups+xml;version=1;charset=UTF-8 - URL = https://172.68.52.10/api/juniper/nd/tenants/{tenant-id}/naas-services/
{naas-service-id}/connectivity-groups - Request parameters: group name=”Client Group”
- Response parameters: connectivityGroupID=”clientGroup”
- Content type =
- Send a POST request to create a port resource for clientGroup
that represents the attachment point for the host server of the client
group:
- Content type =
application/vnd.juniper.nd.ports+xml;version=1;charset=UTF-8 - URL = https://172.68.52.10/api/juniper/nd/tenants/{tenant-id}/naas-services/
{naas-service-id}/connectivity-groups/{connectivity-group-id}/ports - Request parameters: port name=”xe-0/0/1”
- Response parameters: portID=”Client-port”
- Content type =
- Send a POST request to create a ConnectivityGroup resource
for the application tier group:
- Content type =
application/vnd.juniper.nd.connectivity-groups+xml;version=1;charset=UTF-8 - URL = https://172.68.52.10/api/juniper/nd/tenants/{tenant-id}/naas-services/
{naas-service-id}/connectivity-groups - Request parameters: group name=”App Tier Group”
- Response parameters: connectivityGroupID=”appTierGroup”
- Content type =
- Send a POST request to create a port resource for appTierGroup
that represents the attachment point for the host VM of the application
tier group:
- Content type =
application/vnd.juniper.nd.ports+xml;version=1;charset=UTF-8 - URL = https://172.68.52.10/api/juniper/nd/tenants/{tenant-id}/naas-services/
{naas-service-id}/connectivity-groups/{connectivity-group-id}/ports - Request parameters: port name=”xe-0/0/1”
- Response parameters: portID=”webServer2-port”
- Content type =
Creating the Layer 2 and Layer 3 Connectivity Services
Step-by-Step Procedure
This section describes the steps for creating Layer 2 and Layer 3 connectivity services for each connectivity group.
- Send a POST request to create an L2ConnectivityService
resource for the Web tier group:
- Content type =
application/vnd.juniper.nd.l2-connectivity-services+xml;version=1;charset=UTF-8 - URL = https://172.68.52.10/api/juniper/nd/tenants/{tenant-id}/naas-services/
{naas-service-id}/l2-connectivity-services - Request parameters: name=”Web Tier Subnet””, connectivityGroupID=”webTierGroup”, subnet=”192.10.2.1/25”
- Response parameters: L2ConnectivityServiceID=”webTierSubnet”
- Content type =
- Send a POST request to create an L2ConnectivityService
resource for the application tier group:
- Content type =
application/vnd.juniper.nd.l2-connectivity-services+xml;version=1;charset=UTF-8 - URL = https://172.68.52.10/api/juniper/nd/tenants/{tenant-id}/naas-services/
{naas-service-id}/l2-connectivity-services - Request parameters: name=”App Tier Subnet””, connectivityGroupID=”appTierGroup”, subnet=”192.10.2.2/25”
- Response parameters: L2ConnectivityServiceID=”appTierSubnet”
- Content type =
- Send a POST request to create an L2ConnectivityService
resource for the client group:
- Content type =
application/vnd.juniper.nd.l2-connectivity-services+xml;version=1;charset=UTF-8 - URL https://172.68.52.10/api/juniper/nd/tenants/{tenant-id}/naas-services/
{naas-service-id}/l2-connectivity-services - Request parameters: name=”Client Subnet””, connectivityGroupID=”clientGroup”, subnet=”192.10.2.15/24”
- Response parameters: L2ConnectivityServiceID=”clientSubnet”
- Content type =
- Create an L3ConnectivityService resource to provide routing
among the Web tier, application tier, and client group VLAN subnets:
- Content type =
application/vnd.juniper.nd.l3-connectivity-services+xml;version=1;charset=UTF-8 - URL = https://172.68.52.10/api/juniper/nd/tenants/{tenant-id}/naas-services/
{naas-service-id}/l3-connectivity-services - Request parameters: name=”Multi Tier L3”, underlyings= { ”webTierSubnet”, “appTierSubnet”, “clientSubnet” }
- Response Parameters: L3ConnectivityServiceID=”multiTierL3”
- Content type =
Creating Security Policy and Security Policy Rule Resources
Step-by-Step Procedure
This section describes the steps for creating security policy and security policy rule resources for defining security rules for traffic sent to appTierGroup.
- Send a POST request to create a security policy resource:
- Content type =
application/vnd.juniper.nd.security-policies+xml;version=1;charset=UTF-8 - URL = https://172.68.52.10/api/juniper/nd/tenants/{tenantid}/naas-services/
{naas-service-id}/l3-connectivity-services/{l3-connectivity-service-id}/security-policies - Request parameters: name=”Http Only”, destinationGroupID= “appTierGroup”, defaultAction=”deny” }
- Response Parameters: SecurityPolicyID=”httpOnly”
- Content type =
- Create a security policy rule associated with the httpOnly security policy:
- Content type =
application/vnd.juniper.nd.security-policy-rules+xml;version=1;charset=UTF-8 - POST https://172.68.52.10/api/juniper/nd/tenants/{tenant-id}/naas-services/
{naas-service-id}/l3-connectivity-services/{l3-connectivity-service-id}/
security-policies/{security-policy-id}/security-policy-rules - Request parameters: name=”Allow Http”, condition=[“tcpPort”, “equals”, “http”], action=”allow”
- Response Parameters: SecurityPolicyRuleID=”allowHttp”
- Content type =
Activating the NaaS Services
Step-by-Step Procedure
This section describes the steps for activating NaaS services.
- Send a PUT request:
- Content type =
application/vnd.juniper.nd.naas-services+xml;version=1;charset=UTF-8 - PUT https://172.68.52.10/api/juniper/nd/tenants/{tenant-id}/naas-services/{naas-service-id}/
- Request parameters: naasServiceID=”multitierAppNetwork”
- Content type =
Verifying the NaaS Request
Verifying That the NaaS Request Is Activated
Purpose
Action
To verify that the NaaS services are activated:
- Send a GET request to see the current state of the NaaS
services:
- Content type =
application/vnd.juniper.nd.naas-services+xml;version=1;charset=UTF-8 - URL = https://172.68.52.10/api/juniper/nd/tenants/{tenant-id}/naas-services/
{naas-service-id}/ - Request parameters: naasServiceID=”multitierAppNetwork”
- Response parameters: current state
The current state of the NaaS services should be activated.
- Content type =


