本文整理汇总了C#中OVHApi类的典型用法代码示例。如果您正苦于以下问题:C# OVHApi类的具体用法?C# OVHApi怎么用?C# OVHApi使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
OVHApi类属于命名空间,在下文中一共展示了OVHApi类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: CreateIpFirewallRule
/// <summary>
/// AntiDDOS option. Add new rule on your IP
/// <param name="tcpOption">Option on your rule. Can only be used with TCP protocol</param>
/// <param name="source">Source ip for your rule. Any if not set</param>
/// <param name="protocol">Network protocol</param>
/// <param name="destinationPort">Destination port for your rule. Only with TCP/UDP protocol</param>
/// <param name="sequence">Sequence number of your rule</param>
/// <param name="action">Action on this rule</param>
/// <param name="sourcePort">Source port for your rule. Only with TCP/UDP protocol</param>
/// <param name="ip">To be written</param>
/// <param name="ipOnFirewall">To be written</param>
/// </summary>
public async Task<OvhApi.Models.Ip.FirewallNetworkRule> CreateIpFirewallRule(OvhApi.Models.Ip.FirewallProtocolEnum protocol,OvhApi.Models.Ip.FirewallSequenceRangeEnum sequence,OvhApi.Models.Ip.FirewallActionEnum action,OVHApi.IPAddressBlock ip,System.Net.IPAddress ipOnFirewall,long? sourcePort = null,long? destinationPort = null,OVHApi.IPAddressBlock source = null,OvhApi.Models.Ip.FirewallOptionTCP tcpOption = null)
{
if(ConsumerKey == null)
throw new OvhException("This request must be authenticated");
Ensure.NotNull("protocol",protocol);
Ensure.NotNull("sequence",sequence);
Ensure.NotNull("action",action);
Ensure.NotNull("ip",ip);
Ensure.NotNull("ipOnFirewall",ipOnFirewall);
var requestBody = new Dictionary<string, object>();
requestBody.Add("tcpOption",tcpOption);
requestBody.Add("source",source);
requestBody.Add("protocol",protocol);
requestBody.Add("destinationPort",destinationPort);
requestBody.Add("sequence",sequence);
requestBody.Add("action",action);
requestBody.Add("sourcePort",sourcePort);
return await RawCall<OvhApi.Models.Ip.FirewallNetworkRule>(HttpMethod.Post,String.Format("/ip/{0}/firewall/{1}/rule",System.Uri.EscapeDataString(ip.ToString()).Replace("%2B", "+"),System.Uri.EscapeDataString(ipOnFirewall.ToString()).Replace("%2B", "+")),requestBody);
}
开发者ID:biapar,项目名称:ovhapicil,代码行数:34,代码来源:Operations.cs
示例2: GetIpLicensePleskNames
/// <summary>
/// Plesk licenses associated to this IP
/// <param name="ipAddress">Filter the value of ipAddress property (=)</param>
/// <param name="ip">To be written</param>
/// </summary>
public async Task<string[]> GetIpLicensePleskNames(OVHApi.IPAddressBlock ip,System.Net.IPAddress ipAddress = null)
{
if(ConsumerKey == null)
throw new OvhException("This request must be authenticated");
Ensure.NotNull("ip",ip);
var queryString = new QueryString();
queryString.Add("ipAddress",ipAddress);
return await RawCall<string[]>(HttpMethod.Get,String.Format("/ip/{0}/license/plesk{1}",System.Uri.EscapeDataString(ip.ToString()).Replace("%2B", "+"),queryString));
}
开发者ID:biapar,项目名称:ovhapicil,代码行数:17,代码来源:Operations.cs
示例3: CreateIpMitigation
/// <summary>
/// AntiDDOS option. Add new IP on permanent mitigation
/// <param name="ipOnMitigation">To be written</param>
/// <param name="ip">To be written</param>
/// </summary>
public async Task<OvhApi.Models.Ip.MitigationIp> CreateIpMitigation(System.Net.IPAddress ipOnMitigation,OVHApi.IPAddressBlock ip)
{
if(ConsumerKey == null)
throw new OvhException("This request must be authenticated");
Ensure.NotNull("ipOnMitigation",ipOnMitigation);
Ensure.NotNull("ip",ip);
var requestBody = new Dictionary<string, object>();
requestBody.Add("ipOnMitigation",ipOnMitigation);
return await RawCall<OvhApi.Models.Ip.MitigationIp>(HttpMethod.Post,String.Format("/ip/{0}/mitigation",System.Uri.EscapeDataString(ip.ToString()).Replace("%2B", "+")),requestBody);
}
开发者ID:biapar,项目名称:ovhapicil,代码行数:18,代码来源:Operations.cs
示例4: GetIpMitigationprofiles
/// <summary>
/// Manage mitigation profile on your IPs
/// <param name="ip">To be written</param>
/// </summary>
public async Task<System.Net.IPAddress[]> GetIpMitigationprofiles(OVHApi.IPAddressBlock ip)
{
if(ConsumerKey == null)
throw new OvhException("This request must be authenticated");
Ensure.NotNull("ip",ip);
return await RawCall<System.Net.IPAddress[]>(HttpMethod.Get,String.Format("/ip/{0}/mitigationProfiles",System.Uri.EscapeDataString(ip.ToString()).Replace("%2B", "+")));
}
开发者ID:biapar,项目名称:ovhapicil,代码行数:14,代码来源:Operations.cs
示例5: GetIpTaskIds
/// <summary>
/// IP tasks
/// <param name="function">Filter the value of function property (=)</param>
/// <param name="status">Filter the value of status property (=)</param>
/// <param name="ip">To be written</param>
/// </summary>
public async Task<long[]> GetIpTaskIds(OVHApi.IPAddressBlock ip,OvhApi.Models.Ip.TaskStatusEnum? status = null,OvhApi.Models.Ip.TaskFunctionEnum? function = null)
{
if(ConsumerKey == null)
throw new OvhException("This request must be authenticated");
Ensure.NotNull("ip",ip);
var queryString = new QueryString();
queryString.Add("function",function);
queryString.Add("status",status);
return await RawCall<long[]>(HttpMethod.Get,String.Format("/ip/{0}/task{1}",System.Uri.EscapeDataString(ip.ToString()).Replace("%2B", "+"),queryString));
}
开发者ID:biapar,项目名称:ovhapicil,代码行数:19,代码来源:Operations.cs
示例6: CreateIpSpamUnblock
/// <summary>
/// Release the ip from anti-spam system
/// <param name="ip">To be written</param>
/// <param name="ipSpamming">IP address which is sending spam</param>
/// </summary>
public async Task<OvhApi.Models.Ip.SpamIp> CreateIpSpamUnblock(OVHApi.IPAddressBlock ip,System.Net.IPAddress ipSpamming)
{
if(ConsumerKey == null)
throw new OvhException("This request must be authenticated");
Ensure.NotNull("ip",ip);
Ensure.NotNull("ipSpamming",ipSpamming);
return await RawCall<OvhApi.Models.Ip.SpamIp>(HttpMethod.Post,String.Format("/ip/{0}/spam/{1}/unblock",System.Uri.EscapeDataString(ip.ToString()).Replace("%2B", "+"),System.Uri.EscapeDataString(ipSpamming.ToString()).Replace("%2B", "+")));
}
开发者ID:biapar,项目名称:ovhapicil,代码行数:16,代码来源:Operations.cs
示例7: GetIpMigrationtoken
/// <summary>
/// Get this object properties
/// <param name="ip">To be written</param>
/// </summary>
public async Task<OvhApi.Models.Ip.IpMigrationToken> GetIpMigrationtoken(OVHApi.IPAddressBlock ip)
{
if(ConsumerKey == null)
throw new OvhException("This request must be authenticated");
Ensure.NotNull("ip",ip);
return await RawCall<OvhApi.Models.Ip.IpMigrationToken>(HttpMethod.Get,String.Format("/ip/{0}/migrationToken",System.Uri.EscapeDataString(ip.ToString()).Replace("%2B", "+")));
}
开发者ID:biapar,项目名称:ovhapicil,代码行数:14,代码来源:Operations.cs
示例8: CreateDedicatedServerIpmove
/// <summary>
/// Move an Ip failover to this server
/// <param name="ip">The ip to move to this server</param>
/// <param name="serviceName">The internal name of your dedicated server</param>
/// </summary>
public async Task<OvhApi.Models.Dedicated.Server.Task> CreateDedicatedServerIpmove(OVHApi.IPAddressBlock ip,string serviceName)
{
if(ConsumerKey == null)
throw new OvhException("This request must be authenticated");
Ensure.NotNull("ip",ip);
Ensure.NotNullNorEmpty("serviceName",serviceName);
var requestBody = new Dictionary<string, object>();
requestBody.Add("ip",ip);
return await RawCall<OvhApi.Models.Dedicated.Server.Task>(HttpMethod.Post,String.Format("/dedicated/server/{0}/ipMove",System.Uri.EscapeDataString(serviceName.ToString()).Replace("%2B", "+")),requestBody);
}
开发者ID:biapar,项目名称:ovhapicil,代码行数:18,代码来源:Operations.cs
示例9: DeleteVrackIp
/// <summary>
/// remove this IP block from this vrack (1.5)
/// <param name="serviceName">The internal name of your vrack (1.5)</param>
/// <param name="ip">Your IP block</param>
/// </summary>
public async Task<OvhApi.Models.Vrack.Task> DeleteVrackIp(string serviceName,OVHApi.IPAddressBlock ip)
{
if(ConsumerKey == null)
throw new OvhException("This request must be authenticated");
Ensure.NotNullNorEmpty("serviceName",serviceName);
Ensure.NotNull("ip",ip);
return await RawCall<OvhApi.Models.Vrack.Task>(HttpMethod.Delete,String.Format("/vrack/{0}/ip/{1}",System.Uri.EscapeDataString(serviceName.ToString()).Replace("%2B", "+"),System.Uri.EscapeDataString(ip.ToString()).Replace("%2B", "+")));
}
开发者ID:biapar,项目名称:ovhapicil,代码行数:16,代码来源:Operations.cs
示例10: DeleteDedicatedNashaPartitionAccess
/// <summary>
/// Delete an ACL entry
/// <param name="serviceName">The internal name of your storage</param>
/// <param name="partitionName">the given name of partition</param>
/// <param name="ip">the ip in root on storage</param>
/// </summary>
public async Task<OvhApi.Models.Dedicated.NasTask.Task> DeleteDedicatedNashaPartitionAccess(string serviceName,string partitionName,OVHApi.IPAddressBlock ip)
{
if(ConsumerKey == null)
throw new OvhException("This request must be authenticated");
Ensure.NotNullNorEmpty("serviceName",serviceName);
Ensure.NotNullNorEmpty("partitionName",partitionName);
Ensure.NotNull("ip",ip);
return await RawCall<OvhApi.Models.Dedicated.NasTask.Task>(HttpMethod.Delete,String.Format("/dedicated/nasha/{0}/partition/{1}/access/{2}",System.Uri.EscapeDataString(serviceName.ToString()).Replace("%2B", "+"),System.Uri.EscapeDataString(partitionName.ToString()).Replace("%2B", "+"),System.Uri.EscapeDataString(ip.ToString()).Replace("%2B", "+")));
}
开发者ID:biapar,项目名称:ovhapicil,代码行数:18,代码来源:Operations.cs
示例11: UpdateVpsBackupftpAccess
/// <summary>
/// Alter this object properties
/// <param name="requestBody">New object properties</param>
/// <param name="serviceName">The internal name of your VPS offer</param>
/// <param name="ipBlock">The IP Block specific to this ACL</param>
/// </summary>
public async Task UpdateVpsBackupftpAccess(OvhApi.Models.Dedicated.Server.BackupFtpAcl requestBody,string serviceName,OVHApi.IPAddressBlock ipBlock)
{
if(ConsumerKey == null)
throw new OvhException("This request must be authenticated");
Ensure.NotNull("requestBody",requestBody);
Ensure.NotNullNorEmpty("serviceName",serviceName);
Ensure.NotNull("ipBlock",ipBlock);
await RawCall(HttpMethod.Put,String.Format("/vps/{0}/backupftp/access/{1}",System.Uri.EscapeDataString(serviceName.ToString()).Replace("%2B", "+"),System.Uri.EscapeDataString(ipBlock.ToString()).Replace("%2B", "+")),requestBody);
}
开发者ID:biapar,项目名称:ovhapicil,代码行数:18,代码来源:Operations.cs
示例12: GetOrderDedicatedServerIpmigration
/// <summary>
/// Get prices and contracts information
/// <param name="ip">The IP to move to this server</param>
/// <param name="token">IP migration token</param>
/// <param name="serviceName">The internal name of your dedicated server</param>
/// <param name="duration">Duration</param>
/// </summary>
public async Task<OvhApi.Models.Order.Order> GetOrderDedicatedServerIpmigration(OVHApi.IPAddressBlock ip,string token,string serviceName,string duration)
{
if(ConsumerKey == null)
throw new OvhException("This request must be authenticated");
Ensure.NotNull("ip",ip);
Ensure.NotNullNorEmpty("token",token);
Ensure.NotNullNorEmpty("serviceName",serviceName);
Ensure.NotNullNorEmpty("duration",duration);
var queryString = new QueryString();
queryString.Add("ip",ip);
queryString.Add("token",token);
return await RawCall<OvhApi.Models.Order.Order>(HttpMethod.Get,String.Format("/order/dedicated/server/{0}/ipMigration/{1}{2}",System.Uri.EscapeDataString(serviceName.ToString()).Replace("%2B", "+"),System.Uri.EscapeDataString(duration.ToString()).Replace("%2B", "+"),queryString));
}
开发者ID:biapar,项目名称:ovhapicil,代码行数:23,代码来源:Operations.cs
示例13: CreateMeAccessrestrictionIp
/// <summary>
/// Add an IP access restriction
/// <param name="ip">An IP range where we will apply the rule</param>
/// <param name="warning">Send an email if someone try to access with this IP address</param>
/// <param name="rule">Accept or deny IP access</param>
/// </summary>
public async Task CreateMeAccessrestrictionIp(OVHApi.IPAddressBlock ip,bool warning,OvhApi.Models.Nichandle.AccessRestriction.IpRestrictionRuleEnum rule)
{
if(ConsumerKey == null)
throw new OvhException("This request must be authenticated");
Ensure.NotNull("ip",ip);
Ensure.NotNull("warning",warning);
Ensure.NotNull("rule",rule);
var requestBody = new Dictionary<string, object>();
requestBody.Add("ip",ip);
requestBody.Add("warning",warning);
requestBody.Add("rule",rule);
await RawCall(HttpMethod.Post,String.Format("/me/accessRestriction/ip"),requestBody);
}
开发者ID:biapar,项目名称:ovhapicil,代码行数:22,代码来源:Operations.cs
示例14: DeleteIpFirewallRule
/// <summary>
/// AntiDDOS option. Delete rule
/// <param name="ip">To be written</param>
/// <param name="ipOnFirewall">To be written</param>
/// <param name="sequence">To be written</param>
/// </summary>
public async Task<OvhApi.Models.Ip.FirewallNetworkRule> DeleteIpFirewallRule(OVHApi.IPAddressBlock ip,System.Net.IPAddress ipOnFirewall,long sequence)
{
if(ConsumerKey == null)
throw new OvhException("This request must be authenticated");
Ensure.NotNull("ip",ip);
Ensure.NotNull("ipOnFirewall",ipOnFirewall);
Ensure.IdIsValid("sequence",sequence);
return await RawCall<OvhApi.Models.Ip.FirewallNetworkRule>(HttpMethod.Delete,String.Format("/ip/{0}/firewall/{1}/rule/{2}",System.Uri.EscapeDataString(ip.ToString()).Replace("%2B", "+"),System.Uri.EscapeDataString(ipOnFirewall.ToString()).Replace("%2B", "+"),System.Uri.EscapeDataString(sequence.ToString()).Replace("%2B", "+")));
}
开发者ID:biapar,项目名称:ovhapicil,代码行数:18,代码来源:Operations.cs
示例15: GetIpArp
/// <summary>
/// Get this object properties
/// <param name="ip">To be written</param>
/// <param name="ipBlocked">your IP</param>
/// </summary>
public async Task<OvhApi.Models.Ip.ArpBlockedIp> GetIpArp(OVHApi.IPAddressBlock ip,System.Net.IPAddress ipBlocked)
{
if(ConsumerKey == null)
throw new OvhException("This request must be authenticated");
Ensure.NotNull("ip",ip);
Ensure.NotNull("ipBlocked",ipBlocked);
return await RawCall<OvhApi.Models.Ip.ArpBlockedIp>(HttpMethod.Get,String.Format("/ip/{0}/arp/{1}",System.Uri.EscapeDataString(ip.ToString()).Replace("%2B", "+"),System.Uri.EscapeDataString(ipBlocked.ToString()).Replace("%2B", "+")));
}
开发者ID:biapar,项目名称:ovhapicil,代码行数:16,代码来源:Operations.cs
示例16: CreateVrackIpAnnounceinzone
/// <summary>
/// Announce IP to zone for vrack (1.5)
/// <param name="zone">Zone to announce in</param>
/// <param name="serviceName">The internal name of your vrack (1.5)</param>
/// <param name="ip">Your IP block</param>
/// </summary>
public async Task<OvhApi.Models.Vrack.Task> CreateVrackIpAnnounceinzone(OvhApi.Models.Vrack.VrackZoneEnum zone,string serviceName,OVHApi.IPAddressBlock ip)
{
if(ConsumerKey == null)
throw new OvhException("This request must be authenticated");
Ensure.NotNull("zone",zone);
Ensure.NotNullNorEmpty("serviceName",serviceName);
Ensure.NotNull("ip",ip);
var requestBody = new Dictionary<string, object>();
requestBody.Add("zone",zone);
return await RawCall<OvhApi.Models.Vrack.Task>(HttpMethod.Post,String.Format("/vrack/{0}/ip/{1}/announceInZone",System.Uri.EscapeDataString(serviceName.ToString()).Replace("%2B", "+"),System.Uri.EscapeDataString(ip.ToString()).Replace("%2B", "+")),requestBody);
}
开发者ID:biapar,项目名称:ovhapicil,代码行数:20,代码来源:Operations.cs
示例17: CreateIpArpUnblock
/// <summary>
/// Unblock this IP
/// <param name="ip">To be written</param>
/// <param name="ipBlocked">your IP</param>
/// </summary>
public async Task CreateIpArpUnblock(OVHApi.IPAddressBlock ip,System.Net.IPAddress ipBlocked)
{
if(ConsumerKey == null)
throw new OvhException("This request must be authenticated");
Ensure.NotNull("ip",ip);
Ensure.NotNull("ipBlocked",ipBlocked);
await RawCall(HttpMethod.Post,String.Format("/ip/{0}/arp/{1}/unblock",System.Uri.EscapeDataString(ip.ToString()).Replace("%2B", "+"),System.Uri.EscapeDataString(ipBlocked.ToString()).Replace("%2B", "+")));
}
开发者ID:biapar,项目名称:ovhapicil,代码行数:16,代码来源:Operations.cs
示例18: GetDedicatedServerIpcanbemovedto
/// <summary>
/// Check if given IP can be moved to this server
/// <param name="ip">The ip to move to this server</param>
/// <param name="serviceName">The internal name of your dedicated server</param>
/// </summary>
public async Task GetDedicatedServerIpcanbemovedto(OVHApi.IPAddressBlock ip,string serviceName)
{
if(ConsumerKey == null)
throw new OvhException("This request must be authenticated");
Ensure.NotNull("ip",ip);
Ensure.NotNullNorEmpty("serviceName",serviceName);
var queryString = new QueryString();
queryString.Add("ip",ip);
await RawCall(HttpMethod.Get,String.Format("/dedicated/server/{0}/ipCanBeMovedTo{1}",System.Uri.EscapeDataString(serviceName.ToString()).Replace("%2B", "+"),queryString));
}
开发者ID:biapar,项目名称:ovhapicil,代码行数:18,代码来源:Operations.cs
示例19: GetIpSpamStats
/// <summary>
/// Get statistics about the email traffic
/// <param name="to">End date</param>
/// <param name="from">Start date</param>
/// <param name="ip">To be written</param>
/// <param name="ipSpamming">IP address which is sending spam</param>
/// </summary>
public async Task<OvhApi.Models.Ip.SpamStats[]> GetIpSpamStats(DateTime to,DateTime from,OVHApi.IPAddressBlock ip,System.Net.IPAddress ipSpamming)
{
if(ConsumerKey == null)
throw new OvhException("This request must be authenticated");
Ensure.NotNull("to",to);
Ensure.NotNull("from",from);
Ensure.NotNull("ip",ip);
Ensure.NotNull("ipSpamming",ipSpamming);
var queryString = new QueryString();
queryString.Add("to",to);
queryString.Add("from",from);
return await RawCall<OvhApi.Models.Ip.SpamStats[]>(HttpMethod.Get,String.Format("/ip/{0}/spam/{1}/stats{2}",System.Uri.EscapeDataString(ip.ToString()).Replace("%2B", "+"),System.Uri.EscapeDataString(ipSpamming.ToString()).Replace("%2B", "+"),queryString));
}
开发者ID:biapar,项目名称:ovhapicil,代码行数:23,代码来源:Operations.cs
示例20: CreateDedicatedServerFeaturesBackupftpAccess
/// <summary>
/// Create a new Backup FTP ACL
/// <param name="ftp">Wether to allow the FTP protocol for this ACL</param>
/// <param name="ipBlock">The IP Block specific to this ACL. It musts belong to your server.</param>
/// <param name="nfs">Wether to allow the NFS protocol for this ACL</param>
/// <param name="cifs">Wether to allow the CIFS (SMB) protocol for this ACL</param>
/// <param name="serviceName">The internal name of your dedicated server</param>
/// </summary>
public async Task<OvhApi.Models.Dedicated.Server.Task> CreateDedicatedServerFeaturesBackupftpAccess(OVHApi.IPAddressBlock ipBlock,bool nfs,bool cifs,string serviceName,bool? ftp = null)
{
if(ConsumerKey == null)
throw new OvhException("This request must be authenticated");
Ensure.NotNull("ipBlock",ipBlock);
Ensure.NotNull("nfs",nfs);
Ensure.NotNull("cifs",cifs);
Ensure.NotNullNorEmpty("serviceName",serviceName);
var requestBody = new Dictionary<string, object>();
requestBody.Add("ftp",ftp);
requestBody.Add("ipBlock",ipBlock);
requestBody.Add("nfs",nfs);
requestBody.Add("cifs",cifs);
return await RawCall<OvhApi.Models.Dedicated.Server.Task>(HttpMethod.Post,String.Format("/dedicated/server/{0}/features/backupFTP/access",System.Uri.EscapeDataString(serviceName.ToString()).Replace("%2B", "+")),requestBody);
}
开发者ID:biapar,项目名称:ovhapicil,代码行数:26,代码来源:Operations.cs
注:本文中的OVHApi类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论