Provider Edge Device Management RESTful Web Services
The following operations can be performed using the Connectivity Services Director Provider Edge (PE) Devices Management RESTful Web Services.
Get All PE Devices
This request is used to collect all the PE devices.
URI | api/space/nsas/device-roles/pe-devices |
HTTP Method | GET |
Consumes | application/vnd.net.juniper.space.device-roles. |
Produces | Retrieves all the PE devices that are managed and provisioned by the application. |
Output
Sample XML Output
<Data> <Devices size="11"> <Device href="/api/space/nsas/device-roles/pe-devices/1179927" uri="/api/space/nsas/device-roles/pe-devices/1179927" key="1179927"> <Common> <Name>junos-m10-1-space</Name> <Identity>1179927</Identity> </Common> <Role>N_PE</Role> <MEId>368542</MEId> </Device> <Device href="/api/space/nsas/device-roles/pe-devices/1179964" uri="/api/space/nsas/device-roles/pe-devices/1179964" key="1179964"> <Common> <Name>junos-m10-2-space</Name> <Identity>1179964</Identity> </Common> <Role>N_PE</Role> <MEId>368845</MEId> </Device> <Device href="/api/space/nsas/device-roles/pe-devices/1179891" uri="/api/space/nsas/device-roles/pe-devices/1179891" key="1179891"> <Common> <Name>junos-mx240-space</Name> <Identity>1179891</Identity> </Common> <Role>N_PE</Role> <MEId>368173</MEId> </Device> <Device href="/api/space/nsas/device-roles/pe-devices/1179663" uri="/api/space/nsas/device-roles/pe-devices/1179663" key="1179663"> <Common> <Name>junos-mx480-space</Name> <Identity>1179663</Identity> </Common> <Role>N_PE</Role> <MEId>360610</MEId> </Device> <Device href="/api/space/nsas/device-roles/pe-devices/1179752" uri="/api/space/nsas/device-roles/pe-devices/1179752" key="1179752"> <Common> <Name>junos-mx80-1-space</Name> <Identity>1179752</Identity> </Common> <Role>N_PE</Role> <MEId>361763</MEId> </Device> <Device href="/api/space/nsas/device-roles/pe-devices/1194778" uri="/api/space/nsas/device-roles/pe-devices/1194778" key="1194778"> <Common> <Name>junos-mx80-2-space</Name> <Identity>1194778</Identity> </Common> <Role>N_PE</Role> <MEId>374403</MEId> </Device> </Devices> </Data>
Get PE Devices By Device ID
This request is used to retrieve a PE device based on the device ID.
URI | api/space/nsas/device-roles/pe-devices/<pe-deviceID> |
HTTP Method | GET |
Consumes | application/vnd.net.juniper.space.device-roles. |
Produces | Retrieves the PE device based on the device ID. |
Output
Sample XML Output
<Data> <Devices> <Device href="/api/space/nsas/device-roles/pe-devices/21921857" uri="/api/space/nsas/device-roles/pe-devices/21921857" key="21921857"> <Common> <Name>exora</Name> <Identity>21921857</Identity> </Common> <ManagementAddress>10.216.114.114</ManagementAddress> <LoopBackAddress>50.1.2.3</LoopBackAddress> <EMSDeviceIdentifier>6455605</EMSDeviceIdentifier> <Role>N_PE</Role> <MEId>6761450</MEId> <Ports> <Port> <Name>at-0/2/0</Name> <Id>21921859</Id> <AdminStatus>up</AdminStatus> <Encapsulation>none</Encapsulation> <InterfaceIndex>520</InterfaceIndex> </Port> <Port> <Name>lt-1/2/0</Name> <Id>21921860</Id> <AdminStatus>up</AdminStatus> <Encapsulation>none</Encapsulation> <InterfaceIndex>527</InterfaceIndex> </Port> <Port> <Name>ge-1/3/0</Name> <Id>21921861</Id> <AdminStatus>down</AdminStatus> <Encapsulation>flexible-ethernet-services</Encapsulation> <InterfaceIndex>528</InterfaceIndex> </Port> </Ports> <TunnelNames> <RSVP> <LSPTunnelName>Bulk_LSP_Test01</LSPTunnelName> </RSVP> <Static> <LSPTunnelName>AutoMX6AutoMX4_exora_1</LSPTunnelName> <LSPTunnelName>exora-to-jaipur</LSPTunnelName> <LSPTunnelName>exora-to-embassy</LSPTunnelName> <LSPTunnelName>exora-to-kochin</LSPTunnelName> <LSPTunnelName>TestBulkLSPAudit_to_50_1_2_4</LSPTunnelName> <LSPTunnelName>RSVP_LSP_Test01_to_30_1_2_7</LSPTunnelName> <LSPTunnelName>Bulk_LSP_Test01_to_50_1_2_1</LSPTunnelName> <LSPTunnelName>Test_to_50_1_2_1</LSPTunnelName> <LSPTunnelName>Test_000_bulk_1_to_50_1_2_1</LSPTunnelName> </Static> <NonStatic> <LSPTunnelName>exora-to-jaipur</LSPTunnelName> <LSPTunnelName>exora-to-embassy</LSPTunnelName> <LSPTunnelName>exora-to-kochin</LSPTunnelName> <LSPTunnelName>TestBulkLSPAudit_to_50_1_2_4</LSPTunnelName> <LSPTunnelName>RSVP_LSP_Test01_to_30_1_2_7</LSPTunnelName> <LSPTunnelName>Bulk_LSP_Test01_to_50_1_2_1</LSPTunnelName> <LSPTunnelName>Test_to_50_1_2_1</LSPTunnelName> <LSPTunnelName>Test_000_bulk_1_to_50_1_2_1</LSPTunnelName> </NonStatic> </TunnelNames> </Device> </Devices> </Data>
Get All Devices with Pagination, Search, and Filter
This request is used to collect all the device details with paging behavior applied on the output, and with the devices sorted and segregated depending on the search criteria.
URI | api/space/nsas/device-roles/pe- |
HTTP Method | GET |
Consumes | application/vnd.net.juniper.space.device-roles. |
Produces | Retrieves the filtered list of devices with pagination, based on the search criteria |
If you enter “paging=(starteq 2, limit eq 3)”, which is not a single integer value, the display is according to index of records. In this case, it shows from the first indexed record to the third indexed record. If you enter "start=2&limit=3", it starts from the second record and displays the next three records in all.
Output
Sample XML Output
<Data> <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <Data xmlns="services.schema.networkapi.jmp.juniper.net"> <Devices size="6"> <Device key="557213" uri="/api/space/nsas/device-roles/pe-devices/557213" href="/api/space/nsas/device-roles/pe-devices/557213"> <Common> <Name>junos-space5</Name> <Identity>557213</Identity> </Common> <Role>N_PE</Role> <MEId>329152</MEId> </Device> <Device key="557236" uri="/api/space/nsas/device-roles/pe-devices/557236" href="/api/space/nsas/device-roles/pe-devices/557236"> <Common> <Name>junos-space3</Name> <Identity>557236</Identity> </Common> <Role>N_PE</Role> <MEId>329267</MEId> </Device> <Device key="557194" uri="/api/space/nsas/device-roles/pe-devices/557194" href="/api/space/nsas/device-roles/pe-devices/557194"> <Common> <Name>junos-space1</Name> <Identity>557194</Identity> </Common> <Role>N_PE</Role> <MEId>328355</MEId> </Device> <Device key="557142" uri="/api/space/nsas/device-roles/pe-devices/557142" href="/api/space/nsas/device-roles/pe-devices/557142"> <Common> <Name>junos-mx80-1-space</Name> <Identity>557142</Identity> </Common> <Role>N_PE</Role> <MEId>328182</MEId> </Device> <Device key="557069" uri="/api/space/nsas/device-roles/pe-devices/557069" href="/api/space/nsas/device-roles/pe-devices/557069"> <Common> <Name>junos-mx480-space</Name> <Identity>557069</Identity> </Common> <Role>N_PE</Role> <MEId>327736</MEId> </Device> <Device key="4390916" uri="/api/space/nsas/device-roles/pe-devices/4390916" href="/api/space/nsas/device-roles/pe-devices/4390916"> <Common> <Name>junos-mx240-space</Name> <Identity>4390916</Identity> </Common> <Role>N_PE</Role> <MEId>4030920</MEId> </Device> </Devices> </Data>
Clear Interface Statistics
This request is used to clear the statistical information collected for the interfaces.
New Parameters | api/space/nsas/clear-interface-statistics |
Description of the Changes | This API clears interface statistics of an interface. |
URI | api/space/nsas/clear-interface-statistics |
HTTP Method | POST |
Consumes | application/vnd.juniper.api.space.nsas.clear-interface- |
Content Type | application/vnd.juniper.api.space.nsas.clear-interface- application/vnd.juniper.api.space.nsas.clear-interface- |
Produces | Clears the statistics of interfaces. |
Input
Sample XML Input
<clear-interface-statistics-request> <reply-format>String</reply-format> <clear-device>Boolean</clear-device> <device-details> <device-details> <device-name>String</device-name> <interfaces total=""Integer""> <interface>String</interface> </interfaces> <device-id>String</device-id> </device-details> </device-details> <service-name>String</service-name> </clear-interface-statistics-request>
Output
Sample XML Output
<clear-interface-statistics-response uri=""/api/space/nsas/clear-interface-statistics""> <error-message>String</error-message> <reply-format>String</reply-format> <interface-name>String</interface-name> <domain-id>Integer</domain-id> <reply-status>OK</reply-status> <domain-name>String</domain-name> <service-type>String</service-type> <service-name>String</service-name> </clear-interface-statistics-response>"
Perform an MPLS Ping for E-Line, IP, and E-LAN Services
This request is used to perform an MPLS ping operation for E-Line, IP, and E-LAN services.
New Parameters | /api/space/nsas/perform-mpls-ping |
Description of the Changes | This API is used to perform an MPLS ping process. |
URI | /api/space/nsas/perform-mpls-ping |
HTTP Method | POST |
Consumes | application/vnd.juniper.api.space.nsas.perform-mpls-ping- application/vnd.juniper.api.space.nsas.perform-mpls-ping- |
Content Type | application/vnd.juniper.api.space.nsas.perform-mpls-ping- application/vnd.juniper.api.space.nsas.perform-mpls-ping- |
Produces | Performs an MPLS ping operation for E-Line, IP, and E-LAN services. |
Input
Sample XML Input
<perform-mpls-ping-request> <reply-format>String</reply-format> <forwarding-class>Integer</forwarding-class> <ping-size>Integer</ping-size> <reply-mode>String</reply-mode> <destination-device-name>String</destination-device-name> <ping-count>Integer</ping-count> <src-device-name>String</src-device-name> <sweep>Boolean</sweep> <service-name>String</service-name> </perform-mpls-ping-request>
Output
Sample XML Output
<perform-mpls-ping-response uri=""/api/space/nsas/perform-mpls-ping""> <error-message>String</error-message> <reply-format>String</reply-format> <domain-id>Integer</domain-id> <reply-status>OK</reply-status> <domain-name>String</domain-name> <service-type>String</service-type> <ping-reply>String</ping-reply> <service-name>String</service-name> </perform-mpls-ping-response>"
Perform an MPLS Ping for LSPs
This request is used to perform an MPLS ping operation for LSPs.
New Parameters | /api/space/nsas/tunnels/perform-mpls-ping |
Description of the Changes | This API is used to perform an MPLS ping process. |
URI | /api/space/nsas/tunnels/perform-mpls-ping |
HTTP Method | POST |
Consumes | application/vnd.juniper.api.space.nsas.perform-mpls-ping- application/vnd.juniper.api.space.nsas.perform-mpls-ping- |
Content Type | application/vnd.juniper.api.space.nsas.perform-mpls-ping- application/vnd.juniper.api.space.nsas.perform-mpls-ping- |
Produces | Performs an MPLS ping operation for LSPs. |
Input
Sample XML Input
<perform-mpls-ping-request> <reply-format>String</reply-format> <forwarding-class>Integer</forwarding-class> <ping-size>Integer</ping-size> <reply-mode>String</reply-mode> <destination-device-name>String</destination-device-name> <ping-count>Integer</ping-count> <src-device-name>String</src-device-name> <sweep>Boolean</sweep> <service-name>String</service-name> </perform-mpls-ping-request>
Output
Sample XML Output
<perform-mpls-ping-response uri=""/api/space/nsas/tunnels/perform-mpls-ping""> <error-message>String</error-message> <reply-format>String</reply-format> <domain-id>Integer</domain-id> <reply-status>OK</reply-status> <domain-name>String</domain-name> <service-type>String</service-type> <ping-reply>String</ping-reply> <service-name>String</service-name> </perform-mpls-ping-response>"
Get All Saved Configlets for a Device
This request is used to retrieve all the saved configlets for a particular device selected in Device view.
URI | /api/space/nsas/cli-configlet-saved/device/ |
HTTP Method | GET |
Consumes | application/vnd.net.juniper.space.cli- |
Produces | Retrieves all the saved configlets for a particular device selected in Device view. |
Input
Sample XML Input
/api/space/nsas/cli-configlet-saved/device/12
Output
Sample XML Output
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <Data xmlns="services.schema.networkapi.jmp.juniper.net"> <CliConfigletsApplied size="2"> <CliConfigletApplied id="1"> <CliTemplateId>1</CliTemplateId> <CliConfigletName>Example 1</CliConfigletName> <Version></Version> <PageNumber>1</PageNumber> <ConfigText>configtext</ConfigText> <DeviceId>12</DeviceId> <ContextString>//device[name="QSD1re"]/interface-
information/physical-interface[name="
"mt-0/0/10"]</ContextString> <ValidtionJobId>0</ValidtionJobId> <ApplyJobId>524290</ApplyJobId> <ValidatedDate>2020-03-02T22:42:05.000+05:30</ValidatedDate> <AppliedDate>2020-03-02T22:42:05.000+05:30</AppliedDate> <ConfigletParameters> <ConfigletParameter> <Variable>INTERFACE</Variable> <DefaultValue>mt-0/0/10</DefaultValue> <ParameterId>0</ParameterId> </ConfigletParameter> <ConfigletParameter> <Variable>INTERFACE</Variable> <DefaultValue>mt-0/0/10</DefaultValue> <ParameterId>0</ParameterId> </ConfigletParameter> <ConfigletParameter> <Variable>DESCRIPTION</Variable> <DefaultValue>test1</DefaultValue> <ParameterId>1</ParameterId> </ConfigletParameter> <ConfigletParameters> </CliConfigletApplied> <CliConfigletApplied id="2"> <CliTemplateId>2</CliTemplateId> <CliConfigletName>Example 2</CliConfigletName> <Version></Version> <PageNumber>1</PageNumber> <ConfigText>configtext</ConfigText> <DeviceId>12<DeviceId> <ContextString>/device [name="QSD1re"]/configuration/interfaces/interface/unit<ContextString> <ValidtionJobId>0</ValidtionJobId> <ApplyJobId>524293</ApplyJobId> <ValidatedDate>020-03-02T22:46:29.000+05:30</ValidatedDate> <AppliedDate>2020-03-02T22:46:29.000+05:30</AppliedDate> <ConfigletParameters> <ConfigletParameter> <Variable>UNIT</Variable> <DefaultValue>0</DefaultValue> <ParameterId>0<ParameterId> </ConfigletParameter> <ConfigletParameter> <Variable>INTERFACE</Variable> <DefaultValue>ge-0/0/0.0</DefaultValue> <ParameterId>0<ParameterId> </ConfigletParameter> <ConfigletParameter> <Variable>DESCRIPTION</Variable> <DefaultValue>test2</DefaultValue> <ParameterId>2<ParameterId> </ConfigletParameter> </ConfigletParameters> </CliConfigletApplied> </CliConfigletApplied> </Data>
Save Configlets
This request is used to save all the configlets.
URI | /api/space/nsas/cli-configlet-saved/ |
HTTP Method | POST |
Consumes | application/vnd.net.juniper.space.cli-configlet- |
Content Type | application/vnd.net.juniper.space.cli-configlet- |
Produces | Save configlets |
Input
Sample XML Input
<Data xmlns="services.schema.networkapi.jmp.juniper.net"> <CliConfigletsApplied> <CliConfigletApplied> <CliTemplateId>2</CliTemplateId> <CliConfigletName>Example 2</CliConfigletName> <Version></Version> <PageNumber>1</PageNumber> <DeviceId>8</DeviceId> <ContextString>/device [name="QPD1re"]/configuration/interfaces/interface/unit</ContextString> <ConfigText>configtext</ConfigText> <Action>Save-Only</Action> <ValidtionJobId>0</ValidtionJobId> <ApplyJobId>0</ApplyJobId> <ConfigletParameters> <ConfigletParameter> <Variable>UNIT</Variable> <DefaultValue>0</DefaultValue> </ConfigletParameter> <ConfigletParameter> <Variable>INTERFACE</Variable> <DefaultValue>ge-0/0/0.0</DefaultValue> </ConfigletParameter> <ConfigletParameter> <Variable>DESCRIPTION</Variable> <DefaultValue>test1</DefaultValue> <ParameterId>2</ParameterId> <DispalyName>DESCRIPTION</DispalyName> </ConfigletParameter> </ConfigletParameters> </CliConfigletApplied> <CliConfigletsApplied> </Data>
Apply Configlets
This request is used to apply all the configlets.
URI | /api/space/configuration-management |
HTTP Method | POST |
Content Type | application/vnd.net.juniper.space.configuration- |
Accept | application/vnd.net.juniper.space.job- |
Input
Sample XML Input
<cli-configlet-mgmt> <DeviceId>8</DeviceId> <cli-configlet-param> <parameter>UNIT</parameter> <param-value>0</param-value> </cli-configlet-param> <cli-configlet-param> <parameter>INTERFACE</parameter> <param-value>ge-0/0/0.0</param-value> </cli-configlet-param> <cli-configlet-param> <parameter>DESCRIPTION</parameter> <param-value>test1</param-value> </cli-configlet-param> </cli-configlet-mgmt>