internal void UpdateFrom(Proxy_Host_patch proxy) { uuid = proxy.uuid == null ? null : proxy.uuid; name_label = proxy.name_label == null ? null : proxy.name_label; name_description = proxy.name_description == null ? null : proxy.name_description; version = proxy.version == null ? null : proxy.version; host = proxy.host == null ? null : XenRef <Host> .Create(proxy.host); applied = (bool)proxy.applied; timestamp_applied = proxy.timestamp_applied; size = proxy.size == null ? 0 : long.Parse(proxy.size); pool_patch = proxy.pool_patch == null ? null : XenRef <Pool_patch> .Create(proxy.pool_patch); other_config = proxy.other_config == null ? null : Maps.convert_from_proxy_string_string(proxy.other_config); }
public Proxy_Host_patch ToProxy() { Proxy_Host_patch result_ = new Proxy_Host_patch(); result_.uuid = uuid ?? ""; result_.name_label = name_label ?? ""; result_.name_description = name_description ?? ""; result_.version = version ?? ""; result_.host = host ?? ""; result_.applied = applied; result_.timestamp_applied = timestamp_applied; result_.size = size.ToString(); result_.pool_patch = pool_patch ?? ""; result_.other_config = Maps.convert_to_proxy_string_string(other_config); return(result_); }
public Proxy_Host_patch ToProxy() { Proxy_Host_patch result_ = new Proxy_Host_patch(); result_.uuid = (uuid != null) ? uuid : ""; result_.name_label = (name_label != null) ? name_label : ""; result_.name_description = (name_description != null) ? name_description : ""; result_.version = (version != null) ? version : ""; result_.host = (host != null) ? host : ""; result_.applied = applied; result_.timestamp_applied = timestamp_applied; result_.size = size.ToString(); result_.pool_patch = (pool_patch != null) ? pool_patch : ""; result_.other_config = Maps.convert_to_proxy_string_string(other_config); return(result_); }
public Response <string> apply(string session, string opaque_ref, string host_ref) { Proxy_Host_patch host_patch = new Proxy_Host_patch(); host_patch.applied = true; host_patch.host = host_ref; host_patch.name_label = "fake-patch"; host_patch.name_description = ""; host_patch.pool_patch = opaque_ref; host_patch.size = "0"; host_patch.timestamp_applied = DateTime.Now; host_patch.uuid = Guid.NewGuid().ToString(); host_patch.version = "1.0"; new fakeHost_Patch(proxy).create(session, host_patch); proxy.SendModObject("pool_patch", opaque_ref); proxy.SendModObject("host", host_ref); return(new Response <string>("")); }
/// <summary> /// Creates a new Host_patch from a Proxy_Host_patch. /// </summary> /// <param name="proxy"></param> public Host_patch(Proxy_Host_patch proxy) { UpdateFrom(proxy); }
/// <summary> /// Creates a new Host_patch from a Proxy_Host_patch. /// </summary> /// <param name="proxy"></param> public Host_patch(Proxy_Host_patch proxy) { this.UpdateFromProxy(proxy); }
public Response <string> create(string session, Proxy_Host_patch patch) { return(createObj("host_patch", patch)); }