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>
		/// 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 #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>
		/// 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 #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>
		/// 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 #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>
		/// 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);
		}
Example #9
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 #10
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 #11
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 #12
0
		/// <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));
		}
Example #13
0
		/// <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);
		}
Example #14
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 #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>
		/// 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 #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>
		/// 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));
		}
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>
		/// 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);
		}
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>
		/// 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 #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>
		/// 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 #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>
		/// Create a new Allowed network for your dedicatedCloud
		/// <param name="network">Network name, e.g. 123.100.200.0/32</param>
		/// <param name="serviceName">Domain of the service</param>
		/// </summary>
		public async Task<OvhApi.Models.DedicatedCloud.Task> CreateDedicatedcloudAllowednetwork(OVHApi.IPAddressBlock network,string serviceName)
		{
			if(ConsumerKey == null)
				throw new OvhException("This request must be authenticated");
			Ensure.NotNull("network",network);
			Ensure.NotNullNorEmpty("serviceName",serviceName);


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

return await RawCall<OvhApi.Models.DedicatedCloud.Task>(HttpMethod.Post,String.Format("/dedicatedCloud/{0}/allowedNetwork",System.Uri.EscapeDataString(serviceName.ToString()).Replace("%2B", "+")),requestBody);
		}
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>
		/// Your OVH IPs
		/// <param name="ip">Filter the value of ip property (contains or equals)</param>
		/// <param name="routedTo_serviceName">Filter the value of routedTo.serviceName property (like)</param>
		/// <param name="type">Filter the value of type property (=)</param>
		/// <param name="description">Filter the value of description property (like)</param>
		/// </summary>
		public async Task<OVHApi.IPAddressBlock[]> GetIps(string description = null,OvhApi.Models.Ip.IpTypeEnum? type = null,string routedTo_serviceName = null,OVHApi.IPAddressBlock ip = null)
		{
			if(ConsumerKey == null)
				throw new OvhException("This request must be authenticated");

			var queryString = new QueryString();
			queryString.Add("ip",ip);
			queryString.Add("routedTo.serviceName",routedTo_serviceName);
			queryString.Add("type",type);
			queryString.Add("description",description);


return await RawCall<OVHApi.IPAddressBlock[]>(HttpMethod.Get,String.Format("/ip{0}",queryString));
		}
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>
		/// 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));
		}