Create release elements from JSON input

You can pass a single JSON object to create a single element, or a JSON array of release JSON objects to create multiple elements. If you create a single element, the response includes the URI of the new element in the Location response header, and the response body includes one release JSON object with the format specified by the format parameter. If you create multiple elements, the response includes a JSON array of release JSON objects with the specified format in an order that corresponds to the order of the input data. If no format is specified, the "detail" format will be used by default. If creating a large number of elements in a single request, it is recommended to use the "list" or "name" formats for better performance, when the use case allows it.

Request

POST http://{hostname}:{port}
  /releases/?{parameters}
Accept: application/json
Content-Type: application/json
Table 1. Request parameters
Parameter Type Required Description
format string false One of the format options; this parameter determines what information is included in the JSON response. If not specified, or if an unrecognized value is specified, the default format of "detail" will be used.
Table 2. Header parameters
Parameter Type Required Description
Content-Type application/json true  
Accept application/json true  
For the format parameter, use one of the following format options:
list
Primary properties and base application, life cycle model, milestones, team, and total changes
detail
Primary properties and base application, life cycle model, milestones, phases, and related detailed information
For details about the full JSON that the server returns when you select one of these formats, see the related resource: release resource.

Example

curl -k -u jsmith:passwd  
  "http://myserver.example.com:8080/releases/" 
  -X POST
  -H "Accept: application/json"
  -H "Content-Type: application/json"
  -d @newRelease.json

Example JSON request

{
  "name": "Example Release",
  "description": "Optional description",
  "team": {
    "id": "00000000-0000-0000-0000-000000000206"
  },
  "lifecycleModel": {
    "id": "00000000-0000-0000-0000-000000000006"
  }
}

Example JSON response

{
  "lifecycleModel": {
    "name": "Default Lifecycle",
    "description": "Default Lifecycle.",
    "ghostedDate": 0,
    "id": "00000000-0000-0000-0000-000000000006",
    "version": 0,
    "dateCreated": 0
  },
  "baseApplication": {
    "level": "SUITE",
    "automated": false,
    "targets": [],
    "tasks": [],
    "createdByUserId": "00000000-0000-0000-0000-000000000002",
    "name": "Example Release",
    "ghostedDate": 0,
    "id": "4659f2ee-b23f-45ac-b92f-efeb1691713c",
    "version": 0,
    "dateCreated": 1421697758804,
    "versions": [],
    "teams": [
      {
        "id": "00000000-0000-0000-0000-000000000206",
        "name": "Team for Sample Release"
      }
    ],
    "releaseEnvironments": []
  },
  "phases": [
    {
      "phaseModel": {
        "indexOrder": 0,
        "name": "DEV",
        "description": "Development Environment",
        "ghostedDate": 0,
        "id": "00000000-0000-0000-0000-100000000007",
        "version": 0,
        "dateCreated": 0
      },
      "approvals": [],
      "deploymentPlan": {
        "name": "Default Plan",
        "lastRefresh": 1421697758813,
        "ghostedDate": 0,
        "id": "f180fe84-f768-4376-9deb-b3b333da2fc0",
        "version": 0,
        "dateCreated": 1421697758813
      },
      "ghostedDate": 0,
      "id": "bac04cf2-818d-4301-b626-51f9e6e9753c",
      "version": 0,
      "dateCreated": 1421697758829,
      "environments": [],
      "reservations": [],
      "hasEdit": true,
      "name": "DEV"
    },
    {
      "phaseModel": {
        "indexOrder": 1,
        "name": "CERT",
        "description": "Certification Environment",
        "ghostedDate": 0,
        "id": "00000000-0000-0000-0000-100000000008",
        "version": 0,
        "dateCreated": 0
      },
      "approvals": [],
      "deploymentPlan": {
        "name": "Default Plan",
        "lastRefresh": 1421697758813,
        "ghostedDate": 0,
        "id": "f180fe84-f768-4376-9deb-b3b333da2fc0",
        "version": 0,
        "dateCreated": 1421697758813
      },
      "ghostedDate": 0,
      "id": "2d1529c0-6fed-4e68-866f-89175b448de6",
      "version": 0,
      "dateCreated": 1421697758829,
      "environments": [],
      "reservations": [],
      "hasEdit": true,
      "name": "CERT"
    },
    {
      "phaseModel": {
        "indexOrder": 2,
        "name": "QA",
        "description": "Quality Assurance",
        "ghostedDate": 0,
        "id": "00000000-0000-0000-0000-100000000009",
        "version": 0,
        "dateCreated": 0
      },
      "approvals": [],
      "deploymentPlan": {
        "name": "Default Plan",
        "lastRefresh": 1421697758813,
        "ghostedDate": 0,
        "id": "f180fe84-f768-4376-9deb-b3b333da2fc0",
        "version": 0,
        "dateCreated": 1421697758813
      },
      "ghostedDate": 0,
      "id": "5e3e96c5-5b6a-43af-9df8-750d1eb09d41",
      "version": 0,
      "dateCreated": 1421697758829,
      "environments": [],
      "reservations": [],
      "hasEdit": true,
      "name": "QA"
    },
    {
      "phaseModel": {
        "indexOrder": 3,
        "name": "PT",
        "description": "Performance Test / Pre-Production",
        "ghostedDate": 0,
        "id": "00000000-0000-0000-0000-100000000010",
        "version": 0,
        "dateCreated": 0
      },
      "approvals": [],
      "deploymentPlan": {
        "name": "Default Plan",
        "lastRefresh": 1421697758813,
        "ghostedDate": 0,
        "id": "f180fe84-f768-4376-9deb-b3b333da2fc0",
        "version": 0,
        "dateCreated": 1421697758813
      },
      "ghostedDate": 0,
      "id": "31d3a6a1-b078-4b0f-b9fa-fdaa2279289f",
      "version": 0,
      "dateCreated": 1421697758829,
      "environments": [],
      "reservations": [],
      "hasEdit": true,
      "name": "PT"
    },
    {
      "phaseModel": {
        "indexOrder": 4,
        "name": "PROD",
        "description": "Production",
        "ghostedDate": 0,
        "id": "00000000-0000-0000-0000-100000000011",
        "version": 0,
        "dateCreated": 0
      },
      "approvals": [],
      "deploymentPlan": {
        "name": "Default Plan",
        "lastRefresh": 1421697758813,
        "ghostedDate": 0,
        "id": "f180fe84-f768-4376-9deb-b3b333da2fc0",
        "version": 0,
        "dateCreated": 1421697758813
      },
      "ghostedDate": 0,
      "id": "aa1e0557-eb2c-484c-ab62-b738f1fc4d1e",
      "version": 0,
      "dateCreated": 1421697758829,
      "environments": [],
      "reservations": [],
      "hasEdit": true,
      "name": "PROD"
    }
  ],
  "milestones": [],
  "exemptions": [],
  "createdByUserId": "00000000-0000-0000-0000-000000000002",
  "name": "Example Release",
  "description": "Optional description",
  "ghostedDate": 0,
  "id": "d2eea765-f11a-4139-a61a-7486398c0c1c",
  "version": 1,
  "dateCreated": 1421697758804,
  "hasEdit": true,
  "applications": [],
  "team": {
    "id": "00000000-0000-0000-0000-000000000206",
    "name": "Team for Sample Release"
  }
}

Feedback