/services/import                                   [ POST ]


Imports a specific version of service specification and code from a remote repository. If the service does not exist, it will call the add/modify service.

The service identifier will be the name of the service directory specified in the repository specification. 


Body Parameters


Name
Optional
Valid values
repository No A specification of the service codes source location. Currently, 4 types of repositories are supported as follows:

GIT source control
{
  "repo_type": "git",
  "url": "git@bitbucket.org:my_account_name/my_project.git",
  "branch": "master",
  "ot_dir": "mydir"
}
 
SVN source control
{
  "repo_type": "svn",
  "url": "svn://myhost/myrepo",
  "username": "OPTIONAL_USERNAME",
  "password": "OPTIONAL_PASSWORD",
  "ot_dir": "my_service_dir"
}
 
Any HTTP-based remote storage
{
  "repo_type": "http",
  "url": "https://www.dropbox.com/s/1234567890/MyFile.zip?dl=0",
  "username": "OPTIONAL_PASSWORD",
  "ot_dir": "my_service_dir"
}
 
AWS S3
{
  "repo_type": "s3",
  "bucket": "my_bucket/my_service.zip",
  "access_key": "MY_ACCESS_KEY",
  "secret_key": "MY_SECRET_KEY",
  "ot_dir": "my_service_dir"
}
 
mode Yes development/production
service_version Yes string: service version. To upload a service to the standard production version please use the version string: "default" as shown bellow.
Version must be up to 64 characters long, start with a letter and contain only the following characters: A=Za-z0-9._-


Request Examples

## import to development sandbox

curl -k -u admin:admin -X POST -H "Content-Type: application/json" -d '{
    "repository": {
  "branch": "master",
  "ot_dir": "microservices/hello_world",
  "repo_type": "git",
  "url": "https://github.com/opereto/opereto_examples.git"
    },
    "mode": "development"
}' https://OPERETOHOST/services/import


## import to production

curl -k -u admin:admin -X POST -H "Content-Type: application/json" -d '{
    "repository": {
  "branch": "master",
  "ot_dir": "microservices/hello_world",
  "repo_type": "git",
  "url": "https://github.com/opereto/opereto_examples.git"
    },
    "mode": "production",
   "version": "v1.0"
}' https://OPERETOHOST/services/import



Response Examples 

{"status": "success"}