2022

Page tree
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

What is REST API?

The ApiCode distribution REST API provide programmatic access to read and write replication data. The REST API identifies the application and its users using OAUTH  ; responses are available in json.  We have used SWAGGER editor for the end users to make the API calls so that they can try out APIs exposed by API management platform. 

Click Here for accessing the CW-API management platform for unregistered user.

Checklist Before Getting Started 

  1. user should have the release of 4.2.9 or later .
  2. valid credentials of DBSync API management platform 
  3. valid credentials of bitbucket

There are various API methods list which are exposed for this release , we will be adding more methods in the upcoming releases . 

Apicode-Distribution

The Apicode-distribution is an API which is used to deploy Apicode based rest services from a git repository to the underlying Api management server.

The below tables explains the various model schema and attributes which form the model class 

Apicode Server Params

Parameter

Description

Data Type

apiCodeServerUsername(optional)

The username of the ApiCode server instance

string

apiCodeServerPassword(optional)

The password of the ApiCode server instance

string 

environment(optional)

User has the flexibility to define his/her environment in which he wishes to deploy his code base

string

Git Repository Params

Parameter

Description

Data Type

url(optional)

The git repository url of the user from which he would like to deploy the code base

string

branch(optional)

The branch inside of a repository from which the user wishes to deploy the code base

string

username(optional)

Valid user name of the git repository

string

password(optional)

Valid password of the git repository

string

Run Properties Params

Below table gives the attribute list of the response class

Parameter

Description

Data type

ServiceURL(optional)

The possible values are True and False which sends out the response value

String

docURL(optional)

The API submitted time

Date

SwaggerURL(optional)

The API Completion Time

Date

status(optional)

The process id which is sent by the API to identify the process

String

<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="11993f1f-f114-4743-9a4e-c0a3599a60eb"><ac:plain-text-body><![CDATA[

errorMessage(optional)

The url is passed from the API

Array[string]

]]></ac:plain-text-body></ac:structured-macro>

Example For Un Sucessful Deployment
Curl
curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{"appCodeServerUsername":"anil.b@mydbsync.com","appCodeServerPassword":"dbsync2015","environment":"dev","url":"https://sureshullagaddi@bitbucket.org/dbsync/amazons3.git","branch":"dev","username":"suresh.u@avankia.com","password":"suresh@12345"}' 'https://staging.mydbsync.com:443/api/appcode/v1/appcode-distribution/gitCompile'

Request URL
https://staging.mydbsync.com:443/api/appcode/v1/appcode-distribution/gitCompile
Response Body
{
  "error": "AppCode:appcode-distribution does not exist, Please check your URL"
}
Response Code
 200
Response Header
{
 "access-control-allow-origin": "*",
 "date": "Fri, 24 Feb 2017 13:23:54 GMT",
 "connection": "Keep-Alive",
 "keep-alive": "timeout=150, max=92","content-length": "78",
 "content-type": "application/json"
}
  • No labels