HostingRaja API Developer Document

HostingRaja offers an API service that allows you to easily create cloud servers. However, before you can use our API service, you'll need to pay a security deposit of Rs. 1000/- from your client area dashboard. Once you've completed the payment, you can start creating cloud servers through our API, making it quick and easy to manage your cloud infrastructure. With our API service, you can easily scale your cloud servers up or down, add or remove resources, and much more, all from a simple and intuitive interface.


To generate API keys for accessing our API services, please follow these steps:

1) Log in to your client area using your HostingRaja credentials.

2) From the left-side menu, click on the "API" option.   

3) Click on the button provided to generate a payment link for making a security deposit.

 


4) Once you click the button to pay the security deposit, a payment link will be generated. You can then proceed to complete the payment by clicking on the link provided.



5) To access our API, you need to whitelist your IP address by providing a comma-separated list of your IP addresses.

.Once you generated the authorization token & secret key. You need to whitelist your IP address separated by comma to access our API

 

Note : Please note that if you do not whitelist your IP address using the above steps, you will not be able to connect to our API



API Access URL
: https://www.hostingraja.in/api

Authentication

You have to pass your auth token & secret key to each API request. For that use the below post request method for all API.


Post Request :


 
Parameter Type Description Required
auth_key string Your API Auth Token Required
secret_key string Your secret Key Required


   Example Request (CURL):

curl -X POST \
-H "Content-Type: application/json"  \
-d ' {
"auth_token": "YOUT_AUTH_TOKEN",
"secret_key": "YOUR_SECRET_KEY"
}' \

Get Available Images

This API will provide a list of Operating Systems that we offer for creating Cloud Servers.

Post Request :

 
Parameter Type Description Required
request string get Available Images Required

 

Example Request (CURL):

curl  -X POST \
  -H "Content-Type: application/json" \
  -d '{
       "request ": "getAvailableImage"
  }' \ 


:Response Format

.The API will respond with JSON data

Example response data:

{
   "status": "success",
   "available_image":
       {
 "centos7": "CentOS-7-x64", 
 "centos7": "CentOS-7-x64-cPanel",
  } 
}


:Create Server 

The Cloud deployment API streamlines the process of setting up and managing your Cloud infrastructure. It's fast, flexible, and secure, with built-in scalability and redundancy features. Whether you're deploying a small or large-scale Cloud environment, the Cloud deployment API makes it easy to get started and achieve your goals.

Post Request : 


 Parameter  Type  Description
 request  string  CreateVM
 hostname  string  Hostname for server
 configuration  

array[]

 Configuration Data in array, by passing below elements
 ram  int  Maximum 128 GB RAM for passing configuration array elements
 disk  int  Configuration array requires 40-1024 GB disk space.
 cpu  int  Max 16 CPU cores for configuration array
 bandwidth  int  Max 10 TB bandwidth for config array.
managed_support true/false Managed Support. Default will be false.
image string Output OS key name from "getAvailableImage"


Example Request (CURL):

curl -X POST \
-H "Content-Type: application/json" \
-d '{ "request": "CreateVM",

"data": {

            "hostname":
           "YOUR_HOST_NAME", 
"configuration": {
           "ram": 2,
          "cpu": 1,
       "disk": 50,

      "bandwidth": 2,

       "image":
       "ubuntu",

      “scaling” :
      “vertical”

    },

     “Managed_support” : true

   }
}' \

Response Format:

The API will respond with JSON data.

Example response data:



{
"status": "success",
"vmid": "1234",
"message":
"Server creation initiated successfully. You will get credentials shortly."
   
}  


Get My Servers

This API returns a list of servers that were created using the API request.

Post Request :  

Parameter Type Description Required
request string getMyServers Required
product_id int To get Specific server Required


Example Request (CURL):
curl -X POST \
-H "Content-Type: application/json" \
-d '{ 
"request": "getMyServers",

“data”
‘{
“product_id” : 1234
}’\
}' \

Response Format:
The API will respond with JSON data.
Example response data:

{
"status": "success",
"Data" :
{
“product_id1” :
{
“product_id” : 1234,
“hostname” : “example1.com”,
“product_status” : “Active”,
“created_on” : “2023-02-24”,
“expired_on” : “2023-03-24”,
“plan_name” : “Custom Cloud Server”,
“configuration” : {
“image” : “Windows 2019”,
“ram” : “10 GB”,
“core” : “10 Core”,
“disk” : “500 GB”,
“band” : “1 TB”
},
“current_status” : “Current Server status as per API request”,
},
“product_id2”
{
“product_id” : 4567,
“hostname” : “example2.com”,
“product_status” : “Product Status of HostingRaja”,
“created_on” : “2023-02-24”,
“expired_on” : “2023-03-24”,
“plan_name” : “Custom Cloud Server”,

“configuration” : {
“image” : “Windows 2019”,
“ram” : “10 GB”,
“core” : “10 Core”,
“disk” : “500 GB”,
“band” : “1 TB”
}
“Addons” :
{
“addon_id1” :
{
“addon_id1”: “1234”,
“addon_name” : “Managed Support”,
“”recurring” : “500”,
“billingcycle” : “Monthly”,
“regdate” : “2023-02-25”,
“nextduedate” : “2023-03-25”
}
},
“current_status” : “Current Server status as per API request”,
}
}
}

getMaxServerCount

This API allocates a specified number of servers for creation, with a maximum limit of 10.

Post Request : 

 Parameter  Type  Description  Required
request string startServer Required
product_id int Product id to be start Required

Example Request (CURL):

curl -X POST \
-H "Content-Type: application/json"
-d '{
"request ": "getMaxServerCount"
}' \

Response Format: 

The API will respond with JSON data.

Example response data:

{
"status": "success",
"count": “count in number”
}

stopServer

With this API, you can initiate a server stop action to gracefully shut down your server. This API ensures that all processes are terminated and any pending data is saved before shutting down the server.

Post Request : 

Parameter Type Description Required
request string stopServer Required
product_id int Product id to be stop Required

Example Request (CURL):
curl -X POST \
-H "Content-Type: application/json"
-d '{
"request ": "stopServer"
“data” ‘{
"product_id": "1234",
}’

}' \

Response Format: 

The API will respond with JSON data.

Example response data:

{
"status": "success"
}

startServer

This API allows you to start your server after it has been stopped or shut down. The API initiates the boot process of the server, allowing it to become operational again.

Post Request : 

 Parameter  Type  Description  Required
request string startServer Required
product_id int Product id to be start Required

Example Request (CURL)

curl -X POST \
-H "Content-Type: application/json"
-d '{
"request ": "startServer"
“data” ‘{
"product_id": "1234",
}’

}' \

Response Format: 

The API will respond with JSON data.

Example response data:

{
"status": "success"
}

rebootServer

Use this API to initiate a server reboot. When you reboot your server, it shuts down and then automatically starts back up, allowing any pending updates or changes to take effect.

Post Request :


 Parameter  Type  Description  Required
request string rebootServer Required
product_id int Product id to be stop Required

Example Request (CURL)

curl -X POST \
-H "Content-Type: application/json"
-d '{
"request ": "rebootServer"
“data” ‘{
"product_id": "1234",
}’

}' \

Response Format: 

The API will respond with JSON data.

Example response data:

{
"status": "success"
}

suspendServer

This API initiates a server suspension action, which saves the current state of the server and stops all processes, allowing you to temporarily halt your server. When you're ready to resume operations, you can use the start API to boot the server backup and restore its state to the point of suspension.

Post Request : 

 Parameter  Type  Description  Required
request string suspendServer Required
product_id int

Product id to be suspend

Required

Example Request (CURL)

curl -X POST \
-H "Content-Type: application/json"
-d '{
"request ": "suspendServer"
“data” ‘{
"product_id": "1234",
}’

}' \

Response Format: 

The API will respond with JSON data.

Example response data:

{
"status": "success"
}

unsuspendServer

Use this API to unsuspend your server.

When a server is suspended, it is in a halted state, and all processes are stopped. Using the unsuspend API initiates the process of resuming the server, allowing you to restore the state of the server to the point at which it was suspended.

Post Request : 

 Parameter  Type  Description  Required
request string unsuspendServer Required
product_id int

Product id to be un suspend

Required

Example Request (CURL)

curl -X POST \
-H "Content-Type: application/json"
-d '{
"request ": "unsuspendServer"
“data” ‘{
"product_id": "1234",
}’

}' \

Response Format: 

The API will respond with JSON data.

Example response data:

{
"status": "success"
}

terminateServer

This API allows you to initiate a server termination action, which permanently deletes the server and all associated data. It is an irreversible action, so be sure to take any necessary backups or data exports before proceeding with the termination.

Post Request :

 Parameter Type  Description Required 
request string terminateServer Required
product_id int Product id to be delete Required

Example Request (CURL)

curl -X POST \
-H "Content-Type: application/json"
-d '{
"request ": "terminateServer"
“data” ‘{
"product_id": "1234",
}’

}' \

Response Format: 

The API will respond with JSON data.

Example response data:

{
"status": "success"
}

Recreate Server

This API will be used to recreate your server. It will delete the current server and create a new server with the same configuration.

So make sure that you have taken backup of the current server, before proceeding with the recreate server.

Post Request : 

Parameter Type Description Required
request string recreateServer Required
product_id int Product id to be recreate Required

Example Request (CURL):

curl -X POST \
-H "Content-Type: application/json"
-d '{
"request ": "recreateServer"
“data”
‘{

"product_id": "1234",

}’


}' \

Response Format: 

The API will respond with JSON data.

Example response data:

{
"status": "success"
}

CREATE - SQL - Database

Using SQL Server Management Studio:

The SQL Server Management studio (SSMS) is a platform used for managing and administering SQL server instances and databases. It allows database administrators, developers, and users to connect to SQL Server instances and perform various tasks such as creating, modifying, and deleting tables, views, store procedures, and other database objects.

Following are steps to create a database using the SQL Server Management Studio −

Step 1− Open the SQL Server Management Studio in your system and connect to the SQL Server instance where you want to create the database.

Step 2− In the Object Explorer, right click on the “Databases” option and click on the “New Database”.


Step 3− A “New Database” dialog box will be opened.




Step 4− Enter a name for the new database that you want to create in the “Database name field”.

Step 5− To create the database with default values, click “OK”; otherwise, continue with the following optional steps.

 

 

Step 6− If you want to specify a different owner for the database, click on the “…” button next to the “Owner” fiels and select a different owner.

 

Step 7− If you want to change the default values of the primary data and transaction log files in the “Database files” grid, select the particular cell and enter the new value.


 

Step 8− If you want to change the collation of the database, select the options page on the top-left corner and then select a collation from the list.

 

Step 9− If you want to change the recovery model of the database, select the options page and then select a recovery model from the list.



Step 10− If you want to change the database options, select the options page and then modify the database options.


Step 11− If you want to add a filegroup, select the “Filegroups” page on the top-left corner. Then Select “Add Filegroup” and then enter the values for the file group.


 

Step 12− Now, click on “OK” to create the database.


 





How to Reset SA Password in SQL Server:


Log in to your VPS via Remote Desktop. Please refer to how to reset password in windows VPS using RDP for more details.

 

 1. Please login your rdp 

 

2. Open SQL Server Management Studio.

 

4. The Connect to Server dialog opens. Select Windows Authentication and select Connect to log into the server dashboard.



5. The Object Explorer opens. The SQL Server Instance name opens and several options should expand below it. If the list doesn’t expand, click on the [+] icon to expand it.

6. Click on the [+] beside Security to expand the folder.

7. Click on the [+] beside Logins to expand the folder.



8. Double-click on the user login; [sa].  The properties window for the login [sa] opens.

 

9. Enter the new password and enter again to confirm. Note that the deSfault  password used in the original install is [RPSsql12345].

10.Press OK.

11.  Disconnect from the database instance.

12. Reconnect to the database instance using the SQL Server Authentication,    the user name SA,  and the new password.

 

NOTE=   once reset the password if it's not working, please restart  the SQL Server and  check

 


Add A, MX, And Nameservers Records To DNS Zone:


A Records:

  1. In order to add A records to DNS Zone, right-click on the DNS Zone name and select New Host (A or AAAA). A specifies that you are adding an IP version 4 (IPv4) host resource record type of the record. AAAA specifies that you are adding an IP version 6 (IPv6)host resource record type of the record.

  1. In New Host Window, enter the name of the record (If you keep it blank, it will use the parent domain).

  1. Enter the IP address of your server name. If you check the checkbox Create Associated pointer (PTR) Record and click Add Host, you may receive a dialog box that appears with the message You can only create PTR records if the corresponding reverse lookup zone is available. This error indicates that you have not created a corresponding reverse lookup zone, created with an incorrect zone name or network ID.

    In some cases, ISP or Web Hosting providers do not allow the end customers to add a reverse lookup zone. In such cases, even if you add a reverse lookup zone, it would not get into effect until your ISP/Web Hosting providers add them at the main DNS Zone. By checking this option, A record will be created without creating a corresponding PTR record. By following the steps, you need to add the following A records.

  • *.........(*.yourdomainname.com)...........Host-IP-Address
  • FTP......(FTP.yourdomainname.com)........Host-IP-Address
  • WWW...(WWW.yourdomainname.com)....Host-IP-Address
  • Mail......(Mail.yourdomainname.com).......Host-IP-Address
4. To edit/delete existing records, select the DNS record your wish to edit/delete and right-click on it. Click the Delete button to delete it and the Properties button to edit it.

MX Record:

  1. In order to add MX records to DNS Zone, right-click on the Zone name and select New Mail Exchanger (MX) record.


2. Keep the Host or Child Domain field blank. Enter the Fully Qualified Domain Name (mail.yourdomainname.com) of the mail server and set priority ( 0 = Highest priority ). Similarly, you can also add CNAME and other new records.




Update Nameservers:

  1. Double-click on Zone name, and Click on Name Server (NS) type.



    2. Select the Name Server tab. Select  "Fully Qualified Domain name" and click on Edit.




    3. Enter your desired nameservers and add an IP address. Repeat the above steps for other nameservers. Please note that you can use the same or different IP address for both nameservers. If your domain registrar is giving an error of the same IP address, then you have to purchase an additional IP address.

 

 

 Add A New DNS Zone And Manage DNS Records For A Domain Hosted On Windows VPS in RDP:

This tutorial will assist you in adding a new DNS Zone, add/edit/delete various DNS records in DNS Zone,


  1. Log in to your VPS via Remote Desktop. Please refer to how to connect  windows VPS using RDP for more details.

  1. Go to Start  >> Administrative Tools >> DNS.



  1. Expand the server tab [name of your computer, e.g., HV01ACCU100].

  1. Right-click on Forward Lookup Zones and click on New Zone.




2.Click on Next.



3.Select the zone type as Primary zone and click on Next.



Type your domain name in New Zone Wizard dialog box, e.g., yourdomainname.com.



Select Create a new file with this file name option under Zone File.


Check Do not Allow Dynamic Updates and click Next