Previous Topic: comp ObjectNext Topic: vol Object


iface Object

Use this object to manage interfaces on a application running on a VDC.

Method

Description

list

Retrieve a list of interfaces for a running application component

info

Retrieve information for a component interface

enable

Enable a terminal interface on a component

disable

Disable a terminal interface on a component

reset

Reset a terminal interface on a component

list Method (iface Object)
Description

Retrieve a list of component interfaces for a running application component.

Syntax
/api/v2/iface/list?app=application&comp=component&vdc=controller-name 
Arguments
app

Name of the application

comp

Name of the component

vdc

Name of the target virtual data center

Transaction Type

synchronous

Request Type

GET

Examples

Retrieve component interface for WS_API_r271:main.srv.

GET http://10.130.86.146/api/v1/iface/list?app=WS_API_r271&comp=main.api_srv&vdc=mygrid 
Sample Output
XML:

<component>
  <interfaces>
    <interface>
      <ip>0.0.0.0</ip>
      <mac>F2:69:03:00:22:01</mac>
      <name>db</name>
      <network>backbone</network>
      <state>idle</state>
      <type>output</type>
      <vlan_id>0</vlan_id>
    </interface>
    .
    .
    .
    <interface>
      <ip>1.24.34.3</ip>
      <mac>F2:69:03:00:22:02</mac>
      <name>fs</name>
      <network>backbone</network>
      <state>active</state>
      <type>output</type>
      <vlan_id>0</vlan_id>
    </interface>
  </interfaces>
  <name>main.api_srv</name>
</component>

JSON:
{
   "interface" : [
      {
         "network" : "backbone",
         "ip" : "0.0.0.0",
         "name" : "db",
         "type" : "output",
         "mac" : "F2:69:03:00:22:01",
         "state" : "idle",
         "vlan_id" : "0"
      },
      {
         "network" : "backbone",
         "ip" : "1.24.34.20",
         "name" : "default",
         "type" : "raw",
         "mac" : "F2:69:03:00:22:07",
         "state" : "active",
         "vlan_id" : "0"
      },
      .
      .
      .
      {
         "network" : "backbone",
         "ip" : "1.24.34.3",
         "name" : "fs",
         "type" : "output",
         "mac" : "F2:69:03:00:22:02",
         "state" : "active",
         "vlan_id" : "0"
      }
   ],
   "name" : "main.api_srv"
}
HTTP Error Codes
404

Entity vdc mygrid not found - A VDC name was specified that is not configured in the WS_API application.

400.4

Missing required arguments (app). - Argument app=app missing in the request.

400.4

Missing required arguments (comp). - Argument comp=comp missing in the request.

404.1

Failed to list interfaces for component test:main.srv - application test is not installed. - Invalid application specified in the request.

404.1

Failed to list interfaces for component test:main.srv - application test is not running. - Application specified in the request is in stopped state.

404.1

Failed to list interfaces for component test:main.srv - it is in 'stopped' state. - Component specified in the request is in stopped state.

404.1

Failed to list interfaces for component test:main.srv - it does not exist. - Invalid component specified in the request.

info Method (iface Object)
Description

Retrieve information for a component interface

Syntax
/api/v2/iface/info?app=application&comp=component&iface=interface&vdc=controller-name 
Arguments
app

Name of the application

comp

Name of the component

iface

Name of the interface

vdc

Name of the target virtual data center

Transaction Type

synchronous

Request Type

GET

Examples

Retrieve information for in terminal for WS_API_r271:main.srv.

GET
http://10.130.86.146/api/v1/iface/info?app=WS_API_r271&comp=main.api_srv&iface=in&vdc=mygrid
Sample Output
XML:

<interface>
  <connections>
    <connection>
      <loc_addr>F269030022000000</loc_addr>
      <loc_ip>1.24.34.11</loc_ip>
      <rem_addr>F2690300220E0000</rem_addr>
      <rem_ip>1.24.34.14</rem_ip>
      <type>None</type>
    </connection>
    <connection>
      <loc_addr>F269030022000000</loc_addr>
      <loc_ip>1.24.34.11</loc_ip>
      <rem_addr>F269030022150000</rem_addr>
      <rem_ip>1.24.34.10</rem_ip>
      <type>None</type>
    </connection>
  </connections>
  <device></device>
  <ip>1.24.34.11</ip>
  <mac>F2:69:03:00:22:00</mac>
  <name>in</name>
  <network>backbone</network>
  <state>active</state>
  <type>input</type>
  <vlan_id>0</vlan_id>
</interface>
JSON:
{
   "network" : "backbone",
   "connections" : [
      {
         "loc_ip" : "1.24.34.11",
         "rem_addr" : "F2690300220E0000",
         "rem_ip" : "1.24.34.14",
         "type" : "None",
         "loc_addr" : "F269030022000000"
      },
      {
         "loc_ip" : "1.24.34.11",
         "rem_addr" : "F269030022150000",
         "rem_ip" : "1.24.34.10",
         "type" : "None",
         "loc_addr" : "F269030022000000"
      }
   ],
   "ip" : "1.24.34.11",
   "name" : "in",
   "device" : "",
   "state" : "active",
   "vlan_id" : "0",
   "type" : "input",
   "mac" : "F2:69:03:00:22:00"
}

HTTP Error Codes
404

Entity vdc mygrid not found - A VDC name was specified that is not configured in the WS_API application.

400.4

Missing required arguments (app). - Argument app=app missing in the request.

400.4

Missing required arguments (comp). - Argument comp=comp missing in the request.

400.4

Missing required arguments (iface). - Argument iface=iface missing in the request.

404.1

Failed to display info for interface test:main.vpn.ctl - it does not exist. - Invalid interface, application or component specified in the request or application is in stopped state.

404.1

Failed to display info for interface test:main.srv - get info failed - see log for details. - Component specified in the request is not running.

enable Method (iface Object)
Description

Enable a terminal interface on a component

Syntax
/api/v2/iface/enable?app=application&comp=component&iface=interface&vdc=controller-name 
Arguments
app

Name of the application

comp

Name of the component

iface

Name of the interface

vdc

Name of the target virtual data center

Transaction Type

synchronous

Request Type

GET

Examples

Enable external interface for test:main.LUX5.

GET http://192.168.123.200/api/v2/iface/enable?app=test&comp=main.LUX5&iface=external&vdc=mygrid 
Sample Output
XML:
<message></message>
JSON:
{
   "message" :""
}

HTTP Error Codes
404

Entity vdc mygrid not found - A VDC name was specified that is not configured in the WS_API application.

400.4

Missing required arguments (app). - Argument app=app missing in the request.

400.4

Missing required arguments (comp). - Argument comp=comp missing in the request.

400.4

Missing required arguments (iface). - Argument iface=iface missing in the request.

404.1

Failed to enable interface test:main.srv.in because it doesn't exist. - Invalid interface, application or component specified in the request or application/component is not running.

disable Method (iface Object)
Description

Disable a terminal interface on a component

Syntax
/api/v2/iface/disable?app=application&comp=component&iface=interface&vdc=controller-name 
Arguments
app

Name of the application

comp

Name of the component

iface

Name of the interface

vdc

Name of the target virtual data center

Transaction Type

synchronous

Request Type

GET

Examples

Disable external interface for test:main.LUX5.

GET http://192.168.123.200/api/v2/iface/disable?app=test&comp=main.LUX5&iface=external&vdc=mygrid 
Sample Output
XML:
<message></message>
JSON:
{
   "message" :""
}

HTTP Error Codes
404

Entity vdc mygrid not found - A VDC name was specified that is not configured in the WS_API application.

400.4

Missing required arguments (app). - Argument app=app missing in the request.

400.4

Missing required arguments (comp). - Argument comp=comp missing in the request.

400.4

Missing required arguments (iface). - Argument iface=iface missing in the request.

404.1

Failed to enable interface test:main.srv.in because it doesn't exist. - Invalid interface, application or component specified in the request or application/component is not running.

reset Method (iface Object)
Description

Reset a terminal interface on a component

Syntax
/api/v2/iface/reset?app=application&comp=component&iface=interface&vdc=controller-name 
Arguments
app

Name of the application

comp

Name of the component

iface

Name of the interface

vdc

Name of the target virtual data center

Transaction Type

synchronous

Request Type

GET

Examples

Reset external interface for test:main.LUX5.

GET http://192.168.123.200/api/v2/iface/reset?app=test&comp=main.LUX5&iface=external&vdc=mygrid 
Sample Output
XML:
<message></message>
JSON:
{
   "message" :""
}

HTTP Error Codes
404

Entity vdc mygrid not found - A VDC name was specified that is not configured in the WS_API application.

400.4

Missing required arguments (app). - Argument app=app missing in the request.

400.4

Missing required arguments (comp). - Argument comp=comp missing in the request.

400.4

Missing required arguments (iface). - Argument iface=iface missing in the request.

404.1

Failed to enable interface test:main.srv.in because it doesn't exist. - Invalid interface, application or component specified in the request or application/component is not running.