mirror of
https://github.com/xcp-ng/xenadmin.git
synced 2025-01-20 15:29:26 +01:00
New API class for certificates.
Signed-off-by: Konstantina Chremmou <konstantina.chremmou@citrix.com>
This commit is contained in:
parent
2b3884fa72
commit
ec1b45cd56
@ -100,6 +100,7 @@ namespace XenAdmin.Network
|
||||
private readonly ChangeableDictionary<XenRef<VMSS>, VMSS> _vmss = new ChangeableDictionary<XenRef<VMSS>, VMSS>();
|
||||
private readonly ChangeableDictionary<XenRef<VM_appliance>, VM_appliance> _vm_appliance = new ChangeableDictionary<XenRef<VM_appliance>, VM_appliance>();
|
||||
private readonly ChangeableDictionary<XenRef<Crashdump>, Crashdump> _crashdump = new ChangeableDictionary<XenRef<Crashdump>, Crashdump>();
|
||||
private readonly ChangeableDictionary<XenRef<Certificate>, Certificate> _certificates = new ChangeableDictionary<XenRef<Certificate>, Certificate>();
|
||||
|
||||
#pragma warning restore 0414
|
||||
|
||||
@ -117,205 +118,87 @@ namespace XenAdmin.Network
|
||||
}
|
||||
}
|
||||
|
||||
public Certificate[] Certificates => contents(_certificates);
|
||||
|
||||
public Bond[] Bonds
|
||||
{
|
||||
get { return contents(_bond); }
|
||||
}
|
||||
public Bond[] Bonds => contents(_bond);
|
||||
|
||||
public VMSS[] VMSSs
|
||||
{
|
||||
get { return contents(_vmss); }
|
||||
}
|
||||
public VMSS[] VMSSs => contents(_vmss);
|
||||
|
||||
public VM_appliance[] VM_appliances
|
||||
{
|
||||
get { return contents(_vm_appliance); }
|
||||
}
|
||||
public VM_appliance[] VM_appliances => contents(_vm_appliance);
|
||||
|
||||
public Cluster[] Clusters
|
||||
{
|
||||
get { return contents(_cluster); }
|
||||
}
|
||||
public Cluster[] Clusters => contents(_cluster);
|
||||
|
||||
public Cluster_host[] Cluster_hosts
|
||||
{
|
||||
get { return contents(_cluster_host); }
|
||||
}
|
||||
public Cluster_host[] Cluster_hosts => contents(_cluster_host);
|
||||
|
||||
public Feature[] Features
|
||||
{
|
||||
get { return contents(_feature); }
|
||||
}
|
||||
public Feature[] Features => contents(_feature);
|
||||
|
||||
public Folder[] Folders
|
||||
{
|
||||
get { return contents(_folders); }
|
||||
}
|
||||
public Folder[] Folders => contents(_folders);
|
||||
|
||||
public DockerContainer[] DockerContainers
|
||||
{
|
||||
get { return contents(_dockerContainers); }
|
||||
}
|
||||
public DockerContainer[] DockerContainers => contents(_dockerContainers);
|
||||
|
||||
public GPU_group[] GPU_groups
|
||||
{
|
||||
get { return contents(_gpu_groups); }
|
||||
}
|
||||
|
||||
public Host[] Hosts
|
||||
{
|
||||
get { return contents(_host); }
|
||||
}
|
||||
public GPU_group[] GPU_groups => contents(_gpu_groups);
|
||||
|
||||
public int HostCount
|
||||
{
|
||||
get { return _host.Count; }
|
||||
}
|
||||
public Host[] Hosts => contents(_host);
|
||||
|
||||
public Host_cpu[] Host_cpus
|
||||
{
|
||||
get { return contents(_host_cpu); }
|
||||
}
|
||||
public int HostCount => _host.Count;
|
||||
|
||||
public XenAPI.Message[] Messages
|
||||
{
|
||||
get { return contents(_message); }
|
||||
}
|
||||
public Host_cpu[] Host_cpus => contents(_host_cpu);
|
||||
|
||||
public XenAPI.Network[] Networks
|
||||
{
|
||||
get { return contents(_network); }
|
||||
}
|
||||
public Message[] Messages => contents(_message);
|
||||
|
||||
public XenAPI.Network_sriov[] Network_sriov
|
||||
{
|
||||
get { return contents(_network_sriov); }
|
||||
}
|
||||
public XenAPI.Network[] Networks => contents(_network);
|
||||
|
||||
public PBD[] PBDs
|
||||
{
|
||||
get { return contents(_pbd); }
|
||||
}
|
||||
public Network_sriov[] Network_sriov => contents(_network_sriov);
|
||||
|
||||
public PUSB[] PUSBs
|
||||
{
|
||||
get { return contents(_pusb); }
|
||||
}
|
||||
public PBD[] PBDs => contents(_pbd);
|
||||
|
||||
public VUSB[] VUSBs
|
||||
{
|
||||
get { return contents(_vusb); }
|
||||
}
|
||||
public PUSB[] PUSBs => contents(_pusb);
|
||||
|
||||
public USB_group[] USB_groups
|
||||
{
|
||||
get { return contents(_usb_group); }
|
||||
}
|
||||
public VUSB[] VUSBs => contents(_vusb);
|
||||
|
||||
public PCI[] PCIs
|
||||
{
|
||||
get { return contents(_pcis); }
|
||||
}
|
||||
public USB_group[] USB_groups => contents(_usb_group);
|
||||
|
||||
public PGPU[] PGPUs
|
||||
{
|
||||
get { return contents(_pgpu); }
|
||||
}
|
||||
public PCI[] PCIs => contents(_pcis);
|
||||
|
||||
public PIF[] PIFs
|
||||
{
|
||||
get { return contents(_pif); }
|
||||
}
|
||||
public PGPU[] PGPUs => contents(_pgpu);
|
||||
|
||||
public Pool[] Pools
|
||||
{
|
||||
get { return contents(_pool); }
|
||||
}
|
||||
public PIF[] PIFs => contents(_pif);
|
||||
|
||||
public Pool_patch[] Pool_patches
|
||||
{
|
||||
get { return contents(_pool_patch); }
|
||||
}
|
||||
public Pool[] Pools => contents(_pool);
|
||||
|
||||
public Pool_update[] Pool_updates
|
||||
{
|
||||
get { return contents(_pool_update); }
|
||||
}
|
||||
|
||||
public PVS_site[] PVS_sites
|
||||
{
|
||||
get { return contents(_pvs_site); }
|
||||
}
|
||||
|
||||
public PVS_server[] PVS_servers
|
||||
{
|
||||
get { return contents(_pvs_server); }
|
||||
}
|
||||
public Pool_patch[] Pool_patches => contents(_pool_patch);
|
||||
|
||||
public PVS_proxy[] PVS_proxies
|
||||
{
|
||||
get { return contents(_pvs_proxy); }
|
||||
}
|
||||
public Pool_update[] Pool_updates => contents(_pool_update);
|
||||
|
||||
public PVS_cache_storage[] PVS_cache_storages
|
||||
{
|
||||
get { return contents(_pvs_cache_storage); }
|
||||
}
|
||||
|
||||
public Role[] Roles
|
||||
{
|
||||
get { return contents(_role); }
|
||||
}
|
||||
public PVS_site[] PVS_sites => contents(_pvs_site);
|
||||
|
||||
public SM[] SMs
|
||||
{
|
||||
get { return contents(_sm); }
|
||||
}
|
||||
public PVS_server[] PVS_servers => contents(_pvs_server);
|
||||
|
||||
public SR[] SRs
|
||||
{
|
||||
get { return contents(_sr); }
|
||||
}
|
||||
public PVS_proxy[] PVS_proxies => contents(_pvs_proxy);
|
||||
|
||||
public Subject[] Subjects
|
||||
{
|
||||
get { return contents(_subject); }
|
||||
}
|
||||
public PVS_cache_storage[] PVS_cache_storages => contents(_pvs_cache_storage);
|
||||
|
||||
public Tunnel[] Tunnels
|
||||
{
|
||||
get { return contents(_tunnel); }
|
||||
}
|
||||
public Role[] Roles => contents(_role);
|
||||
|
||||
public VBD[] VBDs
|
||||
{
|
||||
get { return contents(_vbd); }
|
||||
}
|
||||
public SM[] SMs => contents(_sm);
|
||||
|
||||
public VDI[] VDIs
|
||||
{
|
||||
get { return contents(_vdi); }
|
||||
}
|
||||
public SR[] SRs => contents(_sr);
|
||||
|
||||
public VGPU[] VGPUs
|
||||
{
|
||||
get { return contents(_vgpu); }
|
||||
}
|
||||
public Subject[] Subjects => contents(_subject);
|
||||
|
||||
public VGPU_type[] VGPU_types
|
||||
{
|
||||
get { return contents(_vgpu_types); } }
|
||||
public Tunnel[] Tunnels => contents(_tunnel);
|
||||
|
||||
public VIF[] VIFs
|
||||
{
|
||||
get { return contents(_vif); }
|
||||
}
|
||||
public VBD[] VBDs => contents(_vbd);
|
||||
|
||||
public VM[] VMs
|
||||
{
|
||||
get { return contents(_vm); }
|
||||
}
|
||||
public VDI[] VDIs => contents(_vdi);
|
||||
|
||||
public VGPU[] VGPUs => contents(_vgpu);
|
||||
|
||||
public VGPU_type[] VGPU_types => contents(_vgpu_types);
|
||||
|
||||
public VIF[] VIFs => contents(_vif);
|
||||
|
||||
public VM[] VMs => contents(_vm);
|
||||
|
||||
|
||||
private static T[] contents<T>(ChangeableDictionary<XenRef<T>, T> d) where T : XenObject<T>
|
||||
|
@ -40,16 +40,14 @@ namespace XenAdmin.Network
|
||||
public interface ICache
|
||||
{
|
||||
Bond[] Bonds { get; }
|
||||
void CheckFoldersBatchChange();
|
||||
void Clear();
|
||||
void DeregisterBatchCollectionChanged<T>(EventHandler h) where T : XenObject<T>;
|
||||
void DeregisterCollectionChanged<T>(CollectionChangeEventHandler h) where T : XenObject<T>;
|
||||
T Find_By_Uuid<T>(string uuid) where T : XenObject<T>;
|
||||
XenRef<T> FindRef<T>(T needle) where T : XenObject<T>;
|
||||
Certificate[] Certificates { get; }
|
||||
Cluster[] Clusters { get; }
|
||||
Cluster_host[] Cluster_hosts { get; }
|
||||
DockerContainer[] DockerContainers { get; }
|
||||
Feature[] Features { get; }
|
||||
Folder[] Folders { get; }
|
||||
GPU_group[] GPU_groups { get; }
|
||||
Host_cpu[] Host_cpus { get; }
|
||||
int HostCount { get; }
|
||||
Host[] Hosts { get; }
|
||||
Message[] Messages { get; }
|
||||
XenAPI.Network[] Networks { get; }
|
||||
@ -60,37 +58,41 @@ namespace XenAdmin.Network
|
||||
Pool_patch[] Pool_patches { get; }
|
||||
Pool_update[] Pool_updates { get; }
|
||||
Pool[] Pools { get; }
|
||||
void AddFolder(XenRef<Folder> path, Folder folder);
|
||||
void RemoveFolder(XenRef<Folder> path);
|
||||
void AddAll<T>(List<T> l, Predicate<T> p) where T : XenObject<T>;
|
||||
void RegisterBatchCollectionChanged<T>(EventHandler h) where T : XenObject<T>;
|
||||
void RegisterCollectionChanged<T>(CollectionChangeEventHandler h) where T : XenObject<T>;
|
||||
T Resolve<T>(XenRef<T> xenRef) where T : XenObject<T>;
|
||||
PVS_site[] PVS_sites { get; }
|
||||
PVS_server[] PVS_servers { get; }
|
||||
PVS_proxy[] PVS_proxies { get; }
|
||||
PVS_cache_storage[] PVS_cache_storages { get; }
|
||||
Role[] Roles { get; }
|
||||
SM[] SMs { get; }
|
||||
SR[] SRs { get; }
|
||||
Subject[] Subjects { get; }
|
||||
bool TryResolve<T>(XenRef<T> xenRef, out T result) where T : XenObject<T>;
|
||||
Tunnel[] Tunnels { get; }
|
||||
bool UpdateFrom(IXenConnection connection, IList<ObjectChange> changes);
|
||||
VBD[] VBDs { get; }
|
||||
VDI[] VDIs { get; }
|
||||
VGPU[] VGPUs { get; }
|
||||
VGPU_type[] VGPU_types { get; }
|
||||
VIF[] VIFs { get; }
|
||||
VMSS[] VMSSs { get; }
|
||||
VM_appliance[] VM_appliances { get; }
|
||||
VM[] VMs { get; }
|
||||
VM_appliance[] VM_appliances { get; }
|
||||
VMSS[] VMSSs { get; }
|
||||
|
||||
int HostCount { get; }
|
||||
IEnumerable<IXenObject> XenSearchableObjects { get; }
|
||||
DockerContainer[] DockerContainers { get; }
|
||||
PVS_site[] PVS_sites { get; }
|
||||
PVS_server[] PVS_servers { get; }
|
||||
PVS_proxy[] PVS_proxies { get; }
|
||||
PVS_cache_storage[] PVS_cache_storages { get; }
|
||||
void AddAll<T>(List<T> l, Predicate<T> p) where T : XenObject<T>;
|
||||
T Find_By_Uuid<T>(string uuid) where T : XenObject<T>;
|
||||
XenRef<T> FindRef<T>(T needle) where T : XenObject<T>;
|
||||
T Resolve<T>(XenRef<T> xenRef) where T : XenObject<T>;
|
||||
bool TryResolve<T>(XenRef<T> xenRef, out T result) where T : XenObject<T>;
|
||||
void Clear();
|
||||
bool UpdateFrom(IXenConnection connection, IList<ObjectChange> changes);
|
||||
void UpdateDockerContainersForVM(IList<DockerContainer> d, VM v);
|
||||
void AddFolder(XenRef<Folder> path, Folder folder);
|
||||
void RemoveFolder(XenRef<Folder> path);
|
||||
void CheckFoldersBatchChange();
|
||||
void RegisterBatchCollectionChanged<T>(EventHandler h) where T : XenObject<T>;
|
||||
void DeregisterBatchCollectionChanged<T>(EventHandler h) where T : XenObject<T>;
|
||||
void RegisterCollectionChanged<T>(CollectionChangeEventHandler h) where T : XenObject<T>;
|
||||
void DeregisterCollectionChanged<T>(CollectionChangeEventHandler h) where T : XenObject<T>;
|
||||
void CheckDockerContainersBatchChange();
|
||||
Cluster[] Clusters { get; }
|
||||
Cluster_host[] Cluster_hosts { get; }
|
||||
Feature[] Features { get; }
|
||||
}
|
||||
}
|
||||
|
390
XenModel/XenAPI/Certificate.cs
Normal file
390
XenModel/XenAPI/Certificate.cs
Normal file
@ -0,0 +1,390 @@
|
||||
/*
|
||||
* Copyright (c) Citrix Systems, Inc.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1) Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
*
|
||||
* 2) Redistributions in binary form must reproduce the above
|
||||
* copyright notice, this list of conditions and the following
|
||||
* disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
* OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Globalization;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
namespace XenAPI
|
||||
{
|
||||
/// <summary>
|
||||
/// Description
|
||||
/// First published in Unreleased.
|
||||
/// </summary>
|
||||
public partial class Certificate : XenObject<Certificate>
|
||||
{
|
||||
#region Constructors
|
||||
|
||||
public Certificate()
|
||||
{
|
||||
}
|
||||
|
||||
public Certificate(string uuid,
|
||||
XenRef<Host> host,
|
||||
DateTime not_before,
|
||||
DateTime not_after,
|
||||
string fingerprint)
|
||||
{
|
||||
this.uuid = uuid;
|
||||
this.host = host;
|
||||
this.not_before = not_before;
|
||||
this.not_after = not_after;
|
||||
this.fingerprint = fingerprint;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new Certificate from a Hashtable.
|
||||
/// Note that the fields not contained in the Hashtable
|
||||
/// will be created with their default values.
|
||||
/// </summary>
|
||||
/// <param name="table"></param>
|
||||
public Certificate(Hashtable table)
|
||||
: this()
|
||||
{
|
||||
UpdateFrom(table);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new Certificate from a Proxy_Certificate.
|
||||
/// </summary>
|
||||
/// <param name="proxy"></param>
|
||||
public Certificate(Proxy_Certificate proxy)
|
||||
{
|
||||
UpdateFrom(proxy);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// Updates each field of this instance with the value of
|
||||
/// the corresponding field of a given Certificate.
|
||||
/// </summary>
|
||||
public override void UpdateFrom(Certificate update)
|
||||
{
|
||||
uuid = update.uuid;
|
||||
host = update.host;
|
||||
not_before = update.not_before;
|
||||
not_after = update.not_after;
|
||||
fingerprint = update.fingerprint;
|
||||
}
|
||||
|
||||
internal void UpdateFrom(Proxy_Certificate proxy)
|
||||
{
|
||||
uuid = proxy.uuid == null ? null : proxy.uuid;
|
||||
host = proxy.host == null ? null : XenRef<Host>.Create(proxy.host);
|
||||
not_before = proxy.not_before;
|
||||
not_after = proxy.not_after;
|
||||
fingerprint = proxy.fingerprint == null ? null : proxy.fingerprint;
|
||||
}
|
||||
|
||||
public Proxy_Certificate ToProxy()
|
||||
{
|
||||
Proxy_Certificate result_ = new Proxy_Certificate();
|
||||
result_.uuid = uuid ?? "";
|
||||
result_.host = host ?? "";
|
||||
result_.not_before = not_before;
|
||||
result_.not_after = not_after;
|
||||
result_.fingerprint = fingerprint ?? "";
|
||||
return result_;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Given a Hashtable with field-value pairs, it updates the fields of this Certificate
|
||||
/// with the values listed in the Hashtable. Note that only the fields contained
|
||||
/// in the Hashtable will be updated and the rest will remain the same.
|
||||
/// </summary>
|
||||
/// <param name="table"></param>
|
||||
public void UpdateFrom(Hashtable table)
|
||||
{
|
||||
if (table.ContainsKey("uuid"))
|
||||
uuid = Marshalling.ParseString(table, "uuid");
|
||||
if (table.ContainsKey("host"))
|
||||
host = Marshalling.ParseRef<Host>(table, "host");
|
||||
if (table.ContainsKey("not_before"))
|
||||
not_before = Marshalling.ParseDateTime(table, "not_before");
|
||||
if (table.ContainsKey("not_after"))
|
||||
not_after = Marshalling.ParseDateTime(table, "not_after");
|
||||
if (table.ContainsKey("fingerprint"))
|
||||
fingerprint = Marshalling.ParseString(table, "fingerprint");
|
||||
}
|
||||
|
||||
public bool DeepEquals(Certificate other)
|
||||
{
|
||||
if (ReferenceEquals(null, other))
|
||||
return false;
|
||||
if (ReferenceEquals(this, other))
|
||||
return true;
|
||||
|
||||
return Helper.AreEqual2(this._uuid, other._uuid) &&
|
||||
Helper.AreEqual2(this._host, other._host) &&
|
||||
Helper.AreEqual2(this._not_before, other._not_before) &&
|
||||
Helper.AreEqual2(this._not_after, other._not_after) &&
|
||||
Helper.AreEqual2(this._fingerprint, other._fingerprint);
|
||||
}
|
||||
|
||||
internal static List<Certificate> ProxyArrayToObjectList(Proxy_Certificate[] input)
|
||||
{
|
||||
var result = new List<Certificate>();
|
||||
foreach (var item in input)
|
||||
result.Add(new Certificate(item));
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public override string SaveChanges(Session session, string opaqueRef, Certificate server)
|
||||
{
|
||||
if (opaqueRef == null)
|
||||
{
|
||||
System.Diagnostics.Debug.Assert(false, "Cannot create instances of this type on the server");
|
||||
return "";
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new InvalidOperationException("This type has no read/write properties");
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// Get a record containing the current state of the given Certificate.
|
||||
/// First published in Unreleased.
|
||||
/// </summary>
|
||||
/// <param name="session">The session</param>
|
||||
/// <param name="_certificate">The opaque_ref of the given certificate</param>
|
||||
public static Certificate get_record(Session session, string _certificate)
|
||||
{
|
||||
if (session.JsonRpcClient != null)
|
||||
return session.JsonRpcClient.certificate_get_record(session.opaque_ref, _certificate);
|
||||
else
|
||||
return new Certificate(session.XmlRpcProxy.certificate_get_record(session.opaque_ref, _certificate ?? "").parse());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get a reference to the Certificate instance with the specified UUID.
|
||||
/// First published in Unreleased.
|
||||
/// </summary>
|
||||
/// <param name="session">The session</param>
|
||||
/// <param name="_uuid">UUID of object to return</param>
|
||||
public static XenRef<Certificate> get_by_uuid(Session session, string _uuid)
|
||||
{
|
||||
if (session.JsonRpcClient != null)
|
||||
return session.JsonRpcClient.certificate_get_by_uuid(session.opaque_ref, _uuid);
|
||||
else
|
||||
return XenRef<Certificate>.Create(session.XmlRpcProxy.certificate_get_by_uuid(session.opaque_ref, _uuid ?? "").parse());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the uuid field of the given Certificate.
|
||||
/// First published in Unreleased.
|
||||
/// </summary>
|
||||
/// <param name="session">The session</param>
|
||||
/// <param name="_certificate">The opaque_ref of the given certificate</param>
|
||||
public static string get_uuid(Session session, string _certificate)
|
||||
{
|
||||
if (session.JsonRpcClient != null)
|
||||
return session.JsonRpcClient.certificate_get_uuid(session.opaque_ref, _certificate);
|
||||
else
|
||||
return session.XmlRpcProxy.certificate_get_uuid(session.opaque_ref, _certificate ?? "").parse();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the host field of the given Certificate.
|
||||
/// First published in Unreleased.
|
||||
/// </summary>
|
||||
/// <param name="session">The session</param>
|
||||
/// <param name="_certificate">The opaque_ref of the given certificate</param>
|
||||
public static XenRef<Host> get_host(Session session, string _certificate)
|
||||
{
|
||||
if (session.JsonRpcClient != null)
|
||||
return session.JsonRpcClient.certificate_get_host(session.opaque_ref, _certificate);
|
||||
else
|
||||
return XenRef<Host>.Create(session.XmlRpcProxy.certificate_get_host(session.opaque_ref, _certificate ?? "").parse());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the not_before field of the given Certificate.
|
||||
/// First published in Unreleased.
|
||||
/// </summary>
|
||||
/// <param name="session">The session</param>
|
||||
/// <param name="_certificate">The opaque_ref of the given certificate</param>
|
||||
public static DateTime get_not_before(Session session, string _certificate)
|
||||
{
|
||||
if (session.JsonRpcClient != null)
|
||||
return session.JsonRpcClient.certificate_get_not_before(session.opaque_ref, _certificate);
|
||||
else
|
||||
return session.XmlRpcProxy.certificate_get_not_before(session.opaque_ref, _certificate ?? "").parse();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the not_after field of the given Certificate.
|
||||
/// First published in Unreleased.
|
||||
/// </summary>
|
||||
/// <param name="session">The session</param>
|
||||
/// <param name="_certificate">The opaque_ref of the given certificate</param>
|
||||
public static DateTime get_not_after(Session session, string _certificate)
|
||||
{
|
||||
if (session.JsonRpcClient != null)
|
||||
return session.JsonRpcClient.certificate_get_not_after(session.opaque_ref, _certificate);
|
||||
else
|
||||
return session.XmlRpcProxy.certificate_get_not_after(session.opaque_ref, _certificate ?? "").parse();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the fingerprint field of the given Certificate.
|
||||
/// First published in Unreleased.
|
||||
/// </summary>
|
||||
/// <param name="session">The session</param>
|
||||
/// <param name="_certificate">The opaque_ref of the given certificate</param>
|
||||
public static string get_fingerprint(Session session, string _certificate)
|
||||
{
|
||||
if (session.JsonRpcClient != null)
|
||||
return session.JsonRpcClient.certificate_get_fingerprint(session.opaque_ref, _certificate);
|
||||
else
|
||||
return session.XmlRpcProxy.certificate_get_fingerprint(session.opaque_ref, _certificate ?? "").parse();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Return a list of all the Certificates known to the system.
|
||||
/// First published in Unreleased.
|
||||
/// </summary>
|
||||
/// <param name="session">The session</param>
|
||||
public static List<XenRef<Certificate>> get_all(Session session)
|
||||
{
|
||||
if (session.JsonRpcClient != null)
|
||||
return session.JsonRpcClient.certificate_get_all(session.opaque_ref);
|
||||
else
|
||||
return XenRef<Certificate>.Create(session.XmlRpcProxy.certificate_get_all(session.opaque_ref).parse());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get all the Certificate Records at once, in a single XML RPC call
|
||||
/// First published in Unreleased.
|
||||
/// </summary>
|
||||
/// <param name="session">The session</param>
|
||||
public static Dictionary<XenRef<Certificate>, Certificate> get_all_records(Session session)
|
||||
{
|
||||
if (session.JsonRpcClient != null)
|
||||
return session.JsonRpcClient.certificate_get_all_records(session.opaque_ref);
|
||||
else
|
||||
return XenRef<Certificate>.Create<Proxy_Certificate>(session.XmlRpcProxy.certificate_get_all_records(session.opaque_ref).parse());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Unique identifier/object reference
|
||||
/// </summary>
|
||||
public virtual string uuid
|
||||
{
|
||||
get { return _uuid; }
|
||||
set
|
||||
{
|
||||
if (!Helper.AreEqual(value, _uuid))
|
||||
{
|
||||
_uuid = value;
|
||||
NotifyPropertyChanged("uuid");
|
||||
}
|
||||
}
|
||||
}
|
||||
private string _uuid = "";
|
||||
|
||||
/// <summary>
|
||||
/// The host where the certificate is installed
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(XenRefConverter<Host>))]
|
||||
public virtual XenRef<Host> host
|
||||
{
|
||||
get { return _host; }
|
||||
set
|
||||
{
|
||||
if (!Helper.AreEqual(value, _host))
|
||||
{
|
||||
_host = value;
|
||||
NotifyPropertyChanged("host");
|
||||
}
|
||||
}
|
||||
}
|
||||
private XenRef<Host> _host = new XenRef<Host>("OpaqueRef:NULL");
|
||||
|
||||
/// <summary>
|
||||
/// Date after which the certificate is valid
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(XenDateTimeConverter))]
|
||||
public virtual DateTime not_before
|
||||
{
|
||||
get { return _not_before; }
|
||||
set
|
||||
{
|
||||
if (!Helper.AreEqual(value, _not_before))
|
||||
{
|
||||
_not_before = value;
|
||||
NotifyPropertyChanged("not_before");
|
||||
}
|
||||
}
|
||||
}
|
||||
private DateTime _not_before = DateTime.ParseExact("19700101T00:00:00Z", "yyyyMMddTHH:mm:ssZ", CultureInfo.InvariantCulture);
|
||||
|
||||
/// <summary>
|
||||
/// Date before which the certificate is valid
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(XenDateTimeConverter))]
|
||||
public virtual DateTime not_after
|
||||
{
|
||||
get { return _not_after; }
|
||||
set
|
||||
{
|
||||
if (!Helper.AreEqual(value, _not_after))
|
||||
{
|
||||
_not_after = value;
|
||||
NotifyPropertyChanged("not_after");
|
||||
}
|
||||
}
|
||||
}
|
||||
private DateTime _not_after = DateTime.ParseExact("19700101T00:00:00Z", "yyyyMMddTHH:mm:ssZ", CultureInfo.InvariantCulture);
|
||||
|
||||
/// <summary>
|
||||
/// The certificate's fingerprint / hash
|
||||
/// </summary>
|
||||
public virtual string fingerprint
|
||||
{
|
||||
get { return _fingerprint; }
|
||||
set
|
||||
{
|
||||
if (!Helper.AreEqual(value, _fingerprint))
|
||||
{
|
||||
_fingerprint = value;
|
||||
NotifyPropertyChanged("fingerprint");
|
||||
}
|
||||
}
|
||||
}
|
||||
private string _fingerprint = "";
|
||||
}
|
||||
}
|
92
XenModel/XenAPI/FriendlyErrorNames.Designer.cs
generated
92
XenModel/XenAPI/FriendlyErrorNames.Designer.cs
generated
@ -2963,6 +2963,96 @@ namespace XenAPI {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to The provided intermediate certificates are not in a pem-encoded X509..
|
||||
/// </summary>
|
||||
public static string SERVER_CERTIFICATE_CHAIN_INVALID {
|
||||
get {
|
||||
return ResourceManager.GetString("SERVER_CERTIFICATE_CHAIN_INVALID", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to The provided certificate has expired..
|
||||
/// </summary>
|
||||
public static string SERVER_CERTIFICATE_EXPIRED {
|
||||
get {
|
||||
return ResourceManager.GetString("SERVER_CERTIFICATE_EXPIRED", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to The provided certificate is not in a pem-encoded X509..
|
||||
/// </summary>
|
||||
public static string SERVER_CERTIFICATE_INVALID {
|
||||
get {
|
||||
return ResourceManager.GetString("SERVER_CERTIFICATE_INVALID", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to The provided key uses an unsupported algorithm..
|
||||
/// </summary>
|
||||
public static string SERVER_CERTIFICATE_KEY_ALGORITHM_NOT_SUPPORTED {
|
||||
get {
|
||||
return ResourceManager.GetString("SERVER_CERTIFICATE_KEY_ALGORITHM_NOT_SUPPORTED", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to The provided key is not in a pem-encoded PKCS#8 format..
|
||||
/// </summary>
|
||||
public static string SERVER_CERTIFICATE_KEY_INVALID {
|
||||
get {
|
||||
return ResourceManager.GetString("SERVER_CERTIFICATE_KEY_INVALID", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to The provided key does not match the provided certificate's public key..
|
||||
/// </summary>
|
||||
public static string SERVER_CERTIFICATE_KEY_MISMATCH {
|
||||
get {
|
||||
return ResourceManager.GetString("SERVER_CERTIFICATE_KEY_MISMATCH", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to The provided RSA key does not have a length between 2048 and 4096..
|
||||
/// </summary>
|
||||
public static string SERVER_CERTIFICATE_KEY_RSA_LENGTH_NOT_SUPPORTED {
|
||||
get {
|
||||
return ResourceManager.GetString("SERVER_CERTIFICATE_KEY_RSA_LENGTH_NOT_SUPPORTED", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to The provided RSA key is using more than 2 primes, expecting only 2..
|
||||
/// </summary>
|
||||
public static string SERVER_CERTIFICATE_KEY_RSA_MULTI_NOT_SUPPORTED {
|
||||
get {
|
||||
return ResourceManager.GetString("SERVER_CERTIFICATE_KEY_RSA_MULTI_NOT_SUPPORTED", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to The provided certificate is not valid yet..
|
||||
/// </summary>
|
||||
public static string SERVER_CERTIFICATE_NOT_VALID_YET {
|
||||
get {
|
||||
return ResourceManager.GetString("SERVER_CERTIFICATE_NOT_VALID_YET", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to The provided certificate is not using the SHA256 (SHA2) signature algorithm..
|
||||
/// </summary>
|
||||
public static string SERVER_CERTIFICATE_SIGNATURE_NOT_SUPPORTED {
|
||||
get {
|
||||
return ResourceManager.GetString("SERVER_CERTIFICATE_SIGNATURE_NOT_SUPPORTED", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Could not authenticate session. Check your access credentials and try again..
|
||||
/// </summary>
|
||||
@ -3756,7 +3846,7 @@ namespace XenAPI {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Require "-o" along with xe-mount-isosr.
|
||||
/// Looks up a localized string similar to Require "-o" along with xe-mount-iso-sr.
|
||||
/// </summary>
|
||||
public static string SR_BACKEND_FAILURE_228 {
|
||||
get {
|
||||
|
@ -289,7 +289,7 @@
|
||||
<value>Cluster_host operation failed as the cluster_host has not joined the cluster.</value>
|
||||
</data>
|
||||
<data name="CLUSTER_STACK_IN_USE" xml:space="preserve">
|
||||
<value>The cluster stack is already in use.</value>
|
||||
<value>The cluster stack is still in use by at least one plugged PBD.</value>
|
||||
</data>
|
||||
<data name="COULD_NOT_FIND_NETWORK_INTERFACE_WITH_SPECIFIED_DEVICE_NAME_AND_MAC_ADDRESS" xml:space="preserve">
|
||||
<value>Could not find a network interface with the specified device name and MAC address.</value>
|
||||
@ -1088,6 +1088,36 @@ Authorized Roles: {1}</value>
|
||||
<data name="ROLE_NOT_FOUND" xml:space="preserve">
|
||||
<value>Role cannot be found.</value>
|
||||
</data>
|
||||
<data name="SERVER_CERTIFICATE_CHAIN_INVALID" xml:space="preserve">
|
||||
<value>The provided intermediate certificates are not in a pem-encoded X509.</value>
|
||||
</data>
|
||||
<data name="SERVER_CERTIFICATE_EXPIRED" xml:space="preserve">
|
||||
<value>The provided certificate has expired.</value>
|
||||
</data>
|
||||
<data name="SERVER_CERTIFICATE_INVALID" xml:space="preserve">
|
||||
<value>The provided certificate is not in a pem-encoded X509.</value>
|
||||
</data>
|
||||
<data name="SERVER_CERTIFICATE_KEY_ALGORITHM_NOT_SUPPORTED" xml:space="preserve">
|
||||
<value>The provided key uses an unsupported algorithm.</value>
|
||||
</data>
|
||||
<data name="SERVER_CERTIFICATE_KEY_INVALID" xml:space="preserve">
|
||||
<value>The provided key is not in a pem-encoded PKCS#8 format.</value>
|
||||
</data>
|
||||
<data name="SERVER_CERTIFICATE_KEY_MISMATCH" xml:space="preserve">
|
||||
<value>The provided key does not match the provided certificate's public key.</value>
|
||||
</data>
|
||||
<data name="SERVER_CERTIFICATE_KEY_RSA_LENGTH_NOT_SUPPORTED" xml:space="preserve">
|
||||
<value>The provided RSA key does not have a length between 2048 and 4096.</value>
|
||||
</data>
|
||||
<data name="SERVER_CERTIFICATE_KEY_RSA_MULTI_NOT_SUPPORTED" xml:space="preserve">
|
||||
<value>The provided RSA key is using more than 2 primes, expecting only 2.</value>
|
||||
</data>
|
||||
<data name="SERVER_CERTIFICATE_NOT_VALID_YET" xml:space="preserve">
|
||||
<value>The provided certificate is not valid yet.</value>
|
||||
</data>
|
||||
<data name="SERVER_CERTIFICATE_SIGNATURE_NOT_SUPPORTED" xml:space="preserve">
|
||||
<value>The provided certificate is not using the SHA256 (SHA2) signature algorithm.</value>
|
||||
</data>
|
||||
<data name="SESSION_AUTHENTICATION_FAILED" xml:space="preserve">
|
||||
<value>Could not authenticate session. Check your access credentials and try again.</value>
|
||||
</data>
|
||||
|
@ -109,7 +109,8 @@ namespace XenAPI
|
||||
List<XenRef<Feature>> features,
|
||||
string iscsi_iqn,
|
||||
bool multipathing,
|
||||
string uefi_certificates)
|
||||
string uefi_certificates,
|
||||
List<XenRef<Certificate>> certificates)
|
||||
{
|
||||
this.uuid = uuid;
|
||||
this.name_label = name_label;
|
||||
@ -170,6 +171,7 @@ namespace XenAPI
|
||||
this.iscsi_iqn = iscsi_iqn;
|
||||
this.multipathing = multipathing;
|
||||
this.uefi_certificates = uefi_certificates;
|
||||
this.certificates = certificates;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@ -260,6 +262,7 @@ namespace XenAPI
|
||||
iscsi_iqn = update.iscsi_iqn;
|
||||
multipathing = update.multipathing;
|
||||
uefi_certificates = update.uefi_certificates;
|
||||
certificates = update.certificates;
|
||||
}
|
||||
|
||||
internal void UpdateFrom(Proxy_Host proxy)
|
||||
@ -323,6 +326,7 @@ namespace XenAPI
|
||||
iscsi_iqn = proxy.iscsi_iqn == null ? null : proxy.iscsi_iqn;
|
||||
multipathing = (bool)proxy.multipathing;
|
||||
uefi_certificates = proxy.uefi_certificates == null ? null : proxy.uefi_certificates;
|
||||
certificates = proxy.certificates == null ? null : XenRef<Certificate>.Create(proxy.certificates);
|
||||
}
|
||||
|
||||
public Proxy_Host ToProxy()
|
||||
@ -387,6 +391,7 @@ namespace XenAPI
|
||||
result_.iscsi_iqn = iscsi_iqn ?? "";
|
||||
result_.multipathing = multipathing;
|
||||
result_.uefi_certificates = uefi_certificates ?? "";
|
||||
result_.certificates = certificates == null ? new string[] {} : Helper.RefListToStringArray(certificates);
|
||||
return result_;
|
||||
}
|
||||
|
||||
@ -516,6 +521,8 @@ namespace XenAPI
|
||||
multipathing = Marshalling.ParseBool(table, "multipathing");
|
||||
if (table.ContainsKey("uefi_certificates"))
|
||||
uefi_certificates = Marshalling.ParseString(table, "uefi_certificates");
|
||||
if (table.ContainsKey("certificates"))
|
||||
certificates = Marshalling.ParseSetRef<Certificate>(table, "certificates");
|
||||
}
|
||||
|
||||
public bool DeepEquals(Host other, bool ignoreCurrentOperations)
|
||||
@ -585,7 +592,8 @@ namespace XenAPI
|
||||
Helper.AreEqual2(this._features, other._features) &&
|
||||
Helper.AreEqual2(this._iscsi_iqn, other._iscsi_iqn) &&
|
||||
Helper.AreEqual2(this._multipathing, other._multipathing) &&
|
||||
Helper.AreEqual2(this._uefi_certificates, other._uefi_certificates);
|
||||
Helper.AreEqual2(this._uefi_certificates, other._uefi_certificates) &&
|
||||
Helper.AreEqual2(this._certificates, other._certificates);
|
||||
}
|
||||
|
||||
internal static List<Host> ProxyArrayToObjectList(Proxy_Host[] input)
|
||||
@ -1544,6 +1552,20 @@ namespace XenAPI
|
||||
return session.XmlRpcProxy.host_get_uefi_certificates(session.opaque_ref, _host ?? "").parse();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the certificates field of the given host.
|
||||
/// First published in Unreleased.
|
||||
/// </summary>
|
||||
/// <param name="session">The session</param>
|
||||
/// <param name="_host">The opaque_ref of the given host</param>
|
||||
public static List<XenRef<Certificate>> get_certificates(Session session, string _host)
|
||||
{
|
||||
if (session.JsonRpcClient != null)
|
||||
return session.JsonRpcClient.host_get_certificates(session.opaque_ref, _host);
|
||||
else
|
||||
return XenRef<Certificate>.Create(session.XmlRpcProxy.host_get_certificates(session.opaque_ref, _host ?? "").parse());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Set the name/label field of the given host.
|
||||
/// First published in XenServer 4.0.
|
||||
@ -3009,6 +3031,40 @@ namespace XenAPI
|
||||
return XenRef<Task>.Create(session.XmlRpcProxy.async_host_get_server_certificate(session.opaque_ref, _host ?? "").parse());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Install the TLS server certificate.
|
||||
/// First published in Unreleased.
|
||||
/// </summary>
|
||||
/// <param name="session">The session</param>
|
||||
/// <param name="_host">The opaque_ref of the given host</param>
|
||||
/// <param name="_certificate">The server certificate, in PEM form</param>
|
||||
/// <param name="_private_key">The unencrypted private key used to sign the certificate, in PKCS#8 form</param>
|
||||
/// <param name="_certificate_chain">The certificate chain, in PEM form</param>
|
||||
public static void install_server_certificate(Session session, string _host, string _certificate, string _private_key, string _certificate_chain)
|
||||
{
|
||||
if (session.JsonRpcClient != null)
|
||||
session.JsonRpcClient.host_install_server_certificate(session.opaque_ref, _host, _certificate, _private_key, _certificate_chain);
|
||||
else
|
||||
session.XmlRpcProxy.host_install_server_certificate(session.opaque_ref, _host ?? "", _certificate ?? "", _private_key ?? "", _certificate_chain ?? "").parse();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Install the TLS server certificate.
|
||||
/// First published in Unreleased.
|
||||
/// </summary>
|
||||
/// <param name="session">The session</param>
|
||||
/// <param name="_host">The opaque_ref of the given host</param>
|
||||
/// <param name="_certificate">The server certificate, in PEM form</param>
|
||||
/// <param name="_private_key">The unencrypted private key used to sign the certificate, in PKCS#8 form</param>
|
||||
/// <param name="_certificate_chain">The certificate chain, in PEM form</param>
|
||||
public static XenRef<Task> async_install_server_certificate(Session session, string _host, string _certificate, string _private_key, string _certificate_chain)
|
||||
{
|
||||
if (session.JsonRpcClient != null)
|
||||
return session.JsonRpcClient.async_host_install_server_certificate(session.opaque_ref, _host, _certificate, _private_key, _certificate_chain);
|
||||
else
|
||||
return XenRef<Task>.Create(session.XmlRpcProxy.async_host_install_server_certificate(session.opaque_ref, _host ?? "", _certificate ?? "", _private_key ?? "", _certificate_chain ?? "").parse());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Change to another edition, or reactivate the current edition after a license has expired. This may be subject to the successful checkout of an appropriate license.
|
||||
/// First published in XenServer 5.6.
|
||||
@ -4487,5 +4543,24 @@ namespace XenAPI
|
||||
}
|
||||
}
|
||||
private string _uefi_certificates = "";
|
||||
|
||||
/// <summary>
|
||||
/// List of certificates installed in the host
|
||||
/// First published in Unreleased.
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(XenRefListConverter<Certificate>))]
|
||||
public virtual List<XenRef<Certificate>> certificates
|
||||
{
|
||||
get { return _certificates; }
|
||||
set
|
||||
{
|
||||
if (!Helper.AreEqual(value, _certificates))
|
||||
{
|
||||
_certificates = value;
|
||||
NotifyPropertyChanged("certificates");
|
||||
}
|
||||
}
|
||||
}
|
||||
private List<XenRef<Certificate>> _certificates = new List<XenRef<Certificate>>() {};
|
||||
}
|
||||
}
|
||||
|
@ -5877,6 +5877,13 @@ namespace XenAPI
|
||||
return Rpc<string>("host.get_uefi_certificates", new JArray(session, _host ?? ""), serializer);
|
||||
}
|
||||
|
||||
public List<XenRef<Certificate>> host_get_certificates(string session, string _host)
|
||||
{
|
||||
var converters = new List<JsonConverter> {new XenRefListConverter<Certificate>()};
|
||||
var serializer = CreateSerializer(converters);
|
||||
return Rpc<List<XenRef<Certificate>>>("host.get_certificates", new JArray(session, _host ?? ""), serializer);
|
||||
}
|
||||
|
||||
public void host_set_name_label(string session, string _host, string _label)
|
||||
{
|
||||
var converters = new List<JsonConverter> {};
|
||||
@ -6577,6 +6584,20 @@ namespace XenAPI
|
||||
return Rpc<XenRef<Task>>("Async.host.get_server_certificate", new JArray(session, _host ?? ""), serializer);
|
||||
}
|
||||
|
||||
public void host_install_server_certificate(string session, string _host, string _certificate, string _private_key, string _certificate_chain)
|
||||
{
|
||||
var converters = new List<JsonConverter> {};
|
||||
var serializer = CreateSerializer(converters);
|
||||
Rpc("host.install_server_certificate", new JArray(session, _host ?? "", _certificate ?? "", _private_key ?? "", _certificate_chain ?? ""), serializer);
|
||||
}
|
||||
|
||||
public XenRef<Task> async_host_install_server_certificate(string session, string _host, string _certificate, string _private_key, string _certificate_chain)
|
||||
{
|
||||
var converters = new List<JsonConverter> {new XenRefConverter<Task>()};
|
||||
var serializer = CreateSerializer(converters);
|
||||
return Rpc<XenRef<Task>>("Async.host.install_server_certificate", new JArray(session, _host ?? "", _certificate ?? "", _private_key ?? "", _certificate_chain ?? ""), serializer);
|
||||
}
|
||||
|
||||
public void host_apply_edition(string session, string _host, string _edition)
|
||||
{
|
||||
var converters = new List<JsonConverter> {};
|
||||
@ -14466,5 +14487,68 @@ namespace XenAPI
|
||||
var serializer = CreateSerializer(converters);
|
||||
return Rpc<Dictionary<XenRef<Cluster_host>, Cluster_host>>("Cluster_host.get_all_records", new JArray(session), serializer);
|
||||
}
|
||||
|
||||
public Certificate certificate_get_record(string session, string _certificate)
|
||||
{
|
||||
var converters = new List<JsonConverter> {};
|
||||
var serializer = CreateSerializer(converters);
|
||||
return Rpc<Certificate>("Certificate.get_record", new JArray(session, _certificate ?? ""), serializer);
|
||||
}
|
||||
|
||||
public XenRef<Certificate> certificate_get_by_uuid(string session, string _uuid)
|
||||
{
|
||||
var converters = new List<JsonConverter> {new XenRefConverter<Certificate>()};
|
||||
var serializer = CreateSerializer(converters);
|
||||
return Rpc<XenRef<Certificate>>("Certificate.get_by_uuid", new JArray(session, _uuid ?? ""), serializer);
|
||||
}
|
||||
|
||||
public string certificate_get_uuid(string session, string _certificate)
|
||||
{
|
||||
var converters = new List<JsonConverter> {};
|
||||
var serializer = CreateSerializer(converters);
|
||||
return Rpc<string>("Certificate.get_uuid", new JArray(session, _certificate ?? ""), serializer);
|
||||
}
|
||||
|
||||
public XenRef<Host> certificate_get_host(string session, string _certificate)
|
||||
{
|
||||
var converters = new List<JsonConverter> {new XenRefConverter<Host>()};
|
||||
var serializer = CreateSerializer(converters);
|
||||
return Rpc<XenRef<Host>>("Certificate.get_host", new JArray(session, _certificate ?? ""), serializer);
|
||||
}
|
||||
|
||||
public DateTime certificate_get_not_before(string session, string _certificate)
|
||||
{
|
||||
var converters = new List<JsonConverter> {new XenDateTimeConverter()};
|
||||
var serializer = CreateSerializer(converters);
|
||||
return Rpc<DateTime>("Certificate.get_not_before", new JArray(session, _certificate ?? ""), serializer);
|
||||
}
|
||||
|
||||
public DateTime certificate_get_not_after(string session, string _certificate)
|
||||
{
|
||||
var converters = new List<JsonConverter> {new XenDateTimeConverter()};
|
||||
var serializer = CreateSerializer(converters);
|
||||
return Rpc<DateTime>("Certificate.get_not_after", new JArray(session, _certificate ?? ""), serializer);
|
||||
}
|
||||
|
||||
public string certificate_get_fingerprint(string session, string _certificate)
|
||||
{
|
||||
var converters = new List<JsonConverter> {};
|
||||
var serializer = CreateSerializer(converters);
|
||||
return Rpc<string>("Certificate.get_fingerprint", new JArray(session, _certificate ?? ""), serializer);
|
||||
}
|
||||
|
||||
public List<XenRef<Certificate>> certificate_get_all(string session)
|
||||
{
|
||||
var converters = new List<JsonConverter> {new XenRefListConverter<Certificate>()};
|
||||
var serializer = CreateSerializer(converters);
|
||||
return Rpc<List<XenRef<Certificate>>>("Certificate.get_all", new JArray(session), serializer);
|
||||
}
|
||||
|
||||
public Dictionary<XenRef<Certificate>, Certificate> certificate_get_all_records(string session)
|
||||
{
|
||||
var converters = new List<JsonConverter> {new XenRefXenObjectMapConverter<Certificate>()};
|
||||
var serializer = CreateSerializer(converters);
|
||||
return Rpc<Dictionary<XenRef<Certificate>, Certificate>>("Certificate.get_all_records", new JArray(session), serializer);
|
||||
}
|
||||
}
|
||||
}
|
@ -35,6 +35,10 @@ namespace XenAPI
|
||||
{
|
||||
public enum MessageType
|
||||
{
|
||||
HOST_SERVER_CERTIFICATE_EXPIRED,
|
||||
HOST_SERVER_CERTIFICATE_EXPIRING_07,
|
||||
HOST_SERVER_CERTIFICATE_EXPIRING_14,
|
||||
HOST_SERVER_CERTIFICATE_EXPIRING_30,
|
||||
CLUSTER_HOST_FENCING,
|
||||
CLUSTER_HOST_ENABLE_FAILED,
|
||||
POOL_CPU_FEATURES_UP,
|
||||
@ -121,6 +125,14 @@ namespace XenAPI
|
||||
{
|
||||
switch (this.name)
|
||||
{
|
||||
case "HOST_SERVER_CERTIFICATE_EXPIRED":
|
||||
return MessageType.HOST_SERVER_CERTIFICATE_EXPIRED;
|
||||
case "HOST_SERVER_CERTIFICATE_EXPIRING_07":
|
||||
return MessageType.HOST_SERVER_CERTIFICATE_EXPIRING_07;
|
||||
case "HOST_SERVER_CERTIFICATE_EXPIRING_14":
|
||||
return MessageType.HOST_SERVER_CERTIFICATE_EXPIRING_14;
|
||||
case "HOST_SERVER_CERTIFICATE_EXPIRING_30":
|
||||
return MessageType.HOST_SERVER_CERTIFICATE_EXPIRING_30;
|
||||
case "CLUSTER_HOST_FENCING":
|
||||
return MessageType.CLUSTER_HOST_FENCING;
|
||||
case "CLUSTER_HOST_ENABLE_FAILED":
|
||||
|
@ -2124,7 +2124,7 @@ namespace XenAPI
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Install an SSL certificate pool-wide.
|
||||
/// Install a TLS CA certificate, pool-wide.
|
||||
/// First published in XenServer 5.5.
|
||||
/// </summary>
|
||||
/// <param name="session">The session</param>
|
||||
@ -2139,7 +2139,7 @@ namespace XenAPI
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Install an SSL certificate pool-wide.
|
||||
/// Install a TLS CA certificate, pool-wide.
|
||||
/// First published in XenServer 5.5.
|
||||
/// </summary>
|
||||
/// <param name="session">The session</param>
|
||||
@ -2154,7 +2154,7 @@ namespace XenAPI
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Remove an SSL certificate.
|
||||
/// Remove a pool-wide TLS CA certificate.
|
||||
/// First published in XenServer 5.5.
|
||||
/// </summary>
|
||||
/// <param name="session">The session</param>
|
||||
@ -2168,7 +2168,7 @@ namespace XenAPI
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Remove an SSL certificate.
|
||||
/// Remove a pool-wide TLS CA certificate.
|
||||
/// First published in XenServer 5.5.
|
||||
/// </summary>
|
||||
/// <param name="session">The session</param>
|
||||
@ -2182,7 +2182,7 @@ namespace XenAPI
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// List all installed SSL certificates.
|
||||
/// List the names of all installed TLS CA certificates.
|
||||
/// First published in XenServer 5.5.
|
||||
/// </summary>
|
||||
/// <param name="session">The session</param>
|
||||
@ -2195,7 +2195,7 @@ namespace XenAPI
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// List all installed SSL certificates.
|
||||
/// List the names of all installed TLS CA certificates.
|
||||
/// First published in XenServer 5.5.
|
||||
/// </summary>
|
||||
/// <param name="session">The session</param>
|
||||
@ -2208,7 +2208,7 @@ namespace XenAPI
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Install an SSL certificate revocation list, pool-wide.
|
||||
/// Install a TLS Certificate Revocation List, pool-wide.
|
||||
/// First published in XenServer 5.5.
|
||||
/// </summary>
|
||||
/// <param name="session">The session</param>
|
||||
@ -2223,7 +2223,7 @@ namespace XenAPI
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Install an SSL certificate revocation list, pool-wide.
|
||||
/// Install a TLS Certificate Revocation List, pool-wide.
|
||||
/// First published in XenServer 5.5.
|
||||
/// </summary>
|
||||
/// <param name="session">The session</param>
|
||||
@ -2238,7 +2238,7 @@ namespace XenAPI
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Remove an SSL certificate revocation list.
|
||||
/// Remove a pool-wide TLS Certificate Revocation List.
|
||||
/// First published in XenServer 5.5.
|
||||
/// </summary>
|
||||
/// <param name="session">The session</param>
|
||||
@ -2252,7 +2252,7 @@ namespace XenAPI
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Remove an SSL certificate revocation list.
|
||||
/// Remove a pool-wide TLS Certificate Revocation List.
|
||||
/// First published in XenServer 5.5.
|
||||
/// </summary>
|
||||
/// <param name="session">The session</param>
|
||||
@ -2266,7 +2266,7 @@ namespace XenAPI
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// List all installed SSL certificate revocation lists.
|
||||
/// List the names of all installed TLS Certificate Revocation Lists.
|
||||
/// First published in XenServer 5.5.
|
||||
/// </summary>
|
||||
/// <param name="session">The session</param>
|
||||
@ -2279,7 +2279,7 @@ namespace XenAPI
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// List all installed SSL certificate revocation lists.
|
||||
/// List the names of all installed TLS Certificate Revocation Lists.
|
||||
/// First published in XenServer 5.5.
|
||||
/// </summary>
|
||||
/// <param name="session">The session</param>
|
||||
@ -2292,7 +2292,7 @@ namespace XenAPI
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sync SSL certificates from master to slaves.
|
||||
/// Copy the TLS CA certificates and CRLs of the master to all slaves.
|
||||
/// First published in XenServer 5.5.
|
||||
/// </summary>
|
||||
/// <param name="session">The session</param>
|
||||
@ -2305,7 +2305,7 @@ namespace XenAPI
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sync SSL certificates from master to slaves.
|
||||
/// Copy the TLS CA certificates and CRLs of the master to all slaves.
|
||||
/// First published in XenServer 5.5.
|
||||
/// </summary>
|
||||
/// <param name="session">The session</param>
|
||||
@ -3134,7 +3134,7 @@ namespace XenAPI
|
||||
private bool _wlb_enabled = false;
|
||||
|
||||
/// <summary>
|
||||
/// true if communication with the WLB server should enforce SSL certificate verification.
|
||||
/// true if communication with the WLB server should enforce TLS certificate verification.
|
||||
/// First published in XenServer 5.5.
|
||||
/// </summary>
|
||||
public virtual bool wlb_verify_cert
|
||||
|
@ -3378,6 +3378,10 @@ namespace XenAPI
|
||||
Response<string>
|
||||
host_get_uefi_certificates(string session, string _host);
|
||||
|
||||
[XmlRpcMethod("host.get_certificates")]
|
||||
Response<string []>
|
||||
host_get_certificates(string session, string _host);
|
||||
|
||||
[XmlRpcMethod("host.set_name_label")]
|
||||
Response<string>
|
||||
host_set_name_label(string session, string _host, string _label);
|
||||
@ -3778,6 +3782,14 @@ namespace XenAPI
|
||||
Response<string>
|
||||
async_host_get_server_certificate(string session, string _host);
|
||||
|
||||
[XmlRpcMethod("host.install_server_certificate")]
|
||||
Response<string>
|
||||
host_install_server_certificate(string session, string _host, string _certificate, string _private_key, string _certificate_chain);
|
||||
|
||||
[XmlRpcMethod("Async.host.install_server_certificate")]
|
||||
Response<string>
|
||||
async_host_install_server_certificate(string session, string _host, string _certificate, string _private_key, string _certificate_chain);
|
||||
|
||||
[XmlRpcMethod("host.apply_edition")]
|
||||
Response<string>
|
||||
host_apply_edition(string session, string _host, string _edition);
|
||||
@ -8286,6 +8298,42 @@ namespace XenAPI
|
||||
[XmlRpcMethod("Cluster_host.get_all_records")]
|
||||
Response<Object>
|
||||
cluster_host_get_all_records(string session);
|
||||
|
||||
[XmlRpcMethod("Certificate.get_record")]
|
||||
Response<Proxy_Certificate>
|
||||
certificate_get_record(string session, string _certificate);
|
||||
|
||||
[XmlRpcMethod("Certificate.get_by_uuid")]
|
||||
Response<string>
|
||||
certificate_get_by_uuid(string session, string _uuid);
|
||||
|
||||
[XmlRpcMethod("Certificate.get_uuid")]
|
||||
Response<string>
|
||||
certificate_get_uuid(string session, string _certificate);
|
||||
|
||||
[XmlRpcMethod("Certificate.get_host")]
|
||||
Response<string>
|
||||
certificate_get_host(string session, string _certificate);
|
||||
|
||||
[XmlRpcMethod("Certificate.get_not_before")]
|
||||
Response<DateTime>
|
||||
certificate_get_not_before(string session, string _certificate);
|
||||
|
||||
[XmlRpcMethod("Certificate.get_not_after")]
|
||||
Response<DateTime>
|
||||
certificate_get_not_after(string session, string _certificate);
|
||||
|
||||
[XmlRpcMethod("Certificate.get_fingerprint")]
|
||||
Response<string>
|
||||
certificate_get_fingerprint(string session, string _certificate);
|
||||
|
||||
[XmlRpcMethod("Certificate.get_all")]
|
||||
Response<string []>
|
||||
certificate_get_all(string session);
|
||||
|
||||
[XmlRpcMethod("Certificate.get_all_records")]
|
||||
Response<Object>
|
||||
certificate_get_all_records(string session);
|
||||
}
|
||||
|
||||
[XmlRpcMissingMapping(MappingAction.Ignore)]
|
||||
@ -8690,6 +8738,7 @@ namespace XenAPI
|
||||
public string iscsi_iqn;
|
||||
public bool multipathing;
|
||||
public string uefi_certificates;
|
||||
public string [] certificates;
|
||||
}
|
||||
|
||||
[XmlRpcMissingMapping(MappingAction.Ignore)]
|
||||
@ -9381,4 +9430,14 @@ namespace XenAPI
|
||||
public Object current_operations;
|
||||
public Object other_config;
|
||||
}
|
||||
|
||||
[XmlRpcMissingMapping(MappingAction.Ignore)]
|
||||
public class Proxy_Certificate
|
||||
{
|
||||
public string uuid;
|
||||
public string host;
|
||||
public DateTime not_before;
|
||||
public DateTime not_after;
|
||||
public string fingerprint;
|
||||
}
|
||||
}
|
@ -161,6 +161,7 @@ namespace XenAPI
|
||||
});
|
||||
|
||||
relations.Add(typeof(Proxy_Host), new Relation[] {
|
||||
new Relation("certificates", "Certificate", "host"),
|
||||
new Relation("features", "Feature", "host"),
|
||||
new Relation("PUSBs", "PUSB", "host"),
|
||||
new Relation("PGPUs", "PGPU", "host"),
|
||||
|
@ -356,6 +356,7 @@
|
||||
<Compile Include="XenAPI\allocation_algorithm.cs" />
|
||||
<Compile Include="XenAPI\ApiVersion.cs" />
|
||||
<Compile Include="XenAPI\bond_mode.cs" />
|
||||
<Compile Include="XenAPI\Certificate.cs" />
|
||||
<Compile Include="XenAPI\Cluster.cs" />
|
||||
<Compile Include="XenAPI\Cluster_host.cs" />
|
||||
<Compile Include="XenAPI\cluster_host_operation.cs" />
|
||||
|
Loading…
Reference in New Issue
Block a user