示例#1
0
文件: PIF.java 项目: guzy/OnceCenter
 /** 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;
 }
示例#2
0
文件: Session.java 项目: magnayn/vcc
 /**
  * Authenticate locally against a slave in emergency mode. Note the resulting sessions are only
  * good for use on this host.
  *
  * @param uname Username for login.
  * @param pwd Password for login.
  * @return ID of newly created session
  */
 public static Session slaveLocalLoginWithPassword(Connection c, String uname, String pwd)
     throws BadServerResponse, XenAPIException, XmlRpcException {
   String method_call = "session.slave_local_login_with_password";
   Object[] method_params = {Marshalling.toXMLRPC(uname), Marshalling.toXMLRPC(pwd)};
   Map response = c.dispatch(method_call, method_params);
   Object result = response.get("Value");
   return Types.toSession(result);
 }
示例#3
0
 /**
  * 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);
 }
示例#4
0
文件: PIF.java 项目: guzy/OnceCenter
 /**
  * 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;
 }
示例#5
0
文件: Session.java 项目: magnayn/vcc
 /**
  * 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);
 }
示例#6
0
文件: PIF.java 项目: guzy/OnceCenter
 /** 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;
 }
示例#7
0
文件: PIF.java 项目: guzy/OnceCenter
 /**
  * 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);
 }
示例#8
0
文件: Session.java 项目: magnayn/vcc
 /** 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;
 }
示例#9
0
文件: PIF.java 项目: guzy/OnceCenter
 /**
  * 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);
 }
示例#10
0
文件: PIF.java 项目: guzy/OnceCenter
 /**
  * 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;
 }
示例#11
0
文件: PIF.java 项目: guzy/OnceCenter
 /**
  * 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);
 }
示例#12
0
文件: PIF.java 项目: guzy/OnceCenter
 /**
  * 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);
 }
示例#13
0
文件: PIF.java 项目: guzy/OnceCenter
 /**
  * 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);
 }
示例#14
0
文件: PIF.java 项目: guzy/OnceCenter
 /**
  * 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);
 }
示例#15
0
文件: PIF.java 项目: guzy/OnceCenter
 /**
  * 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);
 }
示例#16
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);
 }
示例#17
0
文件: PIF.java 项目: guzy/OnceCenter
 /**
  * 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;
 }
示例#18
0
文件: Session.java 项目: magnayn/vcc
 /**
  * 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;
 }
示例#19
0
文件: Session.java 项目: magnayn/vcc
 /**
  * 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;
 }
示例#20
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;
 }
示例#21
0
文件: PIF.java 项目: guzy/OnceCenter
 /**
  * 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);
 }
示例#22
0
文件: PIF.java 项目: guzy/OnceCenter
 /**
  * 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);
 }
示例#23
0
文件: PIF.java 项目: guzy/OnceCenter
 /**
  * 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);
 }
示例#24
0
文件: PIF.java 项目: guzy/OnceCenter
 /**
  * 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;
 }
 public void dispatch(T message) {
   delegate.dispatch(message);
 }