Пример #1
0
        /// <summary>
        /// Create A-record.
        /// </summary>
        /// <param name="domainID">Domain ID.</param>
        /// <param name="hostname">Domain name or @ symbol.</param>
        /// <param name="priority">Record priority.</param>
        /// <param name="ttl">Time to live (in seconds).</param>
        /// <param name="success">Callback for successfull result.</param>
        /// <param name="failure">Callback for failure.</param>
        public void CreateMXRecord(int domainID, string hostname, string priority, string ttl, Action <Domain> success, Action <OneCloudException> failure)
        {
            var request = _requestHelper.CreateCreateMXRecordRequest(domainID, hostname, priority, ttl);

            ExecuteAsync(request, success, failure);
        }
Пример #2
0
        /// <summary>
        /// Get server info by ID.
        /// </summary>
        /// <param name="domainID">Domain unique ID.</param>
        /// <param name="success">Callback for successfull result.</param>
        /// <param name="failure">Callback for failure.</param>
        public void GetDomain(int domainID, Action <Domain> success, Action <OneCloudException> failure)
        {
            var request = _requestHelper.CreateGetDomainRequest(domainID);

            ExecuteAsync(request, success, failure);
        }
Пример #3
0
        /// <summary>
        /// Create new domain.
        /// </summary>
        /// <param name="name">Domain name.</param>
        /// <param name="success">Callback for successfull result.</param>
        /// <param name="failure">Callback for failure.</param>
        public void CreateDomain(string name, Action <Domain> success, Action <OneCloudException> failure)
        {
            var request = _requestHelper.CreateCreateDomainRequest(name);

            ExecuteAsync(request, success, failure);
        }
Пример #4
0
        /// <summary>
        /// Delete network.
        /// </summary>
        /// <param name="networkID">Network ID.</param>
        /// <param name="success">Callback for successfull result.</param>
        /// <param name="failure">Callback for failure.</param>
        public void DeleteNetwork(int networkID, Action <IRestResponse> success, Action <OneCloudException> failure)
        {
            var request = _requestHelper.CreateDeleteNetworkRequest(networkID);

            ExecuteAsync(request, success, failure);
        }
Пример #5
0
        /// <summary>
        /// Get account info.
        /// </summary>
        /// <param name="success"></param>
        /// <param name="failure"></param>
        public void GetAccount(Action <Account> success, Action <OneCloudException> failure)
        {
            var request = _requestHelper.CreateGetAccountRequest();

            ExecuteAsync(request, success, failure);
        }
Пример #6
0
        /// <summary>
        /// Create SRV-record.
        /// </summary>
        /// <param name="domainID">Domain ID.</param>
        /// <param name="service">Service name.</param>
        /// <param name="proto">Used protocol.</param>
        /// <param name="name">Domain name.</param>
        /// <param name="priority">Target host priority.</param>
        /// <param name="weight">Record weight.</param>
        /// <param name="port">Used port.</param>
        /// <param name="target">Canonical computer name of service.</param>
        /// <param name="ttl">Time to live (in seconds).</param>
        /// <param name="success">Callback for successfull result.</param>
        /// <param name="failure">Callback for failure.</param>
        public void CreateSRVRecord(int domainID, string service, string proto, string name, string priority, string weight, string port, string target, string ttl, Action <Domain> success, Action <OneCloudException> failure)
        {
            var request = _requestHelper.CreateCreateSRVRecordRequest(domainID, service, proto, name, priority, weight, port, target, ttl);

            ExecuteAsync(request, success, failure);
        }
Пример #7
0
        /// <summary>
        /// Delete image.
        /// </summary>
        /// <param name="imageID">Image ID.</param>
        /// <param name="success">Callback for successfull result.</param>
        /// <param name="failure">Callback for failure.</param>
        public void DeleteImage(int imageID, Action <IRestResponse> success, Action <OneCloudException> failure)
        {
            var request = _requestHelper.CreateDeleteImageRequest(imageID);

            ExecuteAsync(request, success, failure);
        }
Пример #8
0
        /// <summary>
        /// Change server configuration.
        /// </summary>
        /// <param name="serverID">Server ID.</param>
        /// <param name="cpu">Number of CPU.</param>
        /// <param name="ram">Volume of RAM (Mb).</param>
        /// <param name="hdd">Hard disk space (Gb).</param>
        /// <param name="hddType">HDD type of server.</param>
        /// <param name="isHighPerformance">True if server is located in highperformance pool.</param>
        /// <param name="success">Callback for successfull result.</param>
        /// <param name="failure">Callback for failure.</param>
        public void ChangeServer(int serverID, int cpu, int ram, int hdd, string hddType, bool isHighPerformance, Action <Action> success, Action <OneCloudException> failure)
        {
            var request = _requestHelper.CreateChangeServerRequest(serverID, cpu, ram, hdd, hddType, isHighPerformance);

            ExecuteAsync(request, success, failure);
        }
Пример #9
0
        /// <summary>
        /// Delete server.
        /// </summary>
        /// <param name="serverID">Server ID.</param>
        /// <param name="success">Callback for successfull result.</param>
        /// <param name="failure">Callback for failure.</param>
        public void DeleteServer(int serverID, Action <IRestResponse> success, Action <OneCloudException> failure)
        {
            var request = _requestHelper.CreateDeleteServerRequest(serverID);

            ExecuteAsync(request, success, failure);
        }
Пример #10
0
        /// <summary>
        /// Delete server.
        /// </summary>
        /// <param name="keyID">SSHKey ID.</param>
        /// <param name="success">Callback for successfull result.</param>
        /// <param name="failure">Callback for failure.</param>
        public void DeleteSSHKey(int keyID, Action <IRestResponse> success, Action <OneCloudException> failure)
        {
            var request = _requestHelper.CreateDeleteSSHKeyRequest(keyID);

            ExecuteAsync(request, success, failure);
        }
Пример #11
0
        /// <summary>
        /// Create new server.
        /// </summary>
        /// <param name="name">Server name.</param>
        /// <param name="cpu">Number of CPU.</param>
        /// <param name="ram">Volume of RAM (Mb).</param>
        /// <param name="hdd">Hard disk space (Gb).</param>
        /// <param name="imageID">Initial image ID.</param>
        /// <param name="hddType">HDD type of server.</param>
        /// <param name="isHighPerformance">True if server is located in highperformance pool.</param>
        /// <param name="dcLocation">Data center technical title.</param>
        /// <param name="success">Callback for successfull result.</param>
        /// <param name="failure">Callback for failure.</param>
        public void CreateServer(string name, int cpu, int ram, int hdd, string imageID, string hddType, bool isHighPerformance, string dcLocation, Action <Server> success, Action <OneCloudException> failure)
        {
            var request = _requestHelper.CreateCreateServerRequest(name, cpu, ram, hdd, imageID, hddType, isHighPerformance, dcLocation);

            ExecuteAsync(request, success, failure);
        }
Пример #12
0
        /// <summary>
        /// Create new server.
        /// </summary>
        /// <param name="name">SSHKey name.</param>
        /// <param name="cpu">Number of CPU.</param>
        /// <param name="ram">Volume of RAM (Mb).</param>
        /// <param name="hdd">Hard disk space (Gb).</param>
        /// <param name="imageID">Initial image ID.</param>
        /// <param name="hddType">HDD type of server.</param>
        /// <param name="isHighPerformance">True if server is located in highperformance pool.</param>
        /// <param name="dcLocation">Data center technical title.</param>
        /// <param name="success">Callback for successfull result.</param>
        /// <param name="failure">Callback for failure.</param>
        public void CreateSSHKey(string title, string publicKey, Action <SSHKey> success, Action <OneCloudException> failure)
        {
            var request = _requestHelper.CreateCreateSSHKeyRequest(title, publicKey);

            ExecuteAsync(request, success, failure);
        }
Пример #13
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="success"></param>
        /// <param name="failure"></param>
        public void Balance(Action <string> success, Action <OneCloudException> failure)
        {
            var request = _requestHelper.CreateBalanceRequest();

            ExecuteAsync(request, success, failure);
        }
Пример #14
0
        /// <summary>
        /// Get server info by ID.
        /// </summary>
        /// <param name="keyID">SSHKey unique ID.</param>
        /// <param name="success">Callback for successfull result.</param>
        /// <param name="failure">Callback for failure.</param>
        public void GetSSHKey(int keyID, Action <SSHKey> success, Action <OneCloudException> failure)
        {
            var request = _requestHelper.CreateGetSSHKeyRequest(keyID);

            ExecuteAsync(request, success, failure);
        }
Пример #15
0
        /// <summary>
        /// Create A-record.
        /// </summary>
        /// <param name="domainID">Domain ID.</param>
        /// <param name="name">Domain name or @ symbol.</param>
        /// <param name="text">Text.</param>
        /// <param name="ttl">Time to live (in seconds).</param>
        /// <param name="success">Callback for successfull result.</param>
        /// <param name="failure">Callback for failure.</param>
        public void CreateTXTRecord(int domainID, string name, string text, string ttl, Action <Domain> success, Action <OneCloudException> failure)
        {
            var request = _requestHelper.CreateCreateTXTRecordRequest(domainID, name, text, ttl);

            ExecuteAsync(request, success, failure);
        }
Пример #16
0
        /// <summary>
        /// Action for power server.
        /// </summary>
        /// <param name="serverID">Server ID.</param>
        /// <param name="type">Type of action.</param>
        /// <param name="success">Callback for successfull result.</param>
        /// <param name="failure">Callback for failure.</param>
        public void PowerServer(int serverID, Power type, Action <Action> success, Action <OneCloudException> failure)
        {
            var request = _requestHelper.CreatePowerServerRequest(serverID, type.ToString());

            ExecuteAsync(request, success, failure);
        }
Пример #17
0
        /// <summary>
        /// Delete record for domain.
        /// </summary>
        /// <param name="domainID">Domain ID.</param>
        /// <param name="recordID">Record ID.</param>
        /// <param name="success">Callback for successfull result.</param>
        /// <param name="failure">Callback for failure.</param>
        public void DeleteRecord(int domainID, int recordID, Action <IRestResponse> success, Action <OneCloudException> failure)
        {
            var request = _requestHelper.CreateDeleteRecordRequest(domainID, recordID);

            ExecuteAsync(request, success, failure);
        }
Пример #18
0
        /// <summary>
        /// Action for connecting/disconnecting server network.
        /// </summary>
        /// <param name="serverID">Server ID.</param>
        /// <param name="type">Type of action.</param>
        /// <param name="networkID">Private network ID.</param>
        /// <param name="success">Callback for successfull result.</param>
        /// <param name="failure">Callback for failure.</param>
        public void ServerNetwork(int serverID, NetworkAction type, int?networkID, Action <Action> success, Action <OneCloudException> failure)
        {
            var request = _requestHelper.CreateServerNetworkRequest(serverID, type.ToString(), networkID);

            ExecuteAsync(request, success, failure);
        }
Пример #19
0
        /// <summary>
        /// Create server image.
        /// </summary>
        /// <param name="success">Callback for successfull result.</param>
        /// <param name="failure">Callback for failure.</param>
        /// <param name="name">User-defined image name.</param>
        /// <param name="techName">Technical image name (only latin symbols and digits).</param>
        /// <param name="serverID">Server ID.</param>
        public void CreateImage(string name, string techName, int serverID, Action <Image> success, Action <OneCloudException> failure)
        {
            var request = _requestHelper.CreateCreateImageRequest(name, techName, serverID);

            ExecuteAsync(request, success, failure);
        }
Пример #20
0
        /// <summary>
        /// Get information about action by ID.
        /// </summary>
        /// <param name="serverID">Server ID.</param>
        /// <param name="actionID">Action ID.</param>
        /// <param name="success">Callback for successfull result.</param>
        /// <param name="failure">Callback for failure.</param>
        public void GetAction(int serverID, int actionID, Action <Action> success, Action <OneCloudException> failure)
        {
            var request = _requestHelper.CreateGetActionRequest(serverID, actionID);

            ExecuteAsync(request, success, failure);
        }
Пример #21
0
        /// <summary>
        /// Get list of networks.
        /// </summary>
        public void GetNetworks(Action <List <Network> > success, Action <OneCloudException> failure)
        {
            var request = _requestHelper.CreateGetNetworksRequest();

            ExecuteAsync(request, success, failure);
        }
Пример #22
0
        /// <summary>
        /// Get network info by ID.
        /// </summary>
        /// <param name="networkID">Network unique ID.</param>
        /// <param name="success">Callback for successfull result.</param>
        /// <param name="failure">Callback for failure.</param>
        public void GetNetwork(int networkID, Action <Network> success, Action <OneCloudException> failure)
        {
            var request = _requestHelper.CreateGetNetworkRequest(networkID);

            ExecuteAsync(request, success, failure);
        }