NAV Navbar
Logo
shell

Introduction

Welcome to the Appranix API! You can use our API to access Appranix API endpoints, which can get information on assemblies, deployments, clouds and environment.

Organization

Get All Organization

curl "https://api.appranix.net/ads/v1/account/organizations"
-H "Authorization: xxxxxx"
-H "Content-Type: application/json"
-H "Accept: application/json"

The above command returns JSON structured like this:

[
  {
    "id": 1,
    "name": "orgname",
    "created_at": "2016-12-12T15:04:29.407Z",
    "updated_at": "2016-12-12T15:04:29.407Z",
    "cms_id": 102351,
    "assemblies": true,
    "catalogs": false,
    "services": false,
    "announcement": null,
    "full_name": null,
    "account_id": 2
  },
  {
    "id": 50,
    "name": "orgname-john",
    "created_at": "2017-03-09T08:24:58.919Z",
    "updated_at": "2017-03-09T08:24:58.919Z",
    "cms_id": 1143717,
    "assemblies": true,
    "catalogs": false,
    "services": false,
    "announcement": null,
    "full_name": null,
    "account_id": 2
  }
]

This endpoint retrieves all Organization.

HTTP Request

GET https://api.appranix.net/ads/v1/account/organizations

Create Organization

curl - X POST "https://api.appranix.net/ads/v1/account/organizations"
  -H "Authorization: xxxxxx"
  -H "Content-Type: application/json"
  -H "Accept: application/json"
  -d '{"name":"<name of your Organization>"}'


This endpoint creates an organization.

HTTP Request

POST https://api.appranix.net/ads/v1/account/organizations

Request Headers

Content-Type: application/json Accept: application/json Authorization: Basic VWJxMUhadkVFVEpSVnh4enJXemc=

Request Data

Parameter Default Description
name false The name of the organization.

Example Request Data JSON structured like this:

{
  "name":"john2"
}

The above command returns JSON structured like this:

{
"id": 132,
"name": "orgname-john2",
"created_at": "2017-06-06T06:11:45.380Z",
"updated_at": "2017-06-06T06:11:45.380Z",
"cms_id": 1923640,
"assemblies": true,
"catalogs": false,
"services": false,
"announcement": null,
"full_name": null,
"account_id": 2
}

Delete an Organization

curl -X DELETE "https://api.appranix.net/ads/v1/account/organizations/<org-id>"
-H "Authorization: xxxxxx"
-H "Content-Type: application/json"
-H "Accept: application/json"

This endpoint deletes an organization.

HTTP Request

DELETE https://api.appranix.net/ads/v1/account/organizations/<org-id>

Request Headers

Content-Type: application/json Accept: application/json Authorization: Basic VWJxMUhadkVFVEpSVnh4enJXemc=

The above command returns JSON structured like this:

  {
  "id": 132,
  "name": "orgname-john2",
  "created_at": "2017-06-06T06:11:45.380Z",
  "updated_at": "2017-06-06T06:11:45.380Z",
  "cms_id": 1923640,
  "assemblies": true,
  "catalogs": false,
  "services": false,
  "announcement": null,
  "full_name": null,
  "account_id": 2
  }

Assembly

Get All Assemblies

curl "https://api.appranix.net/ads/v1/<ORGANIZATION-NAME>/assemblies"
-H "Authorization: xxxxxxxxxxx"
-H "Content-Type: application/json"
-H "Accept: application/json"


The above command returns JSON structured like this:

[
  {
    "ciId": 1805107,
    "ciName": "first",
    "ciClassName": "account.Assembly",
    "impl": "oo::chef-11.4.0",
    "nsPath": "/orgname-john",
    "ciGoid": "1143719-1004-1805107",
    "comments": "",
    "ciState": "default",
    "lastAppliedRfcId": 0,
    "createdBy": "john",
    "updatedBy": null,
    "created": 1494795705848,
    "updated": 1494795705848,
    "nsId": 1143719,
    "ciAttributes": {
      "owner": "john@example.com",
      "description": "test ec2 creation via gui",
      "tags": "{}"
    },
    "attrProps": {},
    "altNs": {}
  }
]

This endpoint retrieves all assemblies.

HTTP Request

GET https://api.appranix.net/ads/v1/<ORGANIZATION-NAME>/assemblies

Request Headers

Content-Type: application/json Accept: application/json Authorization: Basic VWJxMUhadkVFVEpSVnh4enJXemc=

Create Assembly

curl - X POST "https://api.appranix.net/ads/v1/<ORGANIZATION-NAME>/assemblies"
  -H "Authorization: xxxxxxxxxxx"
  -H "Content-Type: application/json"
  -H "Accept: application/json"
  -d '{"cms_ci":{"ciClassName":"account.Assembly",  "ciName":"test444fdsfsadad", "ciAttributes": {"description":"test", "owner":"gowtham@appranix.com"}}}'


The above command returns JSON structured like this:

{
"ciId": 1923660,
"ciName": "john",
"ciClassName": "account.Assembly",
"impl": "oo::chef-11.4.0",
"nsPath": "/orgname-john",
"ciGoid": "1143719-1004-1923660",
"comments": "",
"ciState": "default",
"lastAppliedRfcId": 0,
"createdBy": "john",
"updatedBy": null,
"created": 1496730494755,
"updated": 1496730494755,
"nsId": 1143719,
"ciAttributes": {
"owner": "example@example.com",
"description": "test",
"tags": "{}"
},
"attrProps": {},
"altNs": {}
}

This endpoint creates an assembly.

HTTP Request

POST https://api.appranix.net/ads/v1/<ORGANIZATION-NAME>/assemblies

Request Headers

Content-Type: application/json Accept: application/json Authorization: Basic VWJxMUhadkVFVEpSVnh4enJXemc=

Request Data

Parameter Required Description
ciName true The name of the organization.
description false The name of the organization.
owner false The name of the organization.

Example Request Data JSON structured like this:

{
  "cms_ci":
  {
    "ciName":"john",
    "ciAttributes": {
      "description":"test",
      "owner":"example@example.com"
      }
    }
}

GET EnvironmentGroup List for Assembly

curl -X GET "https://api.appranix.net/ads/v1/<org-name>/assemblies/<assembly-ciId>/environmentgroups"
-H "Authorization: xxxxxxxxxxx"
-H "Content-Type: application/json"
-H "Accept: application/json"

The above command returns JSON structured like this:

[
  {
    "ciId": 1923667,
    "ciName": "dev",
    "ciClassName": "account.Environmentgroups",
    "impl": "oo::chef-11.4.0",
    "nsPath": "/orgname-john/john/_envgroup",
    "ciGoid": "1923666-1053-1923667",
    "comments": "",
    "ciState": "default",
    "lastAppliedRfcId": 0,
    "createdBy": "john",
    "updatedBy": null,
    "created": 1496730495029,
    "updated": 1496730495029,
    "nsId": 1923666,
    "ciAttributes": {
      "staging_value": "1",
      "icon": "Development",
      "description": "dev",
      "short_name": "dev",
      "previous_stage": "Initial",
      "has_chain_break": false,
      "has_branching": false
    },
    "attrProps": {},
    "altNs": {}
  },
  {
    "ciId": 1923675,
    "ciName": "qa",
    "ciClassName": "account.Environmentgroups",
    "impl": "oo::chef-11.4.0",
    "nsPath": "/orgname-john/john/_envgroup",
    "ciGoid": "1923666-1053-1923675",
    "comments": "",
    "ciState": "default",
    "lastAppliedRfcId": 0,
    "createdBy": "john",
    "updatedBy": null,
    "created": 1496730495185,
    "updated": 1496730495185,
    "nsId": 1923666,
    "ciAttributes": {
      "staging_value": "2",
      "icon": "QA",
      "description": "qa",
      "short_name": "qa",
      "previous_stage": "1923667",
      "has_chain_break": false,
      "has_branching": false
    },
    "attrProps": {},
    "altNs": {}
  },
  {
    "ciId": 1923683,
    "ciName": "uat",
    "ciClassName": "account.Environmentgroups",
    "impl": "oo::chef-11.4.0",
    "nsPath": "/orgname-john/john/_envgroup",
    "ciGoid": "1923666-1053-1923683",
    "comments": "",
    "ciState": "default",
    "lastAppliedRfcId": 0,
    "createdBy": "john",
    "updatedBy": null,
    "created": 1496730495340,
    "updated": 1496730495340,
    "nsId": 1923666,
    "ciAttributes": {
      "staging_value": "3",
      "icon": "UAT",
      "description": "uat",
      "short_name": "uat",
      "previous_stage": "1923675",
      "has_chain_break": false,
      "has_branching": false
    },
    "attrProps": {},
    "altNs": {}
  }
]

This endpoint return list of EnvironmentGroup for this Assembly.

HTTP Request

GET https://api.appranix.net/ads/v1/<org-name>/assemblies/<assembly-ciId>/environmentgroups

Request Headers

Content-Type: application/json Accept: application/json Authorization: Basic VWJxMUhadkVFVEpSVnh4enJXemc=

Import design to assembly

curl -X PUT "https://api.appranix.net/ads/v1/<org-name>/assemblies/<assembly-ciId>/design/load"
-H "Authorization: xxxxxxxxxxx"
-H "Content-Type: application/json"
-H "Accept: application/json"
-d '{"data":"---\nplatforms:\n  helloworld:\n    pack: prana/tomcat:1\n    major_version: '1'\n    variables:\n      deployContext: quick-demo-app\n      appVersion: 104\n      extension: war\n      groupId: com.appranix\n      artifactId: quick-demo-app\n    components:\n      tomcat/prana.1.Tomcat:\n        tomcat:\n          tomcat_group: user\n          autodeploy_enabled: 'true'\n          tomcat_user: user\n      artifact/prana.1.Artifact:\n        artifact:\n          install_dir: /app/$AX_LOCAL{artifactId}\n          as_user: user\n          should_expand: false\n          restart: \"execute \\\"rm -rf /opt/tomcat7/webapps/*.war\\\" \\r\\nexecute \\\"ln\n            -s /app/$AX_LOCAL{artifactId}/releases/$AX_LOCAL{appVersion}/$AX_LOCAL{artifactId}-$AX_LOCAL{appVersion}.$AX_LOCAL{extension}\n            /opt/tomcat7/webapps/\\\"\"\n          as_group: user\n          location: $AX_LOCAL{groupId}:$AX_LOCAL{artifactId}:$AX_LOCAL{extension}\n          repository: releases\n          version: $AX_LOCAL{appVersion}\n          url: http:/565656.hosts.grgrgr.info:8081\n          username: admin\n"}'


The above command returns JSON structured like this:

{
  "platforms": {
    "helloworld": {
      "pack": "core/tomcat:1",
      "major_version": "1",
      "variables": {
        "deployContext": "quick-demo-app",
        "appVersion": "1",
        "extension": "war",
        "groupId": "com.appranix",
        "artifactId": "quick-demo-app"
      },
      "components": {
        "tomcat/core.1.Tomcat": {
          "tomcat": {
            "tomcat_group": "user",
            "autodeploy_enabled": "true",
            "tomcat_user": "user"
          }
        },
        "artifact/core.1.Artifact": {
          "artifact": {
            "install_dir": "/app/$AX_LOCAL{artifactId}",
            "as_user": "user",
            "should_expand": false,
            "restart": "execute \"rm -rf /opt/tomcat7/webapps/*.war\" \r\nexecute \"ln -s /app/$AX_LOCAL{artifactId}/releases/$AX_LOCAL{appVersion}/$AX_LOCAL{artifactId}-$AX_LOCAL{appVersion}.$AX_LOCAL{extension} /opt/tomcat7/webapps/\"",
            "as_group": "user",
            "location": "$AX_LOCAL{groupId}:$AX_LOCAL{artifactId}:$AX_LOCAL{extension}",
            "repository": "releases",
            "version": "$AX_LOCAL{appVersion}",
            "url": "http:/i00039.hosts.appranix.info:8081",
            "username": "admin"
          }
        }
      }
    }
  }
}

This endpoint import design yml to assembly.

HTTP Request

PUT https://api.appranix.net/ads/v1/<org-name>/assemblies/<assembly-ciId>/design/load

Request Headers

Content-Type: application/json Accept: application/json Authorization: Basic VWJxMUhadkVFVEpSVnh4enJXemc=

Example Request Data

The following is the sample Request data:


{"data":"---\nplatforms:\n  helloworld:\n    pack: core/tomcat:1\n    major_version: '1'\n    variables:\n      deployContext: quick-demo-app\n      appVersion: '1'\n      extension: war\n      groupId: com.appranix\n      artifactId: quick-demo-app\n    components:\n      tomcat/core.1.Tomcat:\n        tomcat:\n          tomcat_group: user\n          autodeploy_enabled: 'true'\n          tomcat_user: user\n      artifact/core.1.Artifact:\n        artifact:\n          install_dir: /app/$AX_LOCAL{artifactId}\n          as_user: user\n          should_expand: false\n          restart: \"execute \\\"rm -rf /opt/tomcat7/webapps/*.war\\\" \\r\\nexecute \\\"ln\n            -s /app/$AX_LOCAL{artifactId}/releases/$AX_LOCAL{appVersion}/$AX_LOCAL{artifactId}-$AX_LOCAL{appVersion}.$AX_LOCAL{extension}\n            /opt/tomcat7/webapps/\\\"\"\n          as_group: user\n          location: $AX_LOCAL{groupId}:$AX_LOCAL{artifactId}:$AX_LOCAL{extension}\n          repository: releases\n          version: $AX_LOCAL{appVersion}\n          url: http:/i00039.hosts.appranix.info:8081\n          username: admin\n"}


Get latest release for this Assembly

curl -X GET "https://api.appranix.net/ads/v1/<org-name>/assemblies/<assembly-ciId>/design/releases/latest"
-H "Authorization: xxxxxxxxxxx"
-H "Content-Type: application/json"
-H "Accept: application/json"

The above command returns JSON structured like this:

{
"releaseId": 1336120,
"nsPath": "/orgname-john/john",
"releaseName": "/orgname-john/john1336120",
"createdBy": "john",
"committedBy": null,
"releaseState": "open",
"releaseType": null,
"description": null,
"revision": 1,
"parentReleaseId": null,
"created": 1496732705023,
"updated": 1496732705023,
"nsId": 1923664,
"releaseStateId": 100,
"ciRfcCount": 0,
"relationRfcCount": 0
}

HTTP Request

GET https://api.appranix.net/ads/v1/<org-name>/assemblies/<assembly-ciId>/design/releases/latest

Request Headers

Content-Type: application/json Accept: application/json Authorization: Basic VWJxMUhadkVFVEpSVnh4enJXemc=

Commit design

curl -X POST "https://api.appranix.net/ads/v1/<org-name>/assemblies/<assembly-ciId>/design/releases/<release-id>/commit"
-H "Authorization: xxxxxxxxxxx"
-H "Content-Type: application/json"
-H "Accept: application/json"
-d '{"desc":"desc"}'


The above command returns JSON structured like this:

{
"releaseId": 1336120,
"nsPath": "/orgname-john/john",
"releaseName": "/orgname-john/john1336120",
"createdBy": "john",
"committedBy": "john",
"releaseState": "closed",
"releaseType": null,
"description": "Initial commit",
"revision": 1,
"parentReleaseId": null,
"created": 1496732705023,
"updated": 1496732881045,
"nsId": 1923664,
"releaseStateId": 200,
"ciRfcCount": 0,
"relationRfcCount": 0
}

HTTP Request

POST https://api.appranix.net/ads/v1/<org-name>/assemblies/<assembly-ciid>/design/releases/<release-id>/commit

Request Headers

Content-Type: application/json Accept: application/json Authorization: Basic VWJxMUhadkVFVEpSVnh4enJXemc=

Request Data

Parameter Required Description
desc true The desc for the commit.

The following is the sample Request data:

{
"desc":"Initial commit"
}

Delete Assembly

curl -X DELETE "https://api.appranix.net/ads/v1/<ORGANIZATION-NAME>/assemblies/<ASSEMBLY-NAME>"
-H "Authorization: xxxxxxxxxxx"
-H "Content-Type: application/json"
-H "Accept: application/json"


This endpoint deletes an assembly.

HTTP Request

DELETE https://api.appranix.net/ads/v1/<ORGANIZATION-NAME>/assemblies/<ASSEMBLY-NAME>

Request Headers

Content-Type: application/json Accept: application/json Authorization: Basic VWJxMUhadkVFVEpSVnh4enJXemc=

Environment

Get All Environments

curl "https://api.appranix.net/ads/v1/<org-name>/assemblies/<assembly-ciId>/transition/environments"
-H "Authorization: xxxxxx"
-H "Content-Type: application/json"
-H "Accept: application/json"

The above command returns JSON structured like this:

[
  {
    "ciId": 1924196,
    "ciName": "john",
    "ciClassName": "manifest.Environment",
    "impl": "oo::chef-11.4.0",
    "nsPath": "/orgname-john/john",
    "ciGoid": "1923664-1043-1924196",
    "comments": "",
    "ciState": "default",
    "lastAppliedRfcId": 0,
    "createdBy": "john",
    "updatedBy": null,
    "created": 1496734978775,
    "updated": 1496734990885,
    "nsId": 1923664,
    "ciAttributes": {
      "debug": "true",
      "codpmt": "false",
      "profile": "",
      "description": "",
      "availability": "single",
      "monitoring": "true",
      "autoscale": "false",
      "adminstatus": "preparation",
      "envgroup": "236665",
      "global_dns": "false",
      "subdomain": "",
      "logging": "false",
      "dpmtdelay": "60",
      "autoreplace": "false",
      "autorepair": "true"
    },
    "attrProps": {},
    "altNs": {}
  },
  {
    "ciId": 1924307,
    "ciName": "john2",
    "ciClassName": "manifest.Environment",
    "impl": "oo::chef-11.4.0",
    "nsPath": "/orgname-john/john",
    "ciGoid": "1923664-1043-1924307",
    "comments": "",
    "ciState": "default",
    "lastAppliedRfcId": 0,
    "createdBy": "john",
    "updatedBy": null,
    "created": 1496735031096,
    "updated": 1496735044512,
    "nsId": 1923664,
    "ciAttributes": {
      "debug": "true",
      "codpmt": "false",
      "profile": "",
      "description": "",
      "availability": "single",
      "monitoring": "true",
      "autoscale": "false",
      "adminstatus": "preparation",
      "envgroup": "1923667",
      "global_dns": "false",
      "subdomain": "",
      "logging": "false",
      "dpmtdelay": "60",
      "autoreplace": "false",
      "autorepair": "true"
    },
    "attrProps": {},
    "altNs": {}
  }
]

This endpoint retrieves all environments.

HTTP Request

GET https://api.appranix.net/ads/v1/<org-name>/assemblies/<assembly-ciId>/transition/environments

Request Headers

Content-Type: application/json Accept: application/json Authorization: Basic VWJxMUhadkVFVEpSVnh4enJXemc=

Create Environment

curl - X POST "https://api.appranix.net/ads/v1/<org-name>/assemblies/<assembly-ciId>/transition/environments"
  -H "Authorization: xxxxxx"
  -H "Content-Type: application/json"
  -H "Accept: application/json"
  -d '{"cms_ci":{"ciName":"dev333", "ciAttributes":{"debug":"true", "envgroup":236665}}, "clouds":{"AWS":{"priority":"1", "dpmt_order":"1", "pct_scale":"100"}}, "platform_availability":{"test":"default", "helloworld":"default"}}'

The above command returns JSON structured like this:

{
"ciId": 1924307,
"ciName": "john2",
"ciClassName": "manifest.Environment",
"impl": "oo::chef-11.4.0",
"nsPath": "/orgname-john/john",
"ciGoid": "1923664-1043-1924307",
"comments": "",
"ciState": "default",
"lastAppliedRfcId": 0,
"createdBy": "john",
"updatedBy": null,
"created": 1496735031096,
"updated": 1496735044512,
"nsId": 1923664,
"ciAttributes": {
"debug": "true",
"codpmt": "false",
"profile": "",
"description": "",
"availability": "single",
"monitoring": "true",
"autoscale": "false",
"adminstatus": "preparation",
"envgroup": "1923667",
"global_dns": "false",
"subdomain": "",
"logging": "false",
"dpmtdelay": "60",
"autoreplace": "false",
"autorepair": "true"
},
"attrProps": {},
"altNs": {},
"clouds": {
1143810: {
"pct_scale": "100",
"adminstatus": "active",
"dpmt_order": "1",
"priority": "1"
}
}
}

This endpoint creates an environment.

HTTP Request

POST https://api.appranix.net/ads/v1/<org-name>/assemblies/<assembly-ciId>/transition/environments

Request Headers

Content-Type: application/json Accept: application/json Authorization: Basic VWJxMUhadkVFVEpSVnh4enJXemc=

Request Data

Parameter Default Description
ciName false The name of the environment.
ciAttributes false The attributes for the environment.
clouds false The cloud list json.
platform_availability false The platform availability list json

Example Request Data JSON structured like this:

{
    "cms_ci": {
        "ciName": "john",
        "ciAttributes": {
            "debug": "true",
            "envgroup": 1923667
        }
    },
    "clouds": {
        "AWS": {
            "priority": "1",
            "dpmt_order": "1",
            "pct_scale": "100"
        }
    },
    "platform_availability": {
        "test": "default",
        "helloworld": "default"
    }
}

Delete Environment

curl -X DELETE "https://api.appranix.net/ads/v1/<org-name>/assemblies/<assembly-ciId>/transition/environments/<environment-ciId>"
-H "Authorization: xxxxxx"
-H "Content-Type: application/json"
-H "Accept: application/json"

This endpoint deletes an environment.

HTTP Request

DELETE https://api.appranix.net/ads/v1/<org-name>/assemblies/<assembly-ciId>/transition/environments/<environment-ciId>

Request Headers

Content-Type: application/json Accept: application/json Authorization: Basic VWJxMUhadkVFVEpSVnh4enJXemc=

Errors

The Appranix API uses the following error codes:

Error Code Meaning
400 Bad Request – Your request sucks
401 Unauthorized – Your API key is wrong
403 Forbidden – The Appranix requested is hidden for administrators only
404 Not Found – The specified Appranix could not be found
405 Method Not Allowed – You tried to access a Appranix with an invalid method
406 Not Acceptable – You requested a format that isn’t json
410 Gone – The Appranix requested has been removed from our servers
418 I’m a teapot
429 Too Many Requests – You’re requesting too many APIs! Slow down!
500 Internal Server Error – We had a problem with our server. Try again later.
503 Service Unavailable – We’re temporarily offline for maintenance. Please try again later.