You can view update profiles and update profile types of a deployed application. You can also use the APIs to create and delete update profiles, override update profile property values, schedule run custom task scale-in and scale-out update process, view the last failed update process, and rollback an update process.

Update Profiles

Retrieves a paginated list of update profiles for a deployment.

All Application Services roles can access this API.

HTTP Method

GET

URI Syntax

https://ApplicationServicesServerIP:8443/darwin/api/2.0/update-profile?deployment-id=DeploymentID&page=Page&page-size=PageSize

You must type the URI syntax because the copy and paste operation removes formatting from the text.

Example URI syntax:

https://ApplicationServicesServerIP:8443/darwin/api/2.0/update-profile?deployment-id=19&page=0&page-size=10

Response

{
  "errors": false,  
  "messageList": [],
  "count": 2,
  "results": [
   {
     "updateProfileRefs": [
        {
          "updateProfileRef": {
            "id": "19",
            "name": "increase8",
            "uri": "/darwin/api/2.0/update-profile/19"
          },
          "updateType": "SCALE_OUT"
        },
        {
          "updateProfileRef": {
            "id": "21",
            "name": "scalein1",
            "uri": "/darwin/api/2.0/update-profile/21"
          },
          "updateType": "SCALE_IN"
        }
      ]
    }
  ]
}

Update Profile by Update Type

Retrieves a paginated list of update profiles for a deployment and update type.

All Application Services roles can access this API.

HTTP Method

GET

URI Syntax

https://ApplicationServicesServerIP:8443/darwin/api/2.0/update-profile?deployment-id=DeploymentID&update-type=UpdateType&page=Page&page-size=PageSize

You must type the URI syntax because the copy and paste operation removes formatting from the text.

Example URI syntax:

https://ApplicationServicesServerIP:8443/darwin/api/2.0/update-profile?deployment-id=19&update-type=SCALE_OUT&page=0&page-size=10

Response

{
  "errors": false,
  "messageList": [],
  "count":1,
  "results": [
    {
      "updateProfileRefs": [
        {
          "updateProfileRef": {
            "id": "19",
            "name": "increase8",
            "uri": "/darwin/api/2.0/update-profile/19"
          },
          "update-type": "SCALE_OUT"
        }
      ]
    }
  ]
}

Update Profile ID

Retrieves an update profile for a deployment based on the provided update profile identification.

All Application Services roles can access this API.

HTTP Method

GET

URI Syntax

https://ApplicationServicesServerIP:8443/darwin/api/2.0/update-profile/UpdateProfileID

You must type the URI syntax because the copy and paste operation removes formatting from the text.

Example URI syntax:

https://ApplicationServicesServerIP:8443/darwin/api/2.0/update-profile/2

Response

{
  "errors": false,
  "messageList": [],
  "result": {
    "id": "19",
    "lockVersion": 1,
    "name": "increase8",
    "description": "increase8 Description",
    "created": "2013-08-01T17:22:34+05:30",
    "lastUpdated": "2013-08-01T17:22:34+05:30",
    "lastUpdateUser": "admin",
    "createUser": "admin",
    "deploymentRef": {
      "id": "8",
      "name": "appd-Linux Smoke 01-1.0.0-admin-8-3ab14c68-5ac1-4357-b403-c04603c12b14",
      "uri": "/darwin/api/2.0/deployment/8"
     },
     "updateType": "SCALE_OUT",
     "configUpdateProperties":null,
     "scaleoutPropertiesInfo": {
       "clusterNode": [
         {
           "name": "Clustered_Producer",
           "currentClusterSize": 3,
           "nodeInstanceNames": [
             "SpringTravel_0_",
             "SpringTravel_1_",
             "SpringTravel_2_"
           ]
         }
       ]
     }     
   }
}

Create an Update Profile

Creates an update profile based on the name provided in the request section and schedules its execution. If an update profile name is not provided, the designated name appears in the response section with the associated identification. If the update profile name already exists, an error message appears.

The application publisher and deployer can access this API.

  • If the operation element is not provided then the update-profile request is treated as (create and schedule) or (update and schedule) depending on the provided REST URL (i.e. /2.0/update-profile or /2.0/update-profile/<update-profile-id>).

  • If the operation element is provided with any one of the CREATE_ONLY OR UPDATE_ONLY values, then either profile creation or profile updation will be carried out.

  • If update profile is created in Application Services UI, and user wants to schedule it through rest API, then provide the empty payload on the URL /2.0/update-profile/<update-profile-id>.

The operation field is omitted from the JSON request. The ROLLBACK, CREATE_ONLY, and UPDATE_ONLY values are supported.

HTTP Method

POST

URI Syntax

https://ApplicationServicesServerIP:8443/darwin/api/2.0/update-profile

You must type the URI syntax because the copy and paste operation removes formatting from the text.

Example URI syntax:

https://ApplicationServicesServerIP:8443/darwin/api/2.0/update-profile

Request

{
    "deploymentId": 2,
    "operation" : " ROLLBACK ",
    "updateType": "SCALE_OUT",
    "name": "scaleOutTest",
    "description" : "scaleOutTest Desc",
    "scaleoutProperties": {
        "clusterNode": [
            {
                "name": "SpringTravel",
                "scaleOutBy": 1
            }
        ]
    }
}

Response

{
  "errors": false,
  "message-list": [
    {
      "message-type": "INFO",
      "message": "Deployment update scheduled successfully.",
      "message-key": "deployment.update.scheduled.msg"
     }
   ]
  "result": {
    "id": "1",
    "lockVersion": 0,
    "name": "scaleOutTest",
    "description" :"scaleOutTest Desc",
    "deploymentTaskRef" : {
      "uri": "/darwin/api/2.0/deployment-task/76",
      "id": "76",
      "name": "appd-Spring Travel-1.0.0-admin-14-759a3d26-0ad5-4e58-a3d2-6f34214e3637"
    }
  }
}

Override an Update Profile

Overrides property values in an update profile based on the provided update profile identification and schedules its execution. The request body contains the changes to apply to the existing update profile with the given ID.

The application publisher and deployer can access this API.

HTTP Method

POST

URI Syntax

https://ApplicationServicesServerIP:8443/darwin/api/2.0/update-profile/UpdateProfileID

You must type the URI syntax because the copy and paste operation removes formatting from the text.

Example URI syntax:

https://ApplicationServicesServerIP:8443/darwin/api/2.0/update-profile/2

Request

{
  "lockVersion": 1,
  "updateType": "SCALE_OUT",
  "scaleoutProperties":    {
    "clusterNode": [
      {
        "name": "SpringTravel",
      "scaleOutBy": 1
      }
    ]
  }
}

Response

{
  "errors": false,
  "message-list": [
    {
      "message-type": "INFO",
      "message": "Deployment update scheduled successfully.",
      "message-key": "deployment.update.scheduled.msg"
     }
  ]
  "result": {
    "id": "1",
    "lockVersion": 0,
    "name": "scaleOutTest",
    "description" :"scaleOutTest Desc", 
    "deploymentTaskRef": {
      "uri": "/darwin/api/2.0/deployment-task/76",
      "id": "76",
      "name": "appd-Spring Travel-1.0.0-admin-14-759a3d26-0ad5-4e58-a3d2-6f34214e3637"
    }
  } 
}

Update and Schedule a Scale In Deployment

Schedules an update process to scale in a deployed application based on the modified cluster size of a node in the update profile.

The application publisher and deployer can access this API.

HTTP Method

POST

URI Syntax

https://ApplicationServicesServerIP:8443/darwin/api/2.0/update-profile/UpdateProfileID

You must type the URI syntax because the copy and paste operation removes formatting from the text.

Example URI syntax:

https://ApplicationServicesServerIP:8443/darwin/api/2.0/update-profile/15

Request

{
  "lockVersion": 1,
  "updateType": "SCALE_IN",
  "name": "ExternalScaleInTest1",
  "description": "ExternalScaleInTest1",
  "scaleinProperties": {
   "clusterNode": [
    {
     "name": SpringTravel",
    "nodeInstanceNames":       [
      "SpringTravel_4_",
      "SpringTravel_2_"
     ],
     "scaleInBy": 2
    }
   ]
  }
}

Response

{
  "errors": false,
  "message-list": [
    {
      "message-type": "INFO",
      "message": "Deployment update scheduled successfully.",
      "message-key": "deployment.update.scheduled.msg"
    }
  ]
  "result": {
    "id": "15",
    "lockVersion": 1,
    "name": "ExternalScaleInTest1",
    "description": "ExternalScaleInTest1 description",
    "deploymentTaskRef":
      {
        "uri": "/darwin/api/2.0/deployment-task/76",
        "id": "76",
        "name": "appd-Spring Travel-1.0.0-admin-14-759a3d26-0ad5-4e58-a3d2-6f34214e3637"
      }
    }
}

Delete an Update Profile

Deletes an update profile based on the provided identification.

The application publisher and deployer can access this API.

HTTP Method

DELETE

URI Syntax

https://ApplicationServicesServerIP:8443/darwin/api/2.0/update-profile/UpdateProfileID

You must type the URI syntax because the copy and paste operation removes formatting from the text.

Example URI syntax:

https://ApplicationServicesServerIP:8443/darwin/api/2.0/update-profile/2

Response

{
  "errors": false,
  "message-list": [
    {
      "message-type": "INFO",
      "message": "Successfully deleted UpdateProfile.",
      "message-key": "delete.msg"
     }
  ]
}

Get Last Failed Update Process

Retrieves the last failed update process.

The application publisher and deployer can access this API.

HTTP Method

GET

URI Syntax

https://ApplicationServicesServerIP:8443/darwin/api/2.0/deployment/DeploymentID/failed-deployment-task

You must type the URI syntax because the copy and paste operation removes formatting from the text.

Example URI syntax:

https://ApplicationServicesServerIP:8443/darwin/api/2.0/deployment/1/failed-deployment-task

Response

If a last failed deployment task is not available, the following response appears.

{ 
  "errors": false,
  "messageList": [
    {
      "messageType": "INFO",
      "message": "No latest failed update deployment found.",
      "messageKey":
"valid.failed.updateProfile.deployment.not.found",     
    }
  ],
  "result": null
}

Rollback a Last Update Process

Performs a rollback on a failed or last successful update process based on the provided deployment identification.

The application publisher and deployer can access this API.

HTTP Method

POST

URI Syntax

https://ApplicationServicesServerIP:8443/darwin/api/2.0/update-profile/

You must type the URI syntax because the copy and paste operation removes formatting from the text.

Example URI syntax:

https://ApplicationServicesServerIP:8443/darwin/api/2.0/update-profile

Request

{
   "deployment-id": 2,
    "operation": "ROLLBACK"
}

Response

{
  "errors": false,
  "message-list": [
    {
      "message-type": "INFO",
      "message": "Deployment rollback scheduled successfully.",
      "message-key": "deployment.rollback.scheduled.msg"
      }
    ],
    "result": {
        "deployment-task-ref": {
            "@type": "Reference",
            "id": "8",
            "uri": "/darwin/api/2.0/deployment-task/8"
        }
    }
}

Create and Schedule a Run Custom Task Update Profile

Creates and schedules the update to run the arbitrary custom tasks on an existing deployment.

HTTP Method

POST

URI Syntax

https://ApplicationServicesServerIP:8443/darwin/api/2.0/update-profile

You must type the URI syntax because the copy and paste operation removes formatting from the text.

Request

{
  "deploymentId": 10,
  "updateType": "RUN_CUSTOM_TASK",
  "name": "RunCustomTaskTest",
  "description": "Run Custom Task Test",
  "customTaskProperties": [
    {
      "name": "RHEL61_64bit_v1.0",
      "customTask": [
        {
          "taskVersionId": "430",
          "name": "Run_SQL_Script_for_Oracle_Database",
          "property": [
            {
              "key": "sql_runas_username",
              "value": "system",
              "description": "The Oracle username to run SQL script.",
              "secured": false,
              "expression": false
            },
            {
              "key": "sql_runas_password",
              "value": "password",
              "description": "The password of Oracle username.",
              "secured": true,
              "expression": false
            },
            {
              "key": "sql_script",
              "value": "select * from dual;",
              "description": "The SQL script to be run on local Oracle server.",
              "secured": false,
              "expression": false
            }
          ]
        }
      ]
    }
  ]
}

Response

{
  "errors": false,
  "message-list": [
    {
      "message-type": "INFO",
      "message": "Deployment update scheduled successfully.",
      "message-key": "deployment.update.scheduled.msg",
      "property": null
     }
   ]
  "result": {
    "id": "13",
    "lockVersion": 1,
    "name": "RunCustomTaskTest",
    "description" :"Run Custom Task Test",
    "deploymentTaskRef" : {
      "uri": "/darwin/api/2.0/deployment-task/21",
      "id": "21",
      "name": "appd-oracle-test-1.0.0-Administrator-10-f2361c65-e03a-4f90-bd88-03bda1bc3434"
    }
  }
}

Update and Schedule a Run Custom Task Update Profile

Updates and schedules an existing update to run the arbitrary custom tasks on an existing deployment.

HTTP Method

POST

URI Syntax

https://ApplicationServicesServerIP:8443/darwin/api/2.0/update-profile/UpdateProfileID

Request

{
  "lockVersion": 1,
  "updateType": "RUN_CUSTOM_TASK",
  "customTaskProperties": [
    {
      "name": "RHEL61_64bit_v1.0",
      "customTask": [
        {
          "taskVersionId": "430",
          "name": "Run_SQL_Script_for_Oracle_Database",
          "property": [
            {
              "key": "sql_script",
              "value": "select sysdate from dual;",
              "description": "The SQL script to be run on local Oracle server.",
              "secured": false,
              "expression": false
            }
          ]
        }
      ]
    }
  ]
}

Response

{
  "errors": false,
  "message-list": [
    {
      "message-type": "INFO",
      "message": "Deployment update scheduled successfully.",
      "message-key": "deployment.update.scheduled.msg",
      "property": null
     }
   ]
  "result": {
    "id": "13",
    "lockVersion": 2,
    "name": "RunCustomTaskTest",
    "description" :"Run Custom Task Test",
    "deploymentTaskRef" : {
      "uri": "/darwin/api/2.0/deployment-task/22",
      "id": "22",
      "name": "appd-oracle-test-1.0.0-Administrator-10-f2361c65-e03a-4f90-bd88-03bda1bc3434"
    }
  }
}