REST API

REST API

All product versions feature a REST API, which allows replications to be started from DevOps DLM tools such as Jenkins and GO. You can automate moving of RDS SQL Server databases (Oracle support coming soon) around from development and staging environments without access to RDS file system.

HTTP Post calls are supported, which allows DB replications to be started in Power Shell scripts.

 

API Test Client

Go to http://{InstanceIP}/apitest , then select the New Replication option (http://{InstanceIP}/apitest?action=newreplication)

HTTP Post Parameters:

action = newreplication

userid: i.e. admin

password:

connsource: i.e Data Source=vpone.cvbth4hzbsyvm.us-west-2.rds.amazonaws.com,1433;Initial Catalog=myDB;Persist Security Info=False;User ID=sa;Password=password;Connect Timeout=12800

conndestination: i.e. Data Source=replica21e.csyinqchmzc19.us-east-1.rds.amazonaws.com;Initial Catalog=myDB;Persist Security Info=False;User ID=destsa;Password=password;Connect Timeout=12800

postreplicationscript: optional- a SQL script to perform tasks after the initial replication is finished.

customcreatedbscript: option, i.e.

CREATE DATABASE [myDB]
 CONTAINMENT = NONE
 ON PRIMARY
 ( NAME = CHLA_Audit_E181, FILENAME = 'D:RDSDBDATADATACHLA_Audit_E18dat1.mdf', SIZE = 4000KB , MAXSIZE = UNLIMITED, FILEGROWTH = 10%),
 ( NAME = CHLA_Audit_E182, FILENAME = 'D:RDSDBDATADATACHLA_Audit_E18dat2.ndf', SIZE = 4000KB , MAXSIZE = UNLIMITED, FILEGROWTH = 10%),
 ( NAME = CHLA_Audit_E183, FILENAME = 'D:RDSDBDATADATACHLA_Audit_E18dat3.ndf', SIZE = 4000KB , MAXSIZE = UNLIMITED, FILEGROWTH = 10%)
 LOG ON
 ( NAME = CHLA_Audit_E18log1, FILENAME = 'D:RDSDBDATADATACHLA_Audit_E18log1.ldf', SIZE = 4000KB, MAXSIZE = UNLIMITED, FILEGROWTH = 10%),
 ( NAME = CHLA_Audit_E18log2, FILENAME = 'D:RDSDBDATADATACHLA_Audit_E18log2.ldf', SIZE = 4000KB , MAXSIZE = UNLIMITED, FILEGROWTH = 10%),
 ( NAME = CHLA_Audit_E18log3, FILENAME = 'D:RDSDBDATADATACHLA_Audit_E18log3.ldf', SIZE = 4000KB , MAXSIZE = UNLIMITED, FILEGROWTH = 10%)

replicatecompatibilitylevel: pass 1 or 0. Default is 1 - if the database being replicated has a compatibility level set (i.e. 90 /SQL 2005/) by default the replication process will try to create the destination database with the same compatibility level. Note: SQL Server 2014 and above do not support level 90.

Status of http post will be reported back in XML format, i.e.

<NewReplicationResult>
<ReplicationID>401271</ReplicationID>
<Status>Running</Status>
</NewReplicationResult>

If your DevOps tools need to check on the status of an initiated replication, then you need to do http post as follows:

http://{InstanceIP}/apitest?action=getreplicationstatus

action = getreplicationstatus

userid

password

replicationid: the ID from the XML tag above

Result will be provided back in XMlL format.