Example #1
1
		/// <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);
		}
Example #2
0
        /// <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", "+")));
        }
Example #3
0
		/// <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);
		}
Example #4
0
		/// <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));
		}
Example #5
0
		/// <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));
		}
Example #6
0
		/// <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", "+")));
		}
Example #7
0
		/// <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", "+")));
		}
Example #8
0
		/// <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", "+")));
		}
Example #9
0
		/// <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));
		}
Example #10
0
		/// <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", "+")));
		}
Example #11
0
		/// <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", "+")));
		}
Example #12
0
		/// <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);
		}
Example #13
0
		/// <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", "+")));
		}
Example #14
0
		/// <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));
		}
Example #15
0
		/// <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", "+")));
		}
Example #16
0
		/// <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", "+")));
		}
Example #17
0
		/// <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", "+")));
		}
Example #18
0
		/// <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", "+")));
		}
Example #19
0
		/// <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));
		}
Example #20
0
		/// <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);
		}
Example #21
0
		/// <summary>
		/// Generate a migration token
		/// <param name="customerId">destination customer ID</param>
		/// <param name="ip">To be written</param>
		/// </summary>
		public async Task<OvhApi.Models.Ip.IpMigrationToken> CreateIpMigrationtoken(string customerId,OVHApi.IPAddressBlock ip)
		{
			if(ConsumerKey == null)
				throw new OvhException("This request must be authenticated");
			Ensure.NotNullNorEmpty("customerId",customerId);
			Ensure.NotNull("ip",ip);


var requestBody = new Dictionary<string, object>();
requestBody.Add("customerId",customerId);

return await RawCall<OvhApi.Models.Ip.IpMigrationToken>(HttpMethod.Post,String.Format("/ip/{0}/migrationToken",System.Uri.EscapeDataString(ip.ToString()).Replace("%2B", "+")),requestBody);
		}
Example #22
0
		/// <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", "+")));
		}
Example #23
0
		/// <summary>
		/// Delete mitigation profile
		/// <param name="ip">To be written</param>
		/// <param name="ipMitigationProfile">To be written</param>
		/// </summary>
		public async Task DeleteIpMitigationprofiles(OVHApi.IPAddressBlock ip,System.Net.IPAddress ipMitigationProfile)
		{
			if(ConsumerKey == null)
				throw new OvhException("This request must be authenticated");
			Ensure.NotNull("ip",ip);
			Ensure.NotNull("ipMitigationProfile",ipMitigationProfile);



await RawCall(HttpMethod.Delete,String.Format("/ip/{0}/mitigationProfiles/{1}",System.Uri.EscapeDataString(ip.ToString()).Replace("%2B", "+"),System.Uri.EscapeDataString(ipMitigationProfile.ToString()).Replace("%2B", "+")));
		}
Example #24
0
		/// <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);
		}
Example #25
0
		/// <summary>
		/// Get this object properties
		/// <param name="ip">To be written</param>
		/// <param name="taskId">the id of the task</param>
		/// </summary>
		public async Task<OvhApi.Models.Ip.IpTask> GetIpTask(OVHApi.IPAddressBlock ip,long taskId)
		{
			if(ConsumerKey == null)
				throw new OvhException("This request must be authenticated");
			Ensure.NotNull("ip",ip);
			Ensure.IdIsValid("taskId",taskId);



return await RawCall<OvhApi.Models.Ip.IpTask>(HttpMethod.Get,String.Format("/ip/{0}/task/{1}",System.Uri.EscapeDataString(ip.ToString()).Replace("%2B", "+"),System.Uri.EscapeDataString(taskId.ToString()).Replace("%2B", "+")));
		}
Example #26
0
		/// <summary>
		/// Revoke this ACL
		/// <param name="serviceName">The internal name of your dedicated server</param>
		/// <param name="ipBlock">The IP Block specific to this ACL</param>
		/// </summary>
		public async Task<OvhApi.Models.Dedicated.Server.Task> DeleteDedicatedServerFeaturesBackupftpAccess(string serviceName,OVHApi.IPAddressBlock ipBlock)
		{
			if(ConsumerKey == null)
				throw new OvhException("This request must be authenticated");
			Ensure.NotNullNorEmpty("serviceName",serviceName);
			Ensure.NotNull("ipBlock",ipBlock);



return await RawCall<OvhApi.Models.Dedicated.Server.Task>(HttpMethod.Delete,String.Format("/dedicated/server/{0}/features/backupFTP/access/{1}",System.Uri.EscapeDataString(serviceName.ToString()).Replace("%2B", "+"),System.Uri.EscapeDataString(ipBlock.ToString()).Replace("%2B", "+")));
		}
Example #27
0
		/// <summary>
		/// Ip under mitigation
		/// <param name="auto">Filter the value of auto property (=)</param>
		/// <param name="state">Filter the value of state property (=)</param>
		/// <param name="ip">To be written</param>
		/// </summary>
		public async Task<System.Net.IPAddress[]> GetIpMitigations(OVHApi.IPAddressBlock ip,OvhApi.Models.Ip.MitigationStateEnum? state = null,bool? auto = null)
		{
			if(ConsumerKey == null)
				throw new OvhException("This request must be authenticated");
			Ensure.NotNull("ip",ip);

			var queryString = new QueryString();
			queryString.Add("auto",auto);
			queryString.Add("state",state);


return await RawCall<System.Net.IPAddress[]>(HttpMethod.Get,String.Format("/ip/{0}/mitigation{1}",System.Uri.EscapeDataString(ip.ToString()).Replace("%2B", "+"),queryString));
		}
Example #28
0
		/// <summary>
		/// Get this object properties
		/// <param name="serviceName">Domain of the service</param>
		/// <param name="network">IP ex: 213.186.33.34/24</param>
		/// </summary>
		public async Task<OvhApi.Models.DedicatedCloud.Ip> GetDedicatedcloudIp(string serviceName,OVHApi.IPAddressBlock network)
		{
			if(ConsumerKey == null)
				throw new OvhException("This request must be authenticated");
			Ensure.NotNullNorEmpty("serviceName",serviceName);
			Ensure.NotNull("network",network);



return await RawCall<OvhApi.Models.DedicatedCloud.Ip>(HttpMethod.Get,String.Format("/dedicatedCloud/{0}/ip/{1}",System.Uri.EscapeDataString(serviceName.ToString()).Replace("%2B", "+"),System.Uri.EscapeDataString(network.ToString()).Replace("%2B", "+")));
		}
Example #29
0
		/// <summary>
		/// Alter this object properties
		/// <param name="requestBody">New object properties</param>
		/// <param name="ip">To be written</param>
		/// <param name="ipOnMitigation">To be written</param>
		/// </summary>
		public async Task UpdateIpMitigation(OvhApi.Models.Ip.MitigationIp requestBody,OVHApi.IPAddressBlock ip,System.Net.IPAddress ipOnMitigation)
		{
			if(ConsumerKey == null)
				throw new OvhException("This request must be authenticated");
			Ensure.NotNull("requestBody",requestBody);
			Ensure.NotNull("ip",ip);
			Ensure.NotNull("ipOnMitigation",ipOnMitigation);



await RawCall(HttpMethod.Put,String.Format("/ip/{0}/mitigation/{1}",System.Uri.EscapeDataString(ip.ToString()).Replace("%2B", "+"),System.Uri.EscapeDataString(ipOnMitigation.ToString()).Replace("%2B", "+")),requestBody);
		}
Example #30
0
        /// <summary>
        /// AntiDDOS option. Delete IP from mitigation
        /// <param name="ip">To be writter</param>
        /// <param name="ipOnMitigation">To be writter</param>
        /// </summary>
        public OvhApi.Models.Ip.MitigationIp DeleteIpMitigation(OVHApi.IPAddressBlock ip,System.Net.IPAddress ipOnMitigation)
        {
            if(ConsumerKey == null)
                throw new OvhException("This request must be authenticated");
            Ensure.NotNull("ip",ip);
            Ensure.NotNull("ipOnMitigation",ipOnMitigation);

            return RawCall<OvhApi.Models.Ip.MitigationIp>(HttpMethod.Delete,String.Format("/ip/{0}/mitigation/{1}",System.Uri.EscapeDataString(ip.ToString()).Replace("%2B", "+"),System.Uri.EscapeDataString(ipOnMitigation.ToString()).Replace("%2B", "+")));
        }