Beispiel #1
0
 /** Attempt to bring down a physical interface */
 public void unplug(Connection c) throws BadServerResponse, XenAPIException, XmlRpcException {
   String method_call = "PIF.unplug";
   String session = c.getSessionReference();
   Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
   Map response = c.dispatch(method_call, method_params);
   return;
 }
 /**
  * Get the flags field of the given host_cpu.
  *
  * @return value of the field
  */
 public String getFlags(Connection c) throws BadServerResponse, XenAPIException, XmlRpcException {
   String method_call = "host_cpu.get_flags";
   String session = c.getSessionReference();
   Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
   Map response = c.dispatch(method_call, method_params);
   Object result = response.get("Value");
   return Types.toString(result);
 }
Beispiel #3
0
 /**
  * Scan for physical interfaces on a host and create PIF objects to represent them
  *
  * @param host The host on which to scan
  */
 public static void scan(Connection c, Host host)
     throws BadServerResponse, XenAPIException, XmlRpcException {
   String method_call = "PIF.scan";
   String session = c.getSessionReference();
   Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(host)};
   Map response = c.dispatch(method_call, method_params);
   return;
 }
Beispiel #4
0
 /** Log out of local session. */
 public static void localLogout(Connection c)
     throws BadServerResponse, XenAPIException, XmlRpcException {
   String method_call = "session.local_logout";
   String session = c.getSessionReference();
   Object[] method_params = {Marshalling.toXMLRPC(session)};
   Map response = c.dispatch(method_call, method_params);
   return;
 }
Beispiel #5
0
 /** Destroy the PIF object matching a particular network interface */
 public void forget(Connection c)
     throws BadServerResponse, XenAPIException, XmlRpcException, Types.PifTunnelStillExists {
   String method_call = "PIF.forget";
   String session = c.getSessionReference();
   Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
   Map response = c.dispatch(method_call, method_params);
   return;
 }
Beispiel #6
0
 /**
  * Attempt to bring down a physical interface
  *
  * @return Task
  */
 public Task unplugAsync(Connection c) throws BadServerResponse, XenAPIException, XmlRpcException {
   String method_call = "Async.PIF.unplug";
   String session = c.getSessionReference();
   Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
   Map response = c.dispatch(method_call, method_params);
   Object result = response.get("Value");
   return Types.toTask(result);
 }
Beispiel #7
0
 /**
  * Get the pool field of the given session.
  *
  * @return value of the field
  */
 public Boolean getPool(Connection c) throws BadServerResponse, XenAPIException, XmlRpcException {
   String method_call = "session.get_pool";
   String session = c.getSessionReference();
   Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
   Map response = c.dispatch(method_call, method_params);
   Object result = response.get("Value");
   return Types.toBoolean(result);
 }
Beispiel #8
0
 /**
  * Get the ip_configuration_mode field of the given PIF.
  *
  * @return value of the field
  */
 public Types.IpConfigurationMode getIpConfigurationMode(Connection c)
     throws BadServerResponse, XenAPIException, XmlRpcException {
   String method_call = "PIF.get_ip_configuration_mode";
   String session = c.getSessionReference();
   Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
   Map response = c.dispatch(method_call, method_params);
   Object result = response.get("Value");
   return Types.toIpConfigurationMode(result);
 }
Beispiel #9
0
 /**
  * Get a reference to the PIF instance with the specified UUID.
  *
  * @param uuid UUID of object to return
  * @return reference to the object
  */
 public static PIF getByUuid(Connection c, String uuid)
     throws BadServerResponse, XenAPIException, XmlRpcException {
   String method_call = "PIF.get_by_uuid";
   String session = c.getSessionReference();
   Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(uuid)};
   Map response = c.dispatch(method_call, method_params);
   Object result = response.get("Value");
   return Types.toPIF(result);
 }
Beispiel #10
0
 /**
  * Return a map of PIF references to PIF records for all PIFs known to the system.
  *
  * @return records of all objects
  */
 public static Map<PIF, PIF.Record> getAllRecords(Connection c)
     throws BadServerResponse, XenAPIException, XmlRpcException {
   String method_call = "PIF.get_all_records";
   String session = c.getSessionReference();
   Object[] method_params = {Marshalling.toXMLRPC(session)};
   Map response = c.dispatch(method_call, method_params);
   Object result = response.get("Value");
   return Types.toMapOfPIFPIFRecord(result);
 }
Beispiel #11
0
 /**
  * Get the other_config field of the given PIF.
  *
  * @return value of the field
  */
 public Map<String, String> getOtherConfig(Connection c)
     throws BadServerResponse, XenAPIException, XmlRpcException {
   String method_call = "PIF.get_other_config";
   String session = c.getSessionReference();
   Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
   Map response = c.dispatch(method_call, method_params);
   Object result = response.get("Value");
   return Types.toMapOfStringString(result);
 }
Beispiel #12
0
 /**
  * Get the VLAN_slave_of field of the given PIF.
  *
  * @return value of the field
  */
 public Set<VLAN> getVLANSlaveOf(Connection c)
     throws BadServerResponse, XenAPIException, XmlRpcException {
   String method_call = "PIF.get_VLAN_slave_of";
   String session = c.getSessionReference();
   Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
   Map response = c.dispatch(method_call, method_params);
   Object result = response.get("Value");
   return Types.toSetOfVLAN(result);
 }
Beispiel #13
0
 /**
  * Destroy the PIF object (provided it is a VLAN interface). This call is deprecated: use
  * VLAN.destroy or Bond.destroy instead
  *
  * @deprecated
  */
 @Deprecated
 public void destroy(Connection c)
     throws BadServerResponse, XenAPIException, XmlRpcException, Types.PifIsPhysical {
   String method_call = "PIF.destroy";
   String session = c.getSessionReference();
   Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
   Map response = c.dispatch(method_call, method_params);
   return;
 }
Beispiel #14
0
 /**
  * Get the tunnel_transport_PIF_of field of the given PIF.
  *
  * @return value of the field
  */
 public Set<Tunnel> getTunnelTransportPIFOf(Connection c)
     throws BadServerResponse, XenAPIException, XmlRpcException {
   String method_call = "PIF.get_tunnel_transport_PIF_of";
   String session = c.getSessionReference();
   Object[] method_params = {Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref)};
   Map response = c.dispatch(method_call, method_params);
   Object result = response.get("Value");
   return Types.toSetOfTunnel(result);
 }
Beispiel #15
0
 /**
  * Return a list of all the host_cpus known to the system.
  *
  * @deprecated
  * @return references to all objects
  */
 @Deprecated
 public static Set<HostCpu> getAll(Connection c)
     throws BadServerResponse, XenAPIException, XmlRpcException {
   String method_call = "host_cpu.get_all";
   String session = c.getSessionReference();
   Object[] method_params = {Marshalling.toXMLRPC(session)};
   Map response = c.dispatch(method_call, method_params);
   Object result = response.get("Value");
   return Types.toSetOfHostCpu(result);
 }
Beispiel #16
0
 /**
  * Change the account password; if your session is authenticated with root priviledges then the
  * old_pwd is validated and the new_pwd is set regardless
  *
  * @param oldPwd Old password for account
  * @param newPwd New password for account
  */
 public static void changePassword(Connection c, String oldPwd, String newPwd)
     throws BadServerResponse, XenAPIException, XmlRpcException {
   String method_call = "session.change_password";
   String session = c.getSessionReference();
   Object[] method_params = {
     Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(oldPwd), Marshalling.toXMLRPC(newPwd)
   };
   Map response = c.dispatch(method_call, method_params);
   return;
 }
Beispiel #17
0
 /**
  * Remove the given key and its corresponding value from the other_config field of the given PIF.
  * If the key is not in that Map, then do nothing.
  *
  * @param key Key to remove
  */
 public void removeFromOtherConfig(Connection c, String key)
     throws BadServerResponse, XenAPIException, XmlRpcException {
   String method_call = "PIF.remove_from_other_config";
   String session = c.getSessionReference();
   Object[] method_params = {
     Marshalling.toXMLRPC(session), Marshalling.toXMLRPC(this.ref), Marshalling.toXMLRPC(key)
   };
   Map response = c.dispatch(method_call, method_params);
   return;
 }
Beispiel #18
0
 /**
  * Set the other_config field of the given session.
  *
  * @param otherConfig New value to set
  */
 public void setOtherConfig(Connection c, Map<String, String> otherConfig)
     throws BadServerResponse, XenAPIException, XmlRpcException {
   String method_call = "session.set_other_config";
   String session = c.getSessionReference();
   Object[] method_params = {
     Marshalling.toXMLRPC(session),
     Marshalling.toXMLRPC(this.ref),
     Marshalling.toXMLRPC(otherConfig)
   };
   Map response = c.dispatch(method_call, method_params);
   return;
 }
Beispiel #19
0
 /**
  * Add the given key-value pair to the other_config field of the given host_cpu.
  *
  * @param key Key to add
  * @param value Value to add
  */
 public void addToOtherConfig(Connection c, String key, String value)
     throws BadServerResponse, XenAPIException, XmlRpcException {
   String method_call = "host_cpu.add_to_other_config";
   String session = c.getSessionReference();
   Object[] method_params = {
     Marshalling.toXMLRPC(session),
     Marshalling.toXMLRPC(this.ref),
     Marshalling.toXMLRPC(key),
     Marshalling.toXMLRPC(value)
   };
   Map response = c.dispatch(method_call, method_params);
   return;
 }
Beispiel #20
0
 /**
  * Create a PIF object matching a particular network interface
  *
  * @param host The host on which the interface exists
  * @param MAC The MAC address of the interface
  * @param device The device name to use for the interface
  * @return The reference of the created PIF object
  */
 public static PIF introduce(Connection c, Host host, String MAC, String device)
     throws BadServerResponse, XenAPIException, XmlRpcException {
   String method_call = "PIF.introduce";
   String session = c.getSessionReference();
   Object[] method_params = {
     Marshalling.toXMLRPC(session),
     Marshalling.toXMLRPC(host),
     Marshalling.toXMLRPC(MAC),
     Marshalling.toXMLRPC(device)
   };
   Map response = c.dispatch(method_call, method_params);
   Object result = response.get("Value");
   return Types.toPIF(result);
 }
Beispiel #21
0
 /**
  * Create a VLAN interface from an existing physical interface. This call is deprecated: use
  * VLAN.create instead
  *
  * @deprecated
  * @param device physical interface on which to create the VLAN interface
  * @param network network to which this interface should be connected
  * @param host physical machine to which this PIF is connected
  * @param VLAN VLAN tag for the new interface
  * @return The reference of the created PIF object
  */
 @Deprecated
 public static PIF createVLAN(Connection c, String device, Network network, Host host, Long VLAN)
     throws BadServerResponse, XenAPIException, XmlRpcException, Types.VlanTagInvalid {
   String method_call = "PIF.create_VLAN";
   String session = c.getSessionReference();
   Object[] method_params = {
     Marshalling.toXMLRPC(session),
     Marshalling.toXMLRPC(device),
     Marshalling.toXMLRPC(network),
     Marshalling.toXMLRPC(host),
     Marshalling.toXMLRPC(VLAN)
   };
   Map response = c.dispatch(method_call, method_params);
   Object result = response.get("Value");
   return Types.toPIF(result);
 }
Beispiel #22
0
 /**
  * Create a new PIF record in the database only
  *
  * @param device
  * @param network
  * @param host
  * @param MAC
  * @param MTU
  * @param VLAN
  * @param physical
  * @param ipConfigurationMode
  * @param IP
  * @param netmask
  * @param gateway
  * @param DNS
  * @param bondSlaveOf
  * @param VLANMasterOf
  * @param management
  * @param otherConfig
  * @param disallowUnplug
  * @return The ref of the newly created PIF record.
  */
 public static PIF dbIntroduce(
     Connection c,
     String device,
     Network network,
     Host host,
     String MAC,
     Long MTU,
     Long VLAN,
     Boolean physical,
     Types.IpConfigurationMode ipConfigurationMode,
     String IP,
     String netmask,
     String gateway,
     String DNS,
     Bond bondSlaveOf,
     VLAN VLANMasterOf,
     Boolean management,
     Map<String, String> otherConfig,
     Boolean disallowUnplug)
     throws BadServerResponse, XenAPIException, XmlRpcException {
   String method_call = "PIF.db_introduce";
   String session = c.getSessionReference();
   Object[] method_params = {
     Marshalling.toXMLRPC(session),
     Marshalling.toXMLRPC(device),
     Marshalling.toXMLRPC(network),
     Marshalling.toXMLRPC(host),
     Marshalling.toXMLRPC(MAC),
     Marshalling.toXMLRPC(MTU),
     Marshalling.toXMLRPC(VLAN),
     Marshalling.toXMLRPC(physical),
     Marshalling.toXMLRPC(ipConfigurationMode),
     Marshalling.toXMLRPC(IP),
     Marshalling.toXMLRPC(netmask),
     Marshalling.toXMLRPC(gateway),
     Marshalling.toXMLRPC(DNS),
     Marshalling.toXMLRPC(bondSlaveOf),
     Marshalling.toXMLRPC(VLANMasterOf),
     Marshalling.toXMLRPC(management),
     Marshalling.toXMLRPC(otherConfig),
     Marshalling.toXMLRPC(disallowUnplug)
   };
   Map response = c.dispatch(method_call, method_params);
   Object result = response.get("Value");
   return Types.toPIF(result);
 }
Beispiel #23
0
 /**
  * Reconfigure the IP address settings for this interface
  *
  * @param mode whether to use dynamic/static/no-assignment
  * @param IP the new IP address
  * @param netmask the new netmask
  * @param gateway the new gateway
  * @param DNS the new DNS settings
  */
 public void reconfigureIp(
     Connection c,
     Types.IpConfigurationMode mode,
     String IP,
     String netmask,
     String gateway,
     String DNS)
     throws BadServerResponse, XenAPIException, XmlRpcException {
   String method_call = "PIF.reconfigure_ip";
   String session = c.getSessionReference();
   Object[] method_params = {
     Marshalling.toXMLRPC(session),
     Marshalling.toXMLRPC(this.ref),
     Marshalling.toXMLRPC(mode),
     Marshalling.toXMLRPC(IP),
     Marshalling.toXMLRPC(netmask),
     Marshalling.toXMLRPC(gateway),
     Marshalling.toXMLRPC(DNS)
   };
   Map response = c.dispatch(method_call, method_params);
   return;
 }