本文整理汇总了C#中OVHApi.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# OVHApi.ToString方法的具体用法?C# OVHApi.ToString怎么用?C# OVHApi.ToString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OVHApi
的用法示例。
在下文中一共展示了OVHApi.ToString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例2: DeleteIpReverse
/// <summary>
/// Delete a reverse on one IP
/// <param name="ip">To be writter</param>
/// <param name="ipReverse">To be writter</param>
/// </summary>
public void DeleteIpReverse(OVHApi.IPAddressBlock ip,System.Net.IPAddress ipReverse)
{
if(ConsumerKey == null)
throw new OvhException("This request must be authenticated");
Ensure.NotNull("ip",ip);
Ensure.NotNull("ipReverse",ipReverse);
RawCall(HttpMethod.Delete,String.Format("/ip/{0}/reverse/{1}",System.Uri.EscapeDataString(ip.ToString()).Replace("%2B", "+"),System.Uri.EscapeDataString(ipReverse.ToString()).Replace("%2B", "+")));
}
示例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);
}
示例4: 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));
}
示例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));
}
示例6: 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", "+")));
}
示例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", "+")));
}
示例8: 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", "+")));
}
示例9: GetIpFirewallRuleIds
/// <summary>
/// Rules for this IP
/// <param name="state">Filter the value of state property (=)</param>
/// <param name="ip">To be written</param>
/// <param name="ipOnFirewall">To be written</param>
/// </summary>
public async Task<long[]> GetIpFirewallRuleIds(OVHApi.IPAddressBlock ip,System.Net.IPAddress ipOnFirewall,OvhApi.Models.Ip.FirewallRuleStateEnum? state = null)
{
if(ConsumerKey == null)
throw new OvhException("This request must be authenticated");
Ensure.NotNull("ip",ip);
Ensure.NotNull("ipOnFirewall",ipOnFirewall);
var queryString = new QueryString();
queryString.Add("state",state);
return await RawCall<long[]>(HttpMethod.Get,String.Format("/ip/{0}/firewall/{1}/rule{2}",System.Uri.EscapeDataString(ip.ToString()).Replace("%2B", "+"),System.Uri.EscapeDataString(ipOnFirewall.ToString()).Replace("%2B", "+"),queryString));
}
示例10: DeleteIpGameRule
/// <summary>
/// Delete rule
/// <param name="ip">To be written</param>
/// <param name="ipOnGame">To be written</param>
/// <param name="id">ID of the rule</param>
/// </summary>
public async Task<OvhApi.Models.Ip.GameMitigationRule> DeleteIpGameRule(OVHApi.IPAddressBlock ip,System.Net.IPAddress ipOnGame,long id)
{
if(ConsumerKey == null)
throw new OvhException("This request must be authenticated");
Ensure.NotNull("ip",ip);
Ensure.NotNull("ipOnGame",ipOnGame);
Ensure.IdIsValid("id",id);
return await RawCall<OvhApi.Models.Ip.GameMitigationRule>(HttpMethod.Delete,String.Format("/ip/{0}/game/{1}/rule/{2}",System.Uri.EscapeDataString(ip.ToString()).Replace("%2B", "+"),System.Uri.EscapeDataString(ipOnGame.ToString()).Replace("%2B", "+"),System.Uri.EscapeDataString(id.ToString()).Replace("%2B", "+")));
}
示例11: DeleteIpFirewall
/// <summary>
/// AntiDDOS option. Delete IP and rules from firewall
/// <param name="ip">To be written</param>
/// <param name="ipOnFirewall">To be written</param>
/// </summary>
public async Task<string> DeleteIpFirewall(OVHApi.IPAddressBlock ip,System.Net.IPAddress ipOnFirewall)
{
if(ConsumerKey == null)
throw new OvhException("This request must be authenticated");
Ensure.NotNull("ip",ip);
Ensure.NotNull("ipOnFirewall",ipOnFirewall);
return await RawCall<string>(HttpMethod.Delete,String.Format("/ip/{0}/firewall/{1}",System.Uri.EscapeDataString(ip.ToString()).Replace("%2B", "+"),System.Uri.EscapeDataString(ipOnFirewall.ToString()).Replace("%2B", "+")));
}
示例12: CreateIpGameRule
/// <summary>
/// Add new rule on your IP
/// <param name="protocol">The protocol running behind the given port</param>
/// <param name="ports">The UDP port range to apply the rule on</param>
/// <param name="ip">To be written</param>
/// <param name="ipOnGame">To be written</param>
/// </summary>
public async Task<OvhApi.Models.Ip.GameMitigationRule> CreateIpGameRule(OvhApi.Models.Ip.GameMitigationRuleProtocolEnum protocol,OvhApi.Models.ComplexType.Range<long> ports,OVHApi.IPAddressBlock ip,System.Net.IPAddress ipOnGame)
{
if(ConsumerKey == null)
throw new OvhException("This request must be authenticated");
Ensure.NotNull("protocol",protocol);
Ensure.NotNull("ports",ports);
Ensure.NotNull("ip",ip);
Ensure.NotNull("ipOnGame",ipOnGame);
var requestBody = new Dictionary<string, object>();
requestBody.Add("protocol",protocol);
requestBody.Add("ports",ports);
return await RawCall<OvhApi.Models.Ip.GameMitigationRule>(HttpMethod.Post,String.Format("/ip/{0}/game/{1}/rule",System.Uri.EscapeDataString(ip.ToString()).Replace("%2B", "+"),System.Uri.EscapeDataString(ipOnGame.ToString()).Replace("%2B", "+")),requestBody);
}
示例13: GetIpGameRuleIds
/// <summary>
/// IDs of rules configured for this IP
/// <param name="ip">To be written</param>
/// <param name="ipOnGame">To be written</param>
/// </summary>
public async Task<long[]> GetIpGameRuleIds(OVHApi.IPAddressBlock ip,System.Net.IPAddress ipOnGame)
{
if(ConsumerKey == null)
throw new OvhException("This request must be authenticated");
Ensure.NotNull("ip",ip);
Ensure.NotNull("ipOnGame",ipOnGame);
return await RawCall<long[]>(HttpMethod.Get,String.Format("/ip/{0}/game/{1}/rule",System.Uri.EscapeDataString(ip.ToString()).Replace("%2B", "+"),System.Uri.EscapeDataString(ipOnGame.ToString()).Replace("%2B", "+")));
}
示例14: GetIpMitigationTopstreams
/// <summary>
/// AntiDDOS option. Get top stream on your ip on a specific timestamp
/// <param name="date">Date to view top traffic</param>
/// <param name="scale">Scale of aggregation</param>
/// <param name="ip">To be written</param>
/// <param name="ipOnMitigation">To be written</param>
/// </summary>
public async Task<OvhApi.Models.Ip.MitigationDetailedStats[]> GetIpMitigationTopstreams(DateTime date,OvhApi.Models.Ip.MitigationStatsScaleEnum scale,OVHApi.IPAddressBlock ip,System.Net.IPAddress ipOnMitigation)
{
if(ConsumerKey == null)
throw new OvhException("This request must be authenticated");
Ensure.NotNull("date",date);
Ensure.NotNull("scale",scale);
Ensure.NotNull("ip",ip);
Ensure.NotNull("ipOnMitigation",ipOnMitigation);
var queryString = new QueryString();
queryString.Add("date",date);
queryString.Add("scale",scale);
return await RawCall<OvhApi.Models.Ip.MitigationDetailedStats[]>(HttpMethod.Get,String.Format("/ip/{0}/mitigation/{1}/topStream{2}",System.Uri.EscapeDataString(ip.ToString()).Replace("%2B", "+"),System.Uri.EscapeDataString(ipOnMitigation.ToString()).Replace("%2B", "+"),queryString));
}
示例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", "+")));
}