Application manager actions using curl commands

Listing applications

Form

curl [options] -H "X-Auth-Token:

token" \
https://

controller_ip:8443/sdn/v2.0/apps

Example of listing applications

curl -ksS -H "X-Auth-Token:3d61f0d3e61349359e6dbd82ec02c113" \
https://10.0.1.42:8443/sdn/v2.0/apps

Example output:

{
           "apps": [
               {
                "action": "NONE",
                "catalog_id": "",
                "deployed": "2014-06-18T19:22:49.536Z",
                "desc": "Path Diagnostic Utility",
                "download_url": "",
                "name": "Path Diagnostics",
                "product_id": "",
                "sku": "",
                "state": "ACTIVE",
                "uid": "com.hp.sdn.ctl.diag",
                "vendor": "Hewlett-Packard",
                "version": "2.3.5.6370"
              },
               {
                "action": "NONE",
                "catalog_id": "",
                "deployed": "2014-06-18T19:22:50.890Z",
                "desc": "Link Management",
                "download_url": "",
                "name": "Link Manager",
                "product_id": "",
                "sku": "",
                "state": "ACTIVE",
                "uid": "com.hp.sdn.ctl.linkdisco",
                "vendor": "Hewlett-Packard",
                "version": "2.3.5.6370"
                }
             ]
         }

Listing information about an application

Form

curl [options] -H "X-Auth-Token:

token" \
https://

controller_ip:8443/sdn/v2.0/apps/

app_id

Example

curl -ksS -H "X-Auth-Token:3d61f0d3e61349359e6dbd82ec02c113" \
https://10.0.1.42:8443/sdn/v2.0/apps/com.hp.sdn.ctl.diag

Example output

{
           "app": {
              "action": "NONE",
              "catalog_id": "",
              "deployed": "2014-06-18T19:22:49.536Z",
              "desc": "Path Diagnostic Utility",
              "download_url": "",
              "name": "Path Diagnostics",
              "product_id": "",
              "sku": "",
              "state": "ACTIVE",
              "uid": "com.hp.sdn.ctl.diag",
              "vendor": "Hewlett-Packard",
              "version": "2.3.5.6370"
           }
         }

Getting application health status

The HEAD command on health status returns only the response code rather than the entire message for management-type clients that want to poll for health status. Returns HTTP status as follows:

200 for healthy
290 for unhealthy
295 for critical

Form

curl [options] -H "X-Auth-Token:" -w %{http_code} \
-X HEAD https://

controller_ip:8443/sdn/v2.0/apps/

app_id/health

Example

curl -ksS -H "X-Auth-Token:3d61f0d3e61349359e6dbd82ec02c113" -w %{http_code} \
-X HEAD https://10.0.1.42:8443/sdn/v2.0/apps/com.hp.sdn.ctl.diag/health

Example output

200

Uploading an application (new or upgrade)

Form

curl [options] -H "X-Auth-Token:

token" \
-X POST https://

controller_ip:8443/sdn/v2.0/apps/ \
--data-binary @<full_path_to_app_zip>

Example

curl -ksS -H "X-Auth-Token:3d61f0d3e61349359e6dbd82ec02c113" \
-X POST https://10.0.1.42:8443/sdn/v2.0/apps/ \
--data-binary @/home/hummer/dev/flare/dist/testApps/geewiz-apps-1.0.0.zip

Example output (new)

{
             "app": {
                  "action": "NONE",
                  "catalog_id": "",
                  "deployed": "1970-01-01T00:00:00.000Z",
                  "desc": "Gee Wiz event production",
                  "download_url": "",
                  "name": "GeeWiz",
                  "product_id": "",
                  "sku": "",
                  "state": "STAGED",
                  "uid": "com.geewiz",
                  "vendor": "Gee Wiz, Inc.",
                  "version": "1.0.0"
             }
           }

Example output (upgrade)

{
             "app": {
                  "action": "NONE",
                  "catalog_id": "",
                  "deployed": "2014-06-18T23:04:25.955Z",
                  "desc": "Gee Wiz event production",
                  "download_url": "",
                  "name": "GeeWiz",
                  "product_id": "",
                  "sku": "",
                  "state": "UPGRADE_STAGED",
                  "uid": "com.geewiz",
                  "vendor": "Gee Wiz, Inc.",
                  "version": "2.0.0"
             }
         }

Installing a new application

Form

curl [options] -H "X-Auth-Token:" \
-X POST https://

controller_ip:8443/sdn/v2.0/apps/

app_id/action \
-d install

Example

curl -ksS -H "X-Auth-Token:3d61f0d3e61349359e6dbd82ec02c113" \
-X POST https://10.0.1.42:8443/sdn/v2.0/apps/com.geewiz/action \
-d install

Example output

{
           "app": {
                "action": "NONE",
                "catalog_id": "",
                "deployed": "2014-06-18T21:46:39.845Z",
                "desc": "Gee Wiz event production",
                "download_url": "",
                "name": "GeeWiz",
                "product_id": "",
                "sku": "",
                "state": "ACTIVE",
                "uid": "com.geewiz",
                "vendor": "Gee Wiz, Inc.",
                "version": "1.0.0"
                 }
            }

Upgrading an application

Form

curl [options] -H "X-Auth-Token:

token" \
-X POST https://

controller_ip:8443/sdn/v2.0/apps/

app_id/action \
-d upgrade

Example

curl -ksS -H "X-Auth-Token:3d61f0d3e61349359e6dbd82ec02c113" \
-X POST https://10.0.1.42:8443/sdn/v2.0/apps/com.geewiz/action \
 -d upgrade

Example output

{
             "app": {
                "action": "NONE",
                "catalog_id": "",
                "deployed": "2014-06-18T23:04:25.955Z",
                "desc": "Gee Wiz event production",
                "download_url": "",
                "name": "GeeWiz",
                "product_id": "",
                "sku": "",
                "state": "ACTIVE",
                "uid": "com.geewiz",
                "vendor": "Gee Wiz, Inc.",
                "version": "2.0.0"
            }
         }

Disabling an application

Form

curl [options] -H "X-Auth-Token:

token" \
-X POST https://

controller_ip:8443/sdn/v2.0/apps/

app_id/action \
-d disable

Example

curl -ksS -H "X-Auth-Token:3d61f0d3e61349359e6dbd82ec02c113" \
-X POST https://10.0.1.42:8443/sdn/v2.0/apps/com.geewiz/action \
-d disable

Example output

{
             "app": {
                "action": "NONE",
                "catalog_id": "",
                "deployed": "2014-06-18T23:04:25.955Z",
                "desc": "Gee Wiz event production",
                "download_url": "",
                "name": "GeeWiz",
                "product_id": "",
                "sku": "",
                "state": "DISABLED",
                "uid": "com.geewiz",
                "vendor": "Gee Wiz, Inc.",
                "version": "2.0.0"
             }
         }

Enabling an application

Form

curl [options] -H "X-Auth-Token:

token" \
-X POST https://

controller_ip:8443/sdn/v2.0/apps/

app_id/action \
-d enable

Example

curl -ksS -H "X-Auth-Token:3d61f0d3e61349359e6dbd82ec02c113" \
-X POST https://10.0.1.42:8443/sdn/v2.0/apps/com.geewiz/action \
-d enable

Example output

{
             "app": {
                  "action": "NONE",
                  "catalog_id": "",
                  "deployed": "2014-06-18T23:04:25.955Z",
                  "desc": "Gee Wiz event production",
                  "download_url": "",
                  "name": "GeeWiz",
                  "product_id": "",
                  "sku": "",
                  "state": "ACTIVE",
                  "uid": "com.geewiz",
                  "vendor": "Gee Wiz, Inc.",
                  "version": "2.0.0"
             }
         }

Removing a staged application

This curl request is used to remove a newly uploaded application before it is installed or upgraded. It has no output.

Form

curl [options] -H "X-Auth-Token:

token" \
-X POST https://

controller_ip:8443/dn/v2.0/apps/

app_id/action \
-d cancel

Example

curl -ksS -H "X-Auth-Token:3d61f0d3e61349359e6dbd82ec02c113" \
-X POST https://10.0.1.42:8443/sdn/v2.0/apps/com.geewiz/action \
-d cancel

Deleting an application

This curl request is used to shutdown and completely remove all application versions. It has no output.

Form

curl [options] -H "X-Auth-Token:

token" \
-X DELETE https://

controller_ip:8443/sdn/v2.0/apps/

app_id

Example

curl -ksS -H "X-Auth-Token:3d61f0d3e61349359e6dbd82ec02c113" \
-X DELETE https://10.0.1.42:8443/sdn/v2.0/apps/com.geewiz