Previous Topic: iface ObjectNext Topic: enable Method (iface Object)


list Method (iface Object)
Description

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

Syntax
/api/v1/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 sugarcrm:main.srv1.

GET http://192.168.123.200/api/v1/iface/list?app=sugarcrm&comp=main.srv1&vdc=mygrid 
Sample Output
XML:
<component>
   <name>main.srv1</name>
   <interfaces>
       <interface>
         <name>aux</name>
          <ip>10.80.54.26</ip>
         <mac>F2:64:0A:00:36:22</mac>
          <state>idle</state>
         <type>output</type>
      </interface>
      <interface>
         <name>db</name>
         <ip>10.80.54.23</ip>
         <mac>F2:64:0A:00:36:1F</mac>
         <state>idle</state>
          <type>output</type>
      </interface>
      <interface>
          <name>default</name>
         <ip>10.80.54.43</ip>
          <mac>F2:64:0A:00:36:25</mac>
         <state>active</state>
          <type>raw</type>
      </interface>
      .
      . 
      .
   </interfaces>
</component> 
JSON:
{
   "interface" : 
      {
         "ip" : "10.80.54.26",
         "name" : "aux",
         "type" : "output",
         "mac" : "F2:64:0A:00:36:22",
         "state" : "idle"
      },
       {
         "ip" : "10.80.54.23",
         "name" : "db",
         "type" : "output",
         "mac" : "F2:64:0A:00:36:1F",
         "state" : "idle"
      },
       {
         "ip" : "10.80.54.43",
         "name" : "default",
         "type" : "raw",
         "mac" : "F2:64:0A:00:36:25",
         "state" : "active"
      },
      .
      .
      .
   ],
   "name" : "main.srv1"
} 

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/v1/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.