NAV
shell

Introduction

Welcome to the Morpheus API Documentation.

Morpheus is a powerful cloud management tool that provides provisioning, monitoring, logging, backups, and application deployment strategies.

This document aims to illustrate the Morpheus API protocol and its available endpoints.

The API endpoints are organized into the same sections that the Morpheus UI uses.

Sections

Section Description
Operations Dashboard, Activity, Billing, Wiki
Provisioning Instances, Apps, Blueprints, Automation
Infrastructure Groups, Clouds, Hosts, Clusters
Logs View logs created by your Hosts and Containers.
Monitoring Checks, Incidents, Alerts, Contacts
Tools Cypher, Archives, Image Builder
Administration Tenants, Users, Roles, Policies

To initialize a freshly installed Morpheus appliance, see Setup.

Version

You can determine your current version using Check Appliance.

API

The Morpheus API is an HTTP interface for interacting with the Morpheus appliance. It provides a RESTful interface where GET reads, POST creates, PUT updates and DELETE destroys resources.

curl "$MORPHEUS_API_URL/api/users/1" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structured like this:

{
  "user": {
    "id": 1,
    "accountId": 1,
    "username": "admin",
    "displayName": "Morpheus Admin",
    "email": "admin@morpheusdata.com",
    "firstName": "Morpheus",
    "lastName": "Admin",
    "dateCreated": "2017-03-16T21:26:39+0000",
    "lastUpdated": "2019-10-30T23:09:01+0000",
    "enabled": true,
    "accountExpired": false,
    "accountLocked": false,
    "passwordExpired": false,
    "loginCount": 86638,
    "loginAttempts": 0,
    "lastLoginDate": "2016-06-30T21:05:15+0000",
    "roles": [
      {
        "id": 1,
        "authority": "System Admin",
        "description": "Super User"
      }
    ],
    "account": {
      "id": 1,
      "name": "root"
    }
  }
}

This is an example of a Morpheus API request that retrieves details about a User.

HTTP Request

GET https://api.gomorpheus.com/api/instances/:id

This is the format for the request method and path of the endpoint. Most paths have a format like /api/resources/:id.

URL Parameters

Parameter Description
:id ID of the Instance.

This is the format for URL parameters. These are parameters that are included in the path of the request.

HTTP Headers

Header Description
Authorization Use the format bearer access_token. Example: Authorization: bearer e1d62c34-f7f5-4713-a874-31491e7707de. Most endpoints require this header. Some exceptions include Authentication and Setup.
Content-Type Use application/json for POST and PUT requests. This is needed to ensure your JSON payload is parsed. Exceptions to this rule include file uploads where application/x-www-form-urlencoded and application/octet-stream may be needed instead.

Query Parameters

Parameter Description
phrase If specified will return a partial match on name.

This is the format for query string parameters. These are parameters which are included in the query string of the request.

JSON Parameters

Parameter Description
name A unique string.

This is the format for JSON parameters. These are parameters which are included in the body of the request, with Content-Type application/json.

HTTP Response

The Morpheus API returns 200 OK for successful requests. If a request fails, an HTTP Error Code will be returned. JSON is always returned, even when an error occurs.

The API (almost) always responds with Content-Type: application/json and a response body that is valid JSON.

This is an example of an API response that retrieves a Contact record by ID.

Success Example

curl "$MORPHEUS_API_URL/api/monitoring/contacts/1" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structured like this:

{
  "success": true,
  "contact": {
    "id": 1,
    "name": "Morpheus Admin",
    "emailAddress": "admin@morpheusdata.com",
    "smsAddresss": null
  }
}

Error Example

Here is an example a a 400 error shell curl "$MORPHEUS_API_URL/api/monitoring/contacts/999" \ -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structured like this:

{
  "success": false,
  "msg": "Contact not found for this account"
}

Environment Variables

export MORPHEUS_API_URL="https://api.gomorpheus.com"
export MORPHEUS_API_TOKEN="e1d62c34-f7f5-4713-a874-31491e7707de"

The following environment variables are used throughout the examples in this document.

Environment Variable Description
MORPHEUS_API_URL The URL of your morpheus data appliance. Example: https://api.gomorpheus.com
MORPHEUS_API_TOKEN Your access token. Example: e1d62c34-f7f5-4713-a874-31491e7707de. See Get Access Token.

Errors

curl "$MORPHEUS_API_URL/api/foobar" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns HTTP 404 and JSON structured like this:

{
  "success": false,
  "msg": "Unable to find api endpoint GET /api/foobar"
}

As with any API, errors will occur. When the Morpheus API encounters an error, it returns an HTTP Error Code, not 200 OK.

The response body typically returns valid JSON, even when an error occurs.

Error Codes

The Morpheus API uses the following error codes:

Error Code Description
400 Bad Request – Your request failed. It may just require you to change your request parameters.
401 Unauthorized – Your API key is invalid. Check your Authorization header.
403 Forbidden – Your API key does not have the required role or permissions.
404 Not Found – The specified resource could not be found.
405 Method Not Allowed – You tried to access a resource with an invalid method
406 Not Acceptable – You requested a format that isn’t json
410 Gone – The entity requested has been removed from our servers
418 I’m a teapot
429 Too Many Requests – You’re asking too much of the server. Slow down!
500 Internal Server Error – We had a problem with our server. Try again later.
503 Service Unavailable – We’re temporarially offline for maintanance. Please try again later.

Troubleshooting

The HTTP response usually contains a body with valid JSON about the error and what caused it.

400 Error

This errors is returned if the request could not be completed as requested. This usually means a required parameter is missing or invalid. These responses often include an errors object to indicate which parameters were invalid.

{
  "success": false,
  "errors": {
    "email": "Please enter a valid email address"
  }
}

401 Error

This error is returned if your access token is invalid or expired.

{
  "error": "invalid_token",
  "error_description": "Invalid access token: bad-token"
}

403 Error

This error is seen if you try to access an endpoint without the required permissions.

{
  "success": false,
  "msg": "You do not have permissions to access this api endpoint"
}

404 Error

This error is returned when the api path is unknown. It can also be seen if a resource could be not be found by the specified ID.

{
  "success": false,
  "msg": "Unable to find api endpoint GET /api/foobar"
}

It can also be seen if a resource could be not be found by the specified ID.

{
  "success": false,
  "msg": "App not found"
}

500 Error

This error indicates something went wrong with the request and an unexpected error has occured.

{
  "success": false,
  "msg": "Oops, something bad happened."
}

Programming Languages

The Morpheus API has clients available for use in many different programming languages.

Language Description
Terminal The Morpheus CLI binary can be used for scripting in any unix environment, or on Windows PowerShell.
Ruby The Morpheus CLI is written in ruby and provides the APIClient driver.
Python The Morpheus Python client is under development.
Java The Morpheus Java client is under development.
Go The Morpheus Go client is under development.
Terraform (Go) The Morpheus Terraform Provider is under development.

Authentication

The Morpheus API uses an OAUTH 2.0 based authentication model.

Authentication is done by passing an access token in the Authorization HTTP header.

Use Get Access Token to acquire a valid access token.

Most of the /api Morpheus API endpoints require authentication. Some endpoints do not require authentication, and can be be accessed anonymously. This includes Get Access Token and Check Appliance.

Authorization Header

This header must be included in all requests that require authentication.

Header Description
Authorization Use the format bearer access_token. Example: Authorization: bearer e1d62c34-f7f5-4713-a874-31491e7707de

Get Access Token

This endpoint provides authentication via username and password of a morpheus User. The response includes a valid access token. If your current token is expired, a new one will be created and returned.

curl -XPOST "$MORPHEUS_API_URL/oauth/token?grant_type=password&scope=write&client_id=morph-api" \
  -d 'username=admin' -d 'password=foobar'

The above command returns JSON structured like this:

{
  "access_token": "e1d62c34-f7f5-4713-a874-31491e7707de",
  "refresh_token": "718cc628-b89f-43f5-bef7-f39887b47e68",
  "token_type": "bearer",
  "expires_in": 30463819,
  "scope": "write"
}

HTTP Request

POST https://api.gomorpheus.com/oauth/token

HTTP Headers

Header Description
Content-Type application/x-www-form-urlencoded. This endpoint does not currently accept application/json, it should in the future.

Query Parameters

Parameter Default Description
client_id Client ID, use morph-api. Users may only have one access token per Client ID. The CLI uses morph-cli.
grant_type OAuth Grant Type, use password.
scope OAuth token scope, use write.

Request Parameters

Parameter Default Description
username User username. Subtenant users will need to pass their subdomain prefix like domain\username. The default tenant subdomain is the tenant account ID. Example: 2\neo
password User password

Response

Name Description
access_token The access token for this user (scoped to client_id).
refresh_token The refresh token for this user (scoped to client_id).
expires_in The remaining seconds before the token expires. By default, access tokens are valid for 1 year or until it is refreshed. This time may vary depending on the client_id that is used.
token_type The token type, this will be bearer.
scope The scope, this will be write.

Refresh Access Token

This endpoint allows refreshing your current access token to get a new token. This is done by passing your current refresh_token. This provides a way to renew your client’s session with the API, and extend the expiration date.

Your refresh_token is returned by Get Access Token.

curl -XPOST "$MORPHEUS_API_URL/oauth/token?grant_type=refresh_token&client_id=morph-api&scope=write" \
  -d 'refresh_token=718cc628-b89f-43f5-bef7-f39887b47e68'

The above command returns JSON structured like this:

{
  "access_token": "e1d62c34-f7f5-4713-a874-31491e7707de",
  "refresh_token": "718cc628-b89f-43f5-bef7-f39887b47e68",
  "token_type": "bearer",
  "expires_in": 30463819,
  "scope": "write"
}

HTTP Request

POST https://api.gomorpheus.com/oauth/token

HTTP Headers

Header Default Description
Content-Type Use application/x-www-form-urlencoded.

Query Parameters

Parameter Default Description
client_id Client ID, use morph-api. Users only have one access token per Client ID.
grant_type OAuth Grant Type, use refresh_token.
scope OAuth token scope, use write.

Request Body

Parameter Default Description
refresh_token Refresh Token, the current refresh token, scoped to Client ID.

Response

Name Description
access_token The access token for this user, scoped to Client ID.
refresh_token The refresh token for this user, scoped to Client ID.
expires_in The remaining seconds before the token expires. By default, access tokens are valid for 1 year or until it is refreshed.
token_type The token type, this will be bearer.
scope The scope, this will be write.

Whoami

Provides API to retrieve information about yourself, including your roles and permissions.

The appliance build version is also returned.

curl "$MORPHEUS_API_URL/api/whoami" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structured like this:

{
  "user": {
    "id": 1,
    "accountId": 1,
    "username": "admin",
    "displayName": "Admin",
    "email": "admin@morpheustestdata.com",
    "firstName": "Admin",
    "lastName": "",
    "dateCreated": "2016-08-28T03:28:09+0000",
    "lastUpdated": "2018-11-20T05:11:50+0000",
    "enabled": true,
    "accountExpired": false,
    "accountLocked": false,
    "passwordExpired": false,
    "roles": [
      {
        "id": 1,
        "authority": "System Admin",
        "description": "Super User"
      }
    ],
    "account": {
      "id": 1,
      "name": "root"
    }
  },
  "isMasterAccount": true,
  "permissions": {
    "ComputeSite": "full",
    "ComputeZone": "full",
    "InstanceType": "full",
    "account-usage": "full",
    "admin-accounts-users": "full",
    "admin-accounts": "full",
    "admin-appliance": "full",
    "admin-backupSettings": "full",
    "admin-certificates": "full",
    "admin-cm": "full",
    "admin-containers": "full",
    "admin-environments": "full",
    "admin-global-policies": "full",
    "admin-groups": "full",
    "admin-identity-sources": "full",
    "admin-keypairs": "full",
    "admin-licenses": "full",
    "admin-logSettings": "full",
    "admin-monitorSettings": "full",
    "admin-policies": "full",
    "admin-provisioningSettings": "full",
    "admin-roles": "full",
    "admin-servers": "full",
    "admin-servicePlans": "full",
    "admin-users": "full",
    "admin-utilities": "full",
    "admin-whitelabel": "full",
    "admin-zones": "full",
    "app-templates": "full",
    "apps": "full",
    "arm-template": "full",
    "automation-services": "full",
    "backup-services": "full",
    "backups": "full",
    "billing": "full",
    "cloudFormation-template": "full",
    "dashboard": "read",
    "deployment-services": "full",
    "deployments": "full",
    "guidance": "full",
    "infrastructure-boot": "full",
    "infrastructure-loadbalancer": "full",
    "infrastructure-networks": "full",
    "infrastructure-securityGroups": "full",
    "infrastructure-state": "full",
    "infrastructure-storage-browser": "full",
    "infrastructure-storage": "full",
    "logs": "full",
    "migrations": "full",
    "monitoring": "full",
    "operations-approvals": "full",
    "operations-health": "read",
    "provisioning-admin": "full",
    "provisioning-force-delete": "full",
    "provisioning": "full",
    "reports-analytics": "full",
    "reports": "full",
    "scheduling-execute": "full",
    "scheduling-power": "full",
    "services-archives": "full",
    "services-cypher": "full",
    "services-image-builder": "full",
    "services-kubernetes": "full",
    "services-network-registry": "full",
    "support-menu": "read",
    "task-scripts": "full",
    "tasks": "full",
    "terminal-access": "yes",
    "terminal": "full",
    "terraform-template": "full",
    "thresholds": "full",
    "trust-services": "full",
    "virtual-images": "full"
  },
  "appliance": {
    "buildVersion": "3.5.3"
  }
}

HTTP Request

GET https://api.gomorpheus.com/api/whoami

Operations

The Operations API endpoints provide insight into the Morpheus appliance, activity, reports and approvals. Documentation can be viewed and modified via the Wiki API.

Dashboard

This endpoint provides data for rendering the Morpheus appliance dashboard.

Get Dashboard Data

curl "$MORPHEUS_API_URL/api/dashboard" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structured like this:

{
  "data": []
}
{
  "success": true,
  "monitoring": {
    "avgHealth": 9.2,
    "avgResponseTime": 0.6,
    "warningApps": 5,
    "warningChecks": 8,
    "failApps": 0,
    "failChecks": 0,
    "successApps": 2,
    "mutedApps": 1,
    "successChecks": 2,
    "mutedChecks": 5,
    "openIncidents": [
      {
        "id": 9,
        "visibility": "private",
        "channelId": "333206ed-9ba9-45b9-88f4-08ac0a9e64f2",
        "lastError": "redis status: Error",
        "severityId": 20,
        "autoClose": true,
        "endDate": null,
        "duration": null,
        "startDate": "2016-10-25T12:37:00Z",
        "severity": "critical",
        "app": null,
        "resolution": null,
        "comment": null,
        "checks": [

        ],
        "incidentEvents": [
          {
            "id": 23
          },
          {
            "id": 24
          },
          {
            "id": 21
          },
          {
            "id": 22
          }
        ],
        "lastCheckTime": "2016-10-25T12:37:00Z",
        "lastMessage": null,
        "name": "testapp",
        "checkGroups": [

        ],
        "account": {
          "id": 1
        },
        "createdBy": null,
        "status": "open",
        "autoManaged": true,
        "inUptime": true,
        "notificationEvents": [

        ]
      },
      {
        "id": 12,
        "visibility": "private",
        "channelId": "cdff5f78-19df-41e0-b6dc-2ab87cedeae5",
        "lastError": "unheard from beyond check interval limit.",
        "severityId": 20,
        "autoClose": true,
        "endDate": null,
        "duration": null,
        "startDate": "2017-02-21T14:04:56Z",
        "severity": "critical",
        "app": null,
        "resolution": "we fixed the issue",
        "comment": "uh, something bad happened..",
        "checks": [

        ],
        "incidentEvents": [
          {
            "id": 27
          },
          {
            "id": 28
          },
          {
            "id": 29
          }
        ],
        "lastCheckTime": "2017-02-21T14:04:56Z",
        "lastMessage": null,
        "name": "testmysql2",
        "checkGroups": [

        ],
        "account": {
          "id": 1
        },
        "createdBy": null,
        "status": "open",
        "autoManaged": true,
        "inUptime": true,
        "notificationEvents": [

        ]
      }
    ],
    "allSuccess": false
  },
  "provisioning": {
    "instanceCount": 3,
    "allInstances": [
      {
        "id": 319,
        "accountId": 1,
        "instanceType": {
          "id": 6,
          "code": "apache",
          "category": "web",
          "name": "Apache"
        },
        "zones": [
          {
            "id": 40,
            "accountId": 1,
            "groups": [
              1
            ],
            "name": "qa-azure2",
            "description": null,
            "location": null,
            "visibility": "private",
            "zoneTypeId": 9
          }
        ],
        "layout": {
          "id": 1292,
          "code": "apache-azure-2.4-ubuntu-16.04-single",
          "name": "Azure Apache",
          "description": "This will provision a single process with no redundancy",
          "sortOrder": 10
        },
        "plan": {
          "name": "Basic_A0 (1 Core, 0.75GB Memory) (westus)",
          "id": 187,
          "code": "azure.plan.westus.Basic_A0"
        },
        "name": "test-azureapache1",
        "displayName": "test-azureapache1",
        "description": null,
        "dateCreated": "2019-09-18T16:07:47Z",
        "lastUpdated": "2019-10-25T09:12:29Z",
        "status": "unknown",
        "containerIds": [
          317
        ],
        "containers": [
          {
            "ip": "0.0.0.0",
            "port": {
              "id": 19,
              "exportName": "HTTP",
              "container": {
                "id": 317
              },
              "loadBalancerInstance": null,
              "primaryPort": false,
              "loadBalanceProtocol": null,
              "linkPort": true,
              "internalPort": 80,
              "export": true,
              "portType": {
                "id": 8
              },
              "displayName": "Http",
              "protocol": "http",
              "portIndex": 0,
              "externalIp": null,
              "externalPort": 80,
              "internalIp": null,
              "visible": true,
              "loadBalance": true
            }
          }
        ],
        "version": "2.4",
        "environmentPrefix": null
      }
    ]
  },
  "instanceStats": {
    "usedMemory": 479804000,
    "maxMemory": 1771446368,
    "usedStorage": 6202490880,
    "maxStorage": 55530786816,
    "running": 2,
    "total": 3
  },
  "backups": {
    "backupStats": {
      "1": {
        "totalCompleted": 0,
        "totalSize": 0,
        "success": 0,
        "failed": 0,
        "avgSize": 0,
        "successRate": 0,
        "failRate": 0,
        "lastFiveResults": [

        ]
      },
      "10": {
        "totalCompleted": 0,
        "totalSize": 0,
        "success": 0,
        "failed": 0,
        "avgSize": 0,
        "successRate": 0,
        "failRate": 0,
        "lastFiveResults": [

        ]
      },
      "16": {
        "totalCompleted": 0,
        "totalSize": 0,
        "success": 0,
        "failed": 0,
        "avgSize": 0,
        "successRate": 0,
        "failRate": 0,
        "lastFiveResults": [

        ]
      }
    },
    "accountStats": {
      "totalSizeByDay": [
        0,
        0,
        0,
        0,
        0
      ],
      "totalSizeByDay7Days": [
        0,
        0,
        0,
        0,
        0,
        0,
        0
      ],
      "formattedTotalSize": {
        "value": "0",
        "units": "KB"
      },
      "backupCount": 3,
      "totalSize": 0,
      "success": 0,
      "failed": 0,
      "totalCompleted": 0,
      "avgSize": 0,
      "failedRate": 0,
      "successRate": 0,
      "nextFireTotal": 1,
      "backupDayCount": [
        0,
        0,
        0,
        0,
        0,
        0,
        0
      ],
      "backupDayCountTotal": 0
    }
  },
  "activity": [
    {
      "success": false,
      "name": "dev-appliance",
      "message": "Check successfully been created.",
      "ts": "2019-10-22T00:06:20Z",
      "activityType": "Monitoring",
      "accountId": 1,
      "userId": 1,
      "userName": "admin",
      "objectId": 238,
      "objectType": "MonitorCheck",
      "_id": "0276e1fc-214d-4cb3-bcf4-9ebda0b26542",
      "timestamp": "2019-10-22T00:06:20Z"
    },
    {
      "success": true,
      "name": "admin",
      "message": "User 'admin' updated. Password changed.",
      "ts": "2019-10-08T21:17:52Z",
      "activityType": "Admin",
      "accountId": 1,
      "userId": 1,
      "userName": "admin",
      "objectId": 96,
      "objectType": "User",
      "_id": "26976fe0-a722-4d20-9849-9405a95d0db9",
      "timestamp": "2019-10-08T21:17:52Z"
    }
  ]
}

HTTP Request

GET https://api.gomorpheus.com/api/dashboard

Response

Name Description
data An object containing the dashboard data.

More documentation coming soon…

Activity

This endpoint provides data about activity with the Morpheus appliance. User activity and other morpheus events can be seen here.

The most recent activity is returned by default.

Get All Activity

curl "$MORPHEUS_API_URL/api/activity" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structured like this:

{
  "success": true,
  "activity": [
    {
      "date": "2019-10-23T04:00:00Z"
    },
    {
      "success": false,
      "deleted": true,
      "name": "test check",
      "siteId": null,
      "message": "Check has successfully been deleted by 'root.",
      "ts": "2019-10-23T19:31:54Z",
      "activityType": "Alert",
      "accountId": 1,
      "userId": 1,
      "userName": "root",
      "objectId": 239,
      "objectType": "MonitorCheck",
      "_id": "ed970f86-c2bd-4ea2-8c3e-37494c8d8c67",
      "timestamp": "2019-10-23T19:31:54Z"
    },
    {
      "date": "2019-10-22T04:00:00Z"
    },
    {
      "success": false,
      "name": "dev-appliance",
      "message": "Check has successfully been updated.",
      "ts": "2019-10-22T07:55:49Z",
      "activityType": "Monitoring",
      "accountId": 1,
      "userId": 1,
      "userName": "root",
      "objectId": 238,
      "objectType": "MonitorCheck",
      "_id": "247f122a-2dd6-4d92-a945-9e1fc35d8e51",
      "timestamp": "2019-10-22T07:55:49Z"
    },
    {
      "date": "2019-10-21T04:00:00Z"
    },
    {
      "success": false,
      "name": "dev-appliance",
      "message": "Check successfully been created.",
      "ts": "2019-10-22T00:06:20Z",
      "activityType": "Monitoring",
      "accountId": 1,
      "userId": 1,
      "userName": "root",
      "objectId": 238,
      "objectType": "MonitorCheck",
      "_id": "0276e1fc-214d-4cb3-bcf4-9ebda0b26542",
      "timestamp": "2019-10-22T00:06:20Z"
    },
    {
      "date": "2019-10-08T04:00:00Z"
    },
    {
      "success": true,
      "name": "julius",
      "message": "User 'julius' updated. Password changed.",
      "ts": "2019-10-08T21:17:52Z",
      "activityType": "Admin",
      "accountId": 1,
      "userId": 1,
      "userName": "root",
      "objectId": 96,
      "objectType": "User",
      "_id": "26976fe0-a722-4d20-9849-9405a95d0db9",
      "timestamp": "2019-10-08T21:17:52Z"
    }
  ]
}

HTTP Request

GET https://api.gomorpheus.com/api/activity

HTTP Headers

Header Description
Authorization A valid access token

Query Parameters

Parameter Default Description
max 25 Max number of results to return
offset 0 Offset of records you want to load
sort name Sort order
order asc Sort direction, use ‘desc’ to reverse sort
name Filter by name
phrase Filter by wildcard search of name and description
createdBy Filter by Created By (User) ID. Accepts multiple values.

Response

Name Description
activity Array of Activity Objects.

Activity Object

Name Description
name A brief name for the activity.
message A description of the activity.
userName Username of the author.
ts Timestamp of when the activity occurred.
objectId Object ID
objectType Object Type

History

Provides API interfaces for viewing the process history for instances.

Get All Processes

curl "$MORPHEUS_API_URL/api/processes" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structured like this:

{
  "processes": [
    {
      "id": 250,
      "accountId": 1,
      "uniqueId": "cebc47ec-cb2f-417a-886e-dd60cf81db26",
      "processType": {
        "code": "provision",
        "name": "provision"
      },
      "description": null,
      "subType": null,
      "subId": null,
      "zoneId": 34,
      "integrationId": null,
      "instanceId": 238,
      "containerId": 240,
      "serverId": 601,
      "containerName": "apachetest",
      "displayName": "apachetest",
      "timerCategory": "vmware",
      "timerSubCategory": "28",
      "status": "failed",
      "reason": null,
      "percent": 100.0,
      "statusEta": 348246,
      "message": null,
      "output": null,
      "error": null,
      "startDate": "2018-09-28T19:10:56+0000",
      "endDate": "2018-09-28T20:21:49+0000",
      "duration": 4253127,
      "dateCreated": "2018-09-28T19:10:56+0000",
      "lastUpdated": "2018-09-28T20:21:49+0000",
      "createdBy": {
        "username": "admin",
        "displayName": "Admin"
      },
      "updatedBy": {
        "username": "admin",
        "displayName": "Admin"
      },
      "events": [

      ]
    }
  ],
  "meta": {
    "size": 1,
    "total": 1,
    "offset": 0,
    "max": 25
  }
}

This endpoint retrieves all processes.

HTTP Request

GET https://api.gomorpheus.com/api/processes

Query Parameters

Parameter Default Description
phrase If specified will return a partial match on displayName, message or output
instanceId Filter by instance id(s)
containerId Filter by container id(s)
serverId Filter by server id(s)
zoneId Filter by zone id(s)
appId Filter by app id(s)

Get a Specific Process

curl "$MORPHEUS_API_URL/api/processes/250" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structured like this:

{
  "process": {
    "id": 250,
    "accountId": 1,
    "uniqueId": "cebc47ec-cb2f-417a-886e-dd60cf81db26",
    "processType": {
      "code": "provision",
      "name": "provision"
    },
    "description": null,
    "subType": null,
    "subId": null,
    "zoneId": 34,
    "integrationId": null,
    "instanceId": 238,
    "containerId": 240,
    "serverId": 601,
    "containerName": "apachetest",
    "displayName": "apachetest",
    "timerCategory": "vmware",
    "timerSubCategory": "28",
    "status": "failed",
    "reason": null,
    "percent": 100.0,
    "statusEta": 348246,
    "message": null,
    "output": null,
    "error": null,
    "startDate": "2018-09-28T19:10:56+0000",
    "endDate": "2018-09-28T20:21:49+0000",
    "duration": 4253127,
    "dateCreated": "2018-09-28T19:10:56+0000",
    "lastUpdated": "2018-09-28T20:21:49+0000",
    "createdBy": {
      "username": "admin",
      "displayName": "Admin"
    },
    "updatedBy": {
      "username": "admin",
      "displayName": "Admin"
    },
    "events": [
      {
        "id": 940,
        "processId": 250,
        "accountId": 1,
        "uniqueId": "54bf6265-1e86-45b4-b1a7-d4b198b13c45",
        "processType": {
          "code": "provisionResources",
          "name": "prepare resources"
        },
        "description": null,
        "refType": "container",
        "refId": 240,
        "subType": null,
        "subId": null,
        "zoneId": 34,
        "integrationId": null,
        "instanceId": 238,
        "containerId": 240,
        "serverId": 601,
        "containerName": "apachetest",
        "displayName": "apachetest",
        "status": "complete",
        "reason": null,
        "percent": 100.0,
        "statusEta": 348246,
        "message": null,
        "output": null,
        "error": null,
        "startDate": "2018-09-28T19:10:56+0000",
        "endDate": "2018-09-28T19:10:57+0000",
        "duration": 921,
        "dateCreated": "2018-09-28T19:10:56+0000",
        "lastUpdated": "2018-09-28T19:10:57+0000",
        "createdBy": {
          "username": "admin",
          "displayName": "Admin"
        },
        "updatedBy": {
          "username": "admin",
          "displayName": "Admin"
        }
      },
      {
        "id": 941,
        "processId": 250,
        "accountId": 1,
        "uniqueId": "9a9791b7-0091-4ba7-be4d-e1586be3078c",
        "processType": {
          "code": "provisionImage",
          "name": "prepare image"
        },
        "description": null,
        "refType": "container",
        "refId": 240,
        "subType": null,
        "subId": null,
        "zoneId": 34,
        "integrationId": null,
        "instanceId": 238,
        "containerId": 240,
        "serverId": 601,
        "containerName": "apachetest",
        "displayName": "apachetest",
        "status": "complete",
        "reason": null,
        "percent": 100.0,
        "statusEta": 348246,
        "message": null,
        "output": null,
        "error": null,
        "startDate": "2018-09-28T19:10:57+0000",
        "endDate": "2018-09-28T19:11:01+0000",
        "duration": 3645,
        "dateCreated": "2018-09-28T19:10:57+0000",
        "lastUpdated": "2018-09-28T19:11:01+0000",
        "createdBy": {
          "username": "admin",
          "displayName": "Admin"
        },
        "updatedBy": {
          "username": "admin",
          "displayName": "Admin"
        }
      },
      {
        "id": 942,
        "processId": 250,
        "accountId": 1,
        "uniqueId": "f1905796-9387-4983-ae0d-0fee5bb81f56",
        "processType": {
          "code": "provisionConfig",
          "name": "configure instance"
        },
        "description": null,
        "refType": "container",
        "refId": 240,
        "subType": null,
        "subId": null,
        "zoneId": 34,
        "integrationId": null,
        "instanceId": 238,
        "containerId": 240,
        "serverId": 601,
        "containerName": "apachetest",
        "displayName": "apachetest",
        "status": "complete",
        "reason": null,
        "percent": 100.0,
        "statusEta": 348246,
        "message": null,
        "output": null,
        "error": null,
        "startDate": "2018-09-28T19:11:01+0000",
        "endDate": "2018-09-28T19:11:01+0000",
        "duration": 28,
        "dateCreated": "2018-09-28T19:11:01+0000",
        "lastUpdated": "2018-09-28T19:11:01+0000",
        "createdBy": {
          "username": "admin",
          "displayName": "Admin"
        },
        "updatedBy": {
          "username": "admin",
          "displayName": "Admin"
        }
      },
      {
        "id": 943,
        "processId": 250,
        "accountId": 1,
        "uniqueId": "599a0c2d-491c-4178-8b86-55b6d019d48c",
        "processType": {
          "code": "provisionDeploy",
          "name": "deploy instance"
        },
        "description": null,
        "refType": "container",
        "refId": 240,
        "subType": null,
        "subId": null,
        "zoneId": 34,
        "integrationId": null,
        "instanceId": 238,
        "containerId": 240,
        "serverId": 601,
        "containerName": "apachetest",
        "displayName": "apachetest",
        "status": "complete",
        "reason": null,
        "percent": 100.0,
        "statusEta": 348246,
        "message": null,
        "output": null,
        "error": null,
        "startDate": "2018-09-28T19:11:01+0000",
        "endDate": "2018-09-28T19:11:33+0000",
        "duration": 32219,
        "dateCreated": "2018-09-28T19:11:01+0000",
        "lastUpdated": "2018-09-28T19:11:33+0000",
        "createdBy": {
          "username": "admin",
          "displayName": "Admin"
        },
        "updatedBy": {
          "username": "admin",
          "displayName": "Admin"
        }
      },
      {
        "id": 944,
        "processId": 250,
        "accountId": 1,
        "uniqueId": "4f4088b0-7043-4a35-82c1-00456643beaa",
        "processType": {
          "code": "provisionResize",
          "name": "resize instance"
        },
        "description": null,
        "refType": "container",
        "refId": 240,
        "subType": null,
        "subId": null,
        "zoneId": 34,
        "integrationId": null,
        "instanceId": 238,
        "containerId": 240,
        "serverId": 601,
        "containerName": "apachetest",
        "displayName": "apachetest",
        "status": "complete",
        "reason": null,
        "percent": 100.0,
        "statusEta": 348246,
        "message": null,
        "output": null,
        "error": null,
        "startDate": "2018-09-28T19:11:33+0000",
        "endDate": "2018-09-28T19:11:36+0000",
        "duration": 2896,
        "dateCreated": "2018-09-28T19:11:33+0000",
        "lastUpdated": "2018-09-28T19:11:36+0000",
        "createdBy": {
          "username": "admin",
          "displayName": "Admin"
        },
        "updatedBy": {
          "username": "admin",
          "displayName": "Admin"
        }
      },
      {
        "id": 945,
        "processId": 250,
        "accountId": 1,
        "uniqueId": "10559e2a-6980-4443-afd4-37b7471492ba",
        "processType": {
          "code": "provisionCloudInit",
          "name": "configure cloud init"
        },
        "description": null,
        "refType": "container",
        "refId": 240,
        "subType": null,
        "subId": null,
        "zoneId": 34,
        "integrationId": null,
        "instanceId": 238,
        "containerId": 240,
        "serverId": 601,
        "containerName": "apachetest",
        "displayName": "apachetest",
        "status": "complete",
        "reason": null,
        "percent": 100.0,
        "statusEta": 348246,
        "message": null,
        "output": null,
        "error": null,
        "startDate": "2018-09-28T19:11:36+0000",
        "endDate": "2018-09-28T19:11:42+0000",
        "duration": 6152,
        "dateCreated": "2018-09-28T19:11:36+0000",
        "lastUpdated": "2018-09-28T19:11:42+0000",
        "createdBy": {
          "username": "admin",
          "displayName": "Admin"
        },
        "updatedBy": {
          "username": "admin",
          "displayName": "Admin"
        }
      },
      {
        "id": 946,
        "processId": 250,
        "accountId": 1,
        "uniqueId": "0081e523-bfea-4664-b582-d68076943a46",
        "processType": {
          "code": "provisionLaunch",
          "name": "power on"
        },
        "description": null,
        "refType": "container",
        "refId": 240,
        "subType": null,
        "subId": null,
        "zoneId": 34,
        "integrationId": null,
        "instanceId": 238,
        "containerId": 240,
        "serverId": 601,
        "containerName": "apachetest",
        "displayName": "apachetest",
        "status": "complete",
        "reason": null,
        "percent": 100.0,
        "statusEta": 348246,
        "message": null,
        "output": null,
        "error": null,
        "startDate": "2018-09-28T19:11:42+0000",
        "endDate": "2018-09-28T19:11:45+0000",
        "duration": 2549,
        "dateCreated": "2018-09-28T19:11:42+0000",
        "lastUpdated": "2018-09-28T19:11:45+0000",
        "createdBy": {
          "username": "admin",
          "displayName": "Admin"
        },
        "updatedBy": {
          "username": "admin",
          "displayName": "Admin"
        }
      },
      {
        "id": 947,
        "processId": 250,
        "accountId": 1,
        "uniqueId": "de66729e-9580-43b0-950c-f2769cd86790",
        "processType": {
          "code": "provisionNetwork",
          "name": "network wait"
        },
        "description": null,
        "refType": "container",
        "refId": 240,
        "subType": null,
        "subId": null,
        "zoneId": 34,
        "integrationId": null,
        "instanceId": 238,
        "containerId": 240,
        "serverId": 601,
        "containerName": "apachetest",
        "displayName": "apachetest",
        "status": "failed",
        "reason": null,
        "percent": 100.0,
        "statusEta": 348246,
        "message": null,
        "output": null,
        "error": null,
        "startDate": "2018-09-28T19:11:45+0000",
        "endDate": "2018-09-28T20:21:49+0000",
        "duration": 4204122,
        "dateCreated": "2018-09-28T19:11:45+0000",
        "lastUpdated": "2018-09-28T20:21:49+0000",
        "createdBy": {
          "username": "admin",
          "displayName": "Admin"
        },
        "updatedBy": {
          "username": "admin",
          "displayName": "Admin"
        }
      }
    ]
  }
}

This endpoint retrieves a specific process.

HTTP Request

GET https://api.gomorpheus.com/api/processes/:id

URL Parameters

Parameter Description
ID The ID of the process

Get a Specific Process Event

curl "$MORPHEUS_API_URL/api/processes/events/940" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structured like this:

{
  "processEvent": {
    "id": 940,
    "processId": 250,
    "accountId": 1,
    "uniqueId": "54bf6265-1e86-45b4-b1a7-d4b198b13c45",
    "processType": {
      "code": "provisionResources",
      "name": "prepare resources"
    },
    "description": null,
    "refType": "container",
    "refId": 240,
    "subType": null,
    "subId": null,
    "zoneId": 34,
    "integrationId": null,
    "instanceId": 238,
    "containerId": 240,
    "serverId": 601,
    "containerName": "apachetest",
    "displayName": "apachetest",
    "status": "complete",
    "reason": null,
    "percent": 100.0,
    "statusEta": 348246,
    "message": null,
    "output": null,
    "error": null,
    "startDate": "2018-09-28T19:10:56+0000",
    "endDate": "2018-09-28T19:10:57+0000",
    "duration": 921,
    "dateCreated": "2018-09-28T19:10:56+0000",
    "lastUpdated": "2018-09-28T19:10:57+0000",
    "createdBy": {
      "username": "admin",
      "displayName": "Admin"
    },
    "updatedBy": {
      "username": "admin",
      "displayName": "Admin"
    }
  }
}

This endpoint retrieves a specific process event.

HTTP Request

GET https://api.gomorpheus.com/api/processes/events/:id

URL Parameters

Parameter Description
ID The ID of the process event

Billing

Provides API interfaces for viewing billing information by account, zone, instance or server. By default, the information returned is from the beginning of the current month until now. The date range is parameterized but the end date cannot exceed the current date.

Billing By Account

curl "$MORPHEUS_API_URL/api/billing/account" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structured like this:

{
  "success": true,
  "billingInfo": {
    "accountId": 1,
    "name": "morpheus",
    "startDate": "2017-02-01T07:00:00Z",
    "endDate": "2017-02-22T23:03:13Z",
    "priceUnit": "hour",
    "price": 0,
    "cost": 0,
    "zones": [
          {
                "computeServers": [
                    {
                        "servers": [
                          {
                            "usages": [
                              ]
                            }
                        ]
                    }
                ],
                "instances": [
                  {
                    "instances": [
                        {
                              "containers": {
                                "usages": [
                                  ]
                              }
                          }
                      ]
                    }
                ]
            }
        ]
  }
}

Retrieves billing information for the requesting user’s account.

HTTP Request

GET https://api.gomorpheus.com/api/billing/account

Query Parameters

Parameter Default Description
startDate Beginning of the current month
endDate Now
includeUsages true Optional ability to suppress the usage records

Billing For a Tenant

Will retrieve billing information for a specific account, if it is the current account or a sub account of the requesting user’s account.

curl "$MORPHEUS_API_URL/api/billing/account/1" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structured like this:

{
  "success": true,
  "billingInfo": {
    "accountId": 1,
    "name": "morpheus",
    "startDate": "2017-02-01T07:00:00Z",
    "endDate": "2017-02-22T23:03:13Z",
    "priceUnit": "hour",
    "price": 0,
    "cost": 0,
    "zones": [
      {
        "computeServers": [
          {
            "servers": [
              {
                "usages": [
                ]
              }
            ]
          }
        ],
        "instances": [
          {
            "instances": [
              {
                "containers": {
                  "usages": [
                                  ]
                }
              }
            ]
          }
        ]
      }
    ]
  }
}

This endpoint will retrieve a specific account by id if the user has permission to access it.

HTTP Request

GET https://api.gomorpheus.com/api/billing/account/:id

Query Parameters

Parameter Default Description
startDate Beginning of the current month
endDate Now
includeUsages true Optional ability to suppress the usage records

Billing For All Zones

curl "$MORPHEUS_API_URL/api/billing/zones" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structured like this:

{
  "success": true,
  "billingInfo": {
    "startDate": "2017-02-01T07:00:00Z",
    "endDate": "2017-02-22T23:03:13Z",
    "priceUnit": "hour",
    "price": 0,
    "cost": 0,
    "zones": [
      {
        "computeServers": [
          {
            "servers": [
              {
                "usages": [
                ]
              }
            ]
          }
        ],
        "instances": [
          {
            "instances": [
              {
                "containers": {
                  "usages": [
                  ]
                }
              }
            ]
          }
        ]
      }
    ]
  }
}

Retrieves billing information for all zones on the requestor’s account.

HTTP Request

GET https://api.gomorpheus.com/api/billing/zones

Query Parameters

Parameter Default Description
startDate Beginning of the current month
endDate Now
includeUsages true Optional ability to suppress the usage records

Billing For a Specific Zone

curl "$MORPHEUS_API_URL/api/billing/zones/1" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structured like this:

{
  "success": true,
  "billingInfo": {
    "zoneName": "",
    "zoneId": 1,
    "startDate": "2017-01-01T00:00:00Z",
    "endDate": "2017-01-31T23:59:59Z",
    "priceUnit": "hour",
    "computeServers": {
      "servers": [
        {
          "usages": [
          ]
        }
      ]
    },
    "instances": {
      "instances": [
        {
          "containers": [
            {
              "usages": [
                {
                  "applicablePrices": [
                  ]
                }
              ]
            }
          ]
        }
      ]
    }
  }
}

Retrieves billing information for a specific zone in the requestor’s account.

HTTP Request

GET https://api.gomorpheus.com/api/billing/zones/:id

Query Parameters

Parameter Default Description
startDate Beginning of the current month
endDate Now
includeUsages true Optional ability to suppress the usage records

Billing For All Servers

curl "$MORPHEUS_API_URL/api/billing/servers" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structured like this:

{
  "success": true,
  "billingInfo": {
    "price": 0,
    "cost": 0,
    "startDate": "2017-03-01T07:00:00Z",
    "endDate": "2017-03-09T22:03:28Z",
    "servers": [
      {
        "refType": "computeServer",
        "refId": 1,
        "startDate": "2017-01-01T00:00:00Z",
        "endDate": "2017-01-31T23:59:59Z",
        "cost": 0,
        "price": 0,
        "usages": [
        ],
        "numUnits": 0,
        "unit": "hour",
        "name": "name"
      }
    ]
  }
}

Retrieves billing information for all servers (container hosts) on the requestor’s account.

HTTP Request

GET https://api.gomorpheus.com/api/billing/servers

Query Parameters

Parameter Default Description
startDate Beginning of the current month
endDate Now
includeUsages true Optional ability to suppress the usage records

Billing For a Specific Server

curl "$MORPHEUS_API_URL/api/billing/servers/1" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structured like this:

{
  "success": true,
  "billingInfo": {
    "refType": "computeServer",
    "refId": 1,
    "startDate": "2017-01-01T00:00:00Z",
    "endDate": "2017-01-31T23:59:59Z",
    "cost": 0,
    "price": 0,
    "usages": [
    ],
    "numUnits": 0,
    "unit": "hour",
    "name": "name"
  }
}

Retrieves billing information for a specific server (container host) in the requestor’s account.

HTTP Request

GET https://api.gomorpheus.com/api/billing/servers/:id

Query Parameters

Parameter Default Description
startDate Beginning of the current month
endDate Now
includeUsages true Optional ability to suppress the usage records

Billing For All Instances

curl "$MORPHEUS_API_URL/api/billing/instances" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structured like this:

{
  "success": true,
  "billingInfo": {
    "price": 0.0,
    "cost": 0.0,
    "startDate": "2017-01-01T00:00:00Z",
    "endDate": "2017-01-31T23:59:59Z",
    "instances": [
      {
        "containers": [
                  {
            "usages": [
            ],
            "numUnits": 0.0,
            "unit": "hour",
            "name": "name"
          }
        ]
      }
    ]
  }
}

Retrieves billing information for all instances on the requestor’s account.

HTTP Request

GET https://api.gomorpheus.com/api/billing/instances

Query Parameters

Parameter Default Description
startDate Beginning of the current month
endDate Now
includeUsages true Optional ability to suppress the usage records

Billing For a Specific Instance

curl "$MORPHEUS_API_URL/api/billing/instances/1" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structured like this:

{
  "success": true,
  "billingInfo": {
    "instanceId": 11,
    "startDate": "2017-01-01T00:00:00Z",
    "endDate": "2017-01-31T23:59:59Z",
    "name": "name",
    "price": 0,
    "cost": 0,
    "containers": [
      {
        "usages": [
          {
            "applicablePrices": [
            ]
          }
        ],
        "numUnits": 0.0,
        "unit": "hour",
        "name": "name"
      }
    ]
  }
}

Retrieves billing information for a specific server in the requestor’s account.

HTTP Request

GET https://api.gomorpheus.com/api/billing/instances/:id

Query Parameters

Parameter Default Description
startDate Beginning of the current month
endDate Now
includeUsages true Optional ability to suppress the usage records

Budgets

Wiki

Morpheus provides a way to create and edit documentation in the form of wiki pages. Wiki pages use the markdown format and can be categorized to group them with other pages. Instances, apps, servers, clouds and groups can have their own wiki page associated to them.

Get All Wiki Pages

curl "$MORPHEUS_API_URL/api/wiki/pages"
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structured like this:

{
  "pages": [
    {
      "id": 1,
      "name": "Home",
      "urlName": "home",
      "category": null,
      "refId": null,
      "refType": null,
      "format": "markdown",
      "content": "Welcome to the home page for this Morpheus wiki.",
      "createdBy": {
        "id": 1,
        "username": "admin"
      },
      "updatedBy": {
        "id": 1,
        "username": "admin"
      },
      "dateCreated": "2019-06-27T16:55:59+0000",
      "lastUpdated": "2019-06-27T16:55:59+0000"
    },
    {
      "id": 2,
      "name": "README",
      "urlName": "info/readme",
      "category": "info",
      "refId": null,
      "refType": null,
      "format": "markdown",
      "content": "A readme file for this local dev appliance.\nNeat.",
      "createdBy": {
        "id": 1,
        "username": "admin"
      },
      "updatedBy": {
        "id": 1,
        "username": "admin"
      },
      "dateCreated": "2019-06-27T14:44:22+0000",
      "lastUpdated": "2019-06-27T14:44:22+0000"
    },
    {
      "id": 3,
      "name": "My Group",
      "urlName": "my-group",
      "category": "groups",
      "refId": 1,
      "refType": "ComputeSite",
      "format": "markdown",
      "content": "#My Group\nThis is a test group",
      "createdBy": {
        "id": 1,
        "username": "admin"
      },
      "updatedBy": {
        "id": 1,
        "username": "admin"
      },
      "dateCreated": "2019-06-28T01:41:45+0000",
      "lastUpdated": "2019-06-28T01:41:45+0000"
    }
  ],
  "meta": {
    "size": 2,
    "total": 2,
    "max": 25,
    "offset": 0
  }
}

This endpoint retrieves wiki pages associated with the account.

HTTP Request

GET https://api.gomorpheus.com/api/wiki/pages

Query Parameters

Parameter Default Description
name If specified will return an exact match on name or urlName
phrase If specified will return a partial match on name

Get All Wiki Categories

curl "$MORPHEUS_API_URL/api/wiki/categories"
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structured like this:

{
  "categories": [
    {
      "name": "apps",
      "pageCount": 1
    },
    {
      "name": "clouds",
      "pageCount": 1
    },
    {
      "name": "groups",
      "pageCount": 1
    },
    {
      "name": "info",
      "pageCount": 1
    },
    {
      "name": "instances",
      "pageCount": 2
    },
    {
      "name": "servers",
      "pageCount": 2
    }
  ]
}

This endpoint retrieves all categories associated with the account. The results are not paginated. The categories returned are those of the found pages.

HTTP Request

GET https://api.gomorpheus.com/api/wiki/categories

Query Parameters

Parameter Default Description
phrase If specified will return a partial match on category name
pagePhrase If specified will return a partial match on page name

Get a Specific Wiki Page

curl "$MORPHEUS_API_URL/api/wiki/pages/2" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structured like this:


{
  "page": {
      "id": 1,
      "name": "Home",
      "urlName": "home",
      "category": null,
      "refId": null,
      "refType": null,
      "format": "markdown",
      "content": "The home page for this wiki.",
      "createdBy": {
        "id": 1,
        "username": "admin"
      },
      "updatedBy": {
        "id": 1,
        "username": "admin"
      },
      "dateCreated": "2019-06-27T16:55:59+0000",
      "lastUpdated": "2019-06-27T16:55:59+0000"
    }
}

This endpoint retrieves a specific wiki page.

HTTP Request

GET https://api.gomorpheus.com/api/wiki/pages/:id

URL Parameters

Parameter Description
ID The ID of the Wiki Page

Create a Wiki Page

curl -XPOST "$MORPHEUS_API_URL/api/wiki/pages" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"page":{
    "name": "Sample Doc",
    "category": "info",
    "content": "#Sample Doc\nA sample document in **markdown**."
  }}'

The above command returns JSON structured like getting a single wiki page:

HTTP Request

POST https://api.gomorpheus.com/api/wiki/pages

JSON Page Parameters

Parameter Default Description
name A unique name scoped to your account for the wiki page.
category Optional category for grouping with other pages.
content The content of the page (markdown).

Update a Wiki Page

curl -XPUT "$MORPHEUS_API_URL/api/wiki/pages/4" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"page":{
    "content": "#Sample Doc\nAn updated sample document in **markdown**.\nCheers!"
  }}'

The above command returns JSON structured like getting a single wiki page

HTTP Request

PUT https://api.gomorpheus.com/api/wiki/pages/:id

URL Parameters

Parameter Description
ID The ID of the Wiki Page

JSON Page Parameters

Parameter Default Description
name A unique name scoped to your account for the wiki page.
category Optional category for grouping with other pages.
content The content of the page (markdown).

Delete a Wiki Page

curl -XDELETE "$MORPHEUS_API_URL/api/wiki/pages/1" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structured like getting a single wiki page

Will delete a Wiki Page from the system.

HTTP Request

DELETE https://api.gomorpheus.com/api/wiki/pages/:id

URL Parameters

Parameter Description
ID The ID of the Wiki Page

The above command returns JSON structure like this:

{
  "success": true
}

Get a Wiki Page For Instance

curl "$MORPHEUS_API_URL/api/instances/1/wiki" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structured like getting a single wiki page.

This endpoint retrieves the wiki page for an instance. If its page does not yet exist, the response is still 200 OK with a body like “page”:null.

HTTP Request

GET https://api.gomorpheus.com/api/instances/:id/wiki

URL Parameters

Parameter Description
ID The ID of the Instance

Update a Wiki Page For Instance

curl -XPUT "$MORPHEUS_API_URL/instances/1/wiki" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"page":{
    "content": "Lots of good information about this instance."
  }}'

The above command returns JSON structured like getting a single wiki page:

This endpoint updates the wiki page for an instance. The page will be created if it does not yet exist.

HTTP Request

PUT https://api.gomorpheus.com/api/instances/:id/wiki

URL Parameters

Parameter Description
ID The ID of the Instance

JSON Page Parameters

Parameter Default Description
name (instance name) A unique name scoped to your account for the wiki page.
content The content of the page (markdown).

Get a Wiki Page For App

curl "$MORPHEUS_API_URL/api/apps/1/wiki" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structured like getting a single wiki page.

This endpoint retrieves the wiki page for an app. If its page does not yet exist, the response is still 200 OK with a body like “page”:null.

HTTP Request

GET https://api.gomorpheus.com/api/apps/:id/wiki

URL Parameters

Parameter Description
ID The ID of the App

Update a Wiki Page For App

curl -XPUT "$MORPHEUS_API_URL/apps/1/wiki" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"page":{
    "content": "Lots of good information about this app."
  }}'

The above command returns JSON structured like getting a single wiki page:

This endpoint updates the wiki page for an app. The page will be created if it does not yet exist.

HTTP Request

PUT https://api.gomorpheus.com/api/apps/:id/wiki

URL Parameters

Parameter Description
ID The ID of the App

JSON Page Parameters

Parameter Default Description
name (app name) A unique name scoped to your account for the wiki page.
content The content of the page (markdown).

Get a Wiki Page For Server

curl "$MORPHEUS_API_URL/api/servers/1/wiki" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structured like getting a single wiki page.

This endpoint retrieves the wiki page for a server. If its page does not yet exist, the response is still 200 OK with a body like “page”:null.

HTTP Request

GET https://api.gomorpheus.com/api/servers/:id/wiki

URL Parameters

Parameter Description
ID The ID of the Server

Update a Wiki Page For Server

curl -XPUT "$MORPHEUS_API_URL/servers/1/wiki" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"page":{
    "content": "Lots of good information about this server."
  }}'

The above command returns JSON structured like getting a single wiki page:

This endpoint updates the wiki page for a server. The page will be created if it does not yet exist.

HTTP Request

PUT https://api.gomorpheus.com/api/servers/:id/wiki

URL Parameters

Parameter Description
ID The ID of the Server

JSON Page Parameters

Parameter Default Description
name (server name) A unique name scoped to your account for the wiki page.
content The content of the page (markdown).

Get a Wiki Page For Cloud

curl "$MORPHEUS_API_URL/api/zones/1/wiki" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structured like getting a single wiki page.

This endpoint retrieves the wiki page for a cloud. If its page does not yet exist, the response is still 200 OK with a body like “page”:null.

HTTP Request

GET https://api.gomorpheus.com/api/zones/:id/wiki

URL Parameters

Parameter Description
ID The ID of the Cloud

Update a Wiki Page For Cloud

curl -XPUT "$MORPHEUS_API_URL/zones/1/wiki" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"page":{
    "content": "Lots of good information about this cloud."
  }}'

The above command returns JSON structured like getting a single wiki page:

This endpoint updates wiki page for a cloud. The page will be created if it does not yet exist.

HTTP Request

PUT https://api.gomorpheus.com/api/zones/:id/wiki

URL Parameters

Parameter Description
ID The ID of the Cloud

JSON Page Parameters

Parameter Default Description
name (cloud name) A unique name scoped to your account for the wiki page.
content The content of the page (markdown).

Get a Wiki Page For Group

curl "$MORPHEUS_API_URL/api/groups/1/wiki" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structured like getting a single wiki page.

This endpoint retrieves the wiki page for a group. If its page does not yet exist, the response is still 200 OK with a body like “page”:null.

HTTP Request

GET https://api.gomorpheus.com/api/groups/:id/wiki

URL Parameters

Parameter Description
ID The ID of the Group

Update a Wiki Page For Group

curl -XPUT "$MORPHEUS_API_URL/groups/1/wiki" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"page":{
    "content": "Lots of good information about this group."
  }}'

The above command returns JSON structured like getting a single wiki page:

This endpoint updates the wiki page for a group. The page will be created if it does not yet exist.

HTTP Request

PUT https://api.gomorpheus.com/api/groups/:id/wiki

URL Parameters

Parameter Description
ID The ID of the Group

JSON Page Parameters

Parameter Default Description
name (group name) A unique name scoped to your account for the wiki page.
content The content of the page (markdown).

Provisioning

The Provisioning API endpoints provide the Instances, Apps, and Automation.

Morpheus supports a diverse set of cloud APIS for provisioning compute and services. In order to facilitate some of these capabilities and preserve some of the diverse sets of feature sets across these plaforms it is necessary to provide a means to dynamicaly specifying provisioning options depending on what is being provisioned. Morpheus calls these ProvisionType. Each InstanceTypeLayout that can be provisioned has a correlating ProvisionType and each CloudType (aka ZoneType) has a list of supported provision types it is capable of provisioning. This record contains optionTypes (see section on optionTypes for specifics on how to parse this data) as well as information for building out network parameters and storage parameters by listing different storage type information.

Provision Types

Fetch the list of available provision types.

curl "$MORPHEUS_API_URL/api/provision-types"
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structured like this

{
    "provisionTypes": [
        {
            "id": 9,
            "name": "Amazon",
            "description": null,
            "code": "amazon",
            "aclEnabled": false,
            "multiTenant": false,
            "managed": true,
            "hostNetwork": true,
            "customSupported": false,
            "mapPorts": false,
            "exportServer": null,
            "viewSet": "amazonCustom",
            "serverType": "ami",
            "hostType": "vm",
            "addVolumes": true,
            "hasDatastore": false,
            "hasNetworks": null,
            "maxNetworks": null,
            "customizeVolume": true,
            "rootDiskCustomizable": true,
            "lvmSupported": true,
            "hostDiskMode": "lvm",
            "minDisk": 0,
            "maxDisk": null,
            "resizeCopiesVolumes": true,
            "optionTypes": [
                {
                    "name": "subnet",
                    "description": null,
                    "fieldName": "subnetId",
                    "fieldLabel": "Subnet",
                    "fieldContext": "config",
                    "fieldAddOn": null,
                    "placeHolder": null,
                    "helpBlock": "",
                    "defaultValue": null,
                    "optionSource": "amazonSubnet",
                    "type": "select",
                    "advanced": false,
                    "required": true,
                    "editable": false,
                    "config": [],
                    "displayOrder": 100
                },
                {
                    "name": "security group",
                    "description": null,
                    "fieldName": "securityId",
                    "fieldLabel": "Security Group",
                    "fieldContext": "config",
                    "fieldAddOn": null,
                    "placeHolder": null,
                    "helpBlock": "",
                    "defaultValue": null,
                    "optionSource": "amazonSecurityGroup",
                    "type": "select",
                    "advanced": false,
                    "required": true,
                    "editable": false,
                    "config": [],
                    "displayOrder": 101
                },
                {
                    "name": "public key",
                    "description": null,
                    "fieldName": "publicKeyId",
                    "fieldLabel": "Public Key",
                    "fieldContext": "config",
                    "fieldAddOn": null,
                    "placeHolder": null,
                    "helpBlock": "",
                    "defaultValue": null,
                    "optionSource": "keyPairs",
                    "type": "select",
                    "advanced": false,
                    "required": false,
                    "editable": false,
                    "config": [],
                    "displayOrder": 9
                }
            ],
            "customOptionTypes": [],
            "networkTypes": [],
            "storageTypes": [
                {
                    "id": 7,
                    "code": "amazon-sc1",
                    "name": "sc1",
                    "displayOrder": 4,
                    "defaultType": false,
                    "customLabel": true,
                    "customSize": true,
                    "customSizeOptions": null
                },
                {
                    "id": 4,
                    "code": "amazon-io1",
                    "name": "io1",
                    "displayOrder": 2,
                    "defaultType": false,
                    "customLabel": true,
                    "customSize": true,
                    "customSizeOptions": null
                },
                {
                    "id": 5,
                    "code": "amazon-gp2",
                    "name": "gp2",
                    "displayOrder": 1,
                    "defaultType": true,
                    "customLabel": true,
                    "customSize": true,
                    "customSizeOptions": null
                },
                {
                    "id": 6,
                    "code": "amazon-st1",
                    "name": "st1",
                    "displayOrder": 3,
                    "defaultType": false,
                    "customLabel": true,
                    "customSize": true,
                    "customSizeOptions": null
                }
            ],
            "rootStorageTypes": [
                {
                    "id": 7,
                    "code": "amazon-sc1",
                    "name": "sc1",
                    "displayOrder": 4,
                    "defaultType": false,
                    "customLabel": true,
                    "customSize": true,
                    "customSizeOptions": null
                },
                {
                    "id": 4,
                    "code": "amazon-io1",
                    "name": "io1",
                    "displayOrder": 2,
                    "defaultType": false,
                    "customLabel": true,
                    "customSize": true,
                    "customSizeOptions": null
                },
                {
                    "id": 5,
                    "code": "amazon-gp2",
                    "name": "gp2",
                    "displayOrder": 1,
                    "defaultType": true,
                    "customLabel": true,
                    "customSize": true,
                    "customSizeOptions": null
                },
                {
                    "id": 6,
                    "code": "amazon-st1",
                    "name": "st1",
                    "displayOrder": 3,
                    "defaultType": false,
                    "customLabel": true,
                    "customSize": true,
                    "customSizeOptions": null
                }
            ],
            "controllerTypes": []
        }
    ]
}

HTTP Request

GET https://api.gomorpheus.com/api/provision-types

Get Specific Provision Type

curl "$MORPHEUS_API_URL/api/provision-types/9"
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structured like this

{
  "success": true,
  "provisionType": {
        "id": 9,
        "name": "Amazon",
        "description": null,
        "code": "amazon",
        "aclEnabled": false,
        "multiTenant": false,
        "managed": true,
        "hostNetwork": true,
        "customSupported": false,
        "mapPorts": false,
        "exportServer": null,
        "viewSet": "amazonCustom",
        "serverType": "ami",
        "hostType": "vm",
        "addVolumes": true,
        "hasDatastore": false,
        "hasNetworks": null,
        "maxNetworks": null,
        "customizeVolume": true,
        "rootDiskCustomizable": true,
        "lvmSupported": true,
        "hostDiskMode": "lvm",
        "minDisk": 0,
        "maxDisk": null,
        "resizeCopiesVolumes": true,
        "optionTypes": [
            {
                "name": "subnet",
                "description": null,
                "fieldName": "subnetId",
                "fieldLabel": "Subnet",
                "fieldContext": "config",
                "fieldAddOn": null,
                "placeHolder": null,
                "helpBlock": "",
                "defaultValue": null,
                "optionSource": "amazonSubnet",
                "type": "select",
                "advanced": false,
                "required": true,
                "editable": false,
                "config": [],
                "displayOrder": 100
            },
            {
                "name": "security group",
                "description": null,
                "fieldName": "securityId",
                "fieldLabel": "Security Group",
                "fieldContext": "config",
                "fieldAddOn": null,
                "placeHolder": null,
                "helpBlock": "",
                "defaultValue": null,
                "optionSource": "amazonSecurityGroup",
                "type": "select",
                "advanced": false,
                "required": true,
                "editable": false,
                "config": [],
                "displayOrder": 101
            },
            {
                "name": "public key",
                "description": null,
                "fieldName": "publicKeyId",
                "fieldLabel": "Public Key",
                "fieldContext": "config",
                "fieldAddOn": null,
                "placeHolder": null,
                "helpBlock": "",
                "defaultValue": null,
                "optionSource": "keyPairs",
                "type": "select",
                "advanced": false,
                "required": false,
                "editable": false,
                "config": [],
                "displayOrder": 9
            }
        ],
        "customOptionTypes": [],
        "networkTypes": [],
        "storageTypes": [
            {
                "id": 7,
                "code": "amazon-sc1",
                "name": "sc1",
                "displayOrder": 4,
                "defaultType": false,
                "customLabel": true,
                "customSize": true,
                "customSizeOptions": null
            },
            {
                "id": 4,
                "code": "amazon-io1",
                "name": "io1",
                "displayOrder": 2,
                "defaultType": false,
                "customLabel": true,
                "customSize": true,
                "customSizeOptions": null
            },
            {
                "id": 5,
                "code": "amazon-gp2",
                "name": "gp2",
                "displayOrder": 1,
                "defaultType": true,
                "customLabel": true,
                "customSize": true,
                "customSizeOptions": null
            },
            {
                "id": 6,
                "code": "amazon-st1",
                "name": "st1",
                "displayOrder": 3,
                "defaultType": false,
                "customLabel": true,
                "customSize": true,
                "customSizeOptions": null
            }
        ],
        "rootStorageTypes": [
            {
                "id": 7,
                "code": "amazon-sc1",
                "name": "sc1",
                "displayOrder": 4,
                "defaultType": false,
                "customLabel": true,
                "customSize": true,
                "customSizeOptions": null
            },
            {
                "id": 4,
                "code": "amazon-io1",
                "name": "io1",
                "displayOrder": 2,
                "defaultType": false,
                "customLabel": true,
                "customSize": true,
                "customSizeOptions": null
            },
            {
                "id": 5,
                "code": "amazon-gp2",
                "name": "gp2",
                "displayOrder": 1,
                "defaultType": true,
                "customLabel": true,
                "customSize": true,
                "customSizeOptions": null
            },
            {
                "id": 6,
                "code": "amazon-st1",
                "name": "st1",
                "displayOrder": 3,
                "defaultType": false,
                "customLabel": true,
                "customSize": true,
                "customSizeOptions": null
            }
        ],
        "controllerTypes": []
    }
}

HTTP Request

GET https://api.gomorpheus.com/api/provision-types/:id

Instances

Instances are sets of containers or vms (morpheus API represents a vm as a container attached to a server) of various types that can be provisioned across the Morpheus stack and offer a wide range of services. MySQL, Redis, ElasticSearch, PostgreSQL, Tomcat, nginx, Confluence, Jenkins, and more. There are a few important concept differentiators between what morpheus calls an instance and what amazon calls an instance. In morpheus an isntance can represent many vms or containers that are of a set. For example. If you wanted to spin up a Mongo sharded replicaset, that requires 7 virtual machines or 7 docker containers. Morpheus represents this as a singular instance with a specified layout and then represents all the associated services running within that instance as containers. If, a container record is a docker container then the serverId it belongs to is representative of the Docker Host it was provisioned onto. If the container is a virtual machine then the serverId represents the compute resource it was provisioned onto, (i.e. the virtual machine).

Get All Instances

curl "$MORPHEUS_API_URL/api/instances?max=3"
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structured like this:

{
  "instances": [
    {
      "id": 1530,
      "accountId": 1,
      "instanceType": {
        "id": 35,
        "code": "ubuntu",
        "category": "os",
        "name": "Ubuntu"
      },
      "group": {
        "id": 3,
        "name": "Demo"
      },
      "cloud": {
        "id": 6,
        "name": "San Mateo VMware"
      },
      "containers": [
        1798
      ],
      "servers": [
        2
      ],
      "connectionInfo": [
        {
          "ip": "192.168.162.59",
          "port": 22
        }
      ],
      "layout": {
        "id": 105
      },
      "plan": {
        "id": 12,
        "code": "vm-2048"
      },
      "name": "ah-San Mateo VMware-ubuntu",
      "description": null,
      "instanceVersion": null,
      "dateCreated": "2017-01-31T21:30:49+0000",
      "lastUpdated": "2017-02-07T22:58:26+0000",
      "hostName": "ah-San-Mateo-VMware-ubuntu",
      "domainName": null,
      "environmentPrefix": null,
      "firewallEnabled": true,
      "networkLevel": "container",
      "autoScale": false,
      "instanceContext": "production",
      "currentDeployId": null,
      "status": "running",
      "statusMessage": null,
      "errorMessage": null,
      "statusDate": "2017-01-31T21:34:07+0000",
      "statusPercent": null,
      "statusEta": null,
      "userStatus": null,
      "createdBy": {
        "id": 38
      }
    },
    {
      "id": 1653,
      "accountId": 1,
      "instanceType": {
        "id": 35,
        "code": "ubuntu",
        "category": "os",
        "name": "Ubuntu"
      },
      "group": {
        "id": 3,
        "name": "Demo"
      },
      "cloud": {
        "id": 6,
        "name": "San Mateo VMware"
      },
      "containers": [
        1945
      ],
      "servers": [
        2
      ],
      "connectionInfo": [
        {
          "ip": "192.168.163.55",
          "port": 22
        }
      ],
      "layout": {
        "id": 105
      },
      "plan": {
        "id": 11,
        "code": "vm-1024"
      },
      "name": "ah-San Mateo VMware-ubuntu-PDNStest",
      "description": null,
      "instanceVersion": null,
      "dateCreated": "2017-02-10T14:27:42+0000",
      "lastUpdated": "2017-02-10T14:31:19+0000",
      "hostName": "ah-san-mateo-vmware-ubuntu-pdnstest",
      "domainName": null,
      "environmentPrefix": null,
      "firewallEnabled": true,
      "networkLevel": "container",
      "autoScale": false,
      "instanceContext": "dev",
      "currentDeployId": null,
      "status": "running",
      "statusMessage": null,
      "errorMessage": null,
      "statusDate": "2017-02-10T14:30:43+0000",
      "statusPercent": null,
      "statusEta": null,
      "userStatus": null,
      "createdBy": {
        "id": 38
      }
    },
    {
      "id": 1624,
      "accountId": 1,
      "instanceType": {
        "id": 21,
        "code": "apache",
        "category": "web",
        "name": "Apache"
      },
      "group": {
        "id": 163,
        "name": "snow-approvals"
      },
      "cloud": {
        "id": 6,
        "name": "San Mateo VMware"
      },
      "containers": [
        1912
      ],
      "servers": [
        3
      ],
      "connectionInfo": [
        {
          "ip": "192.168.163.28",
          "port": 10009
        }
      ],
      "layout": {
        "id": 48
      },
      "plan": {
        "id": 3,
        "code": "container-256"
      },
      "name": "approval-snow-test",
      "description": null,
      "instanceVersion": null,
      "dateCreated": "2017-02-09T06:45:30+0000",
      "lastUpdated": "2017-02-09T06:53:20+0000",
      "hostName": "approval-snow-test",
      "domainName": null,
      "environmentPrefix": null,
      "firewallEnabled": true,
      "networkLevel": "container",
      "autoScale": false,
      "instanceContext": null,
      "currentDeployId": null,
      "status": "running",
      "statusMessage": null,
      "errorMessage": null,
      "statusDate": "2017-02-09T06:53:20+0000",
      "statusPercent": null,
      "statusEta": null,
      "userStatus": null,
      "createdBy": {
        "id": 25
      }
    }
  ],
  "stats": {
    "1530": {
      "usedStorage": 6776664064,
      "maxStorage": 21067075584,
      "usedMemory": 1909739520,
      "maxMemory": 2098315264,
      "usedCpu": 1.0926682792
    },
    "1653": {
      "usedStorage": 2662801408,
      "maxStorage": 10499452928,
      "usedMemory": 935444480,
      "maxMemory": 1041350656,
      "usedCpu": 0.1501000667
    },
    "1624": {
      "usedStorage": 4829184,
      "maxStorage": 3103539200,
      "usedMemory": 9113600,
      "maxMemory": 268435456,
      "usedCpu": 0
    }
  },
  "loadBalancers": [],
  "meta": {
    "offset": 0,
    "max": "3",
    "size": 3,
    "total": 21
  }
}

This endpoint retrieves a paginated list of instances.

HTTP Request

GET https://api.gomorpheus.com/api/instances

Query Parameters

Parameter Default Description
max 25 Max number of results to return
offset 0 Offset of records you want to load
name Filter by name
phrase Filter by wildcard search of name and description
instanceType Filter by instance type code
lastUpdated Date filter, restricts query to only load instances updated timestamp is more recent or equal to the date specified
createdBy Filter by Created By (User) ID. Accepts multiple values.

Get a Specific Instance

curl "$MORPHEUS_API_URL/api/instances/1216" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structured like this:

{
  "success": true,
  "instance": {
    "id": 1698,
    "accountId": 1,
    "instanceType": {
      "id": 44,
      "code": "redis",
      "category": "cache",
      "name": "Redis"
    },
    "group": {
      "id": 3,
      "name": "Demo"
    },
    "cloud": {
      "id": 6,
      "name": "San Mateo VMware"
    },
    "containers": [
      19
    ],
    "servers": [
      2
    ],
    "connectionInfo": [
      {
        "ip": "10.211.55.11",
        "port": 10000
      }
    ],
    "layout": {
      "id": 221
    },
    "plan": {
      "id": 69,
      "code": "container-512"
    },
    "name": "redistest",
    "description": null,
    "instanceVersion": null,
    "tags": [

    ],
    "maxMemory": 536870912,
    "maxStorage": 5368709120,
    "maxCores": 0,
    "maxCpu": null,
    "dateCreated": "2016-10-25T15:12:06+0000",
    "lastUpdated": "2017-02-13T19:22:00+0000",
    "hostName": "redistest",
    "domainName": null,
    "environmentPrefix": null,
    "firewallEnabled": true,
    "networkLevel": "container",
    "autoScale": false,
    "instanceContext": null,
    "currentDeployId": null,
    "status": "running",
    "statusMessage": null,
    "errorMessage": null,
    "statusDate": "2016-10-25T15:12:41+0000",
    "statusPercent": null,
    "statusEta": null,
    "userStatus": null,
    "createdBy": {
      "id": 1
    }
  },
  "stats": {
    "usedStorage": 2951,
    "maxStorage": 1073741824,
    "usedMemory": 266240,
    "maxMemory": 268435456,
    "usedCpu": 0.0418375032
  }
}

This endpoint retrieves a specific instance.

HTTP Request

GET https://api.gomorpheus.com/api/instances/:id

URL Parameters

Parameter Description
:id ID of the instance

Get Env Variables

curl "$MORPHEUS_API_URL/api/instances/1216/envs" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structured like this:

{
  "envs": [
    {
      "export": false,
      "masked": false,
      "name": "DATABASE_NAME",
      "value": "spud_marketing"
    }
  ],
  "readOnlyEnvs": {
    "TOMCAT_HOST": {
      "export": true,
      "masked": false,
      "name": "TOMCAT_HOST",
      "value": "container1414"
    },
    "TOMCAT_HOST_2": {
      "export": true,
      "masked": false,
      "name": "TOMCAT_HOST_2",
      "value": "container1759"
    },
    "TOMCAT_IP": {
      "export": true,
      "masked": false,
      "name": "TOMCAT_IP",
      "value": "192.168.163.232"
    },
    "TOMCAT_IP_2": {
      "export": true,
      "masked": false,
      "name": "TOMCAT_IP_2",
      "value": "192.168.163.233"
    },
    "TOMCAT_PORT": {
      "export": true,
      "masked": false,
      "name": "TOMCAT_PORT",
      "value": 10017
    },
    "TOMCAT_PORT_2": {
      "export": true,
      "masked": false,
      "name": "TOMCAT_PORT_2",
      "value": 10017
    },
    "TOMCAT_PORT_8080_TCP": {
      "export": true,
      "masked": false,
      "name": "TOMCAT_PORT_8080_TCP",
      "value": "tcp://192.168.163.232:10017"
    },
    "TOMCAT_PORT_8080_TCP_2": {
      "export": true,
      "masked": false,
      "name": "TOMCAT_PORT_8080_TCP_2",
      "value": "tcp://192.168.163.233:10017"
    },
    "TOMCAT_PORT_8080_TCP_ADDR": {
      "export": true,
      "masked": false,
      "name": "TOMCAT_PORT_8080_TCP_ADDR",
      "value": "192.168.163.232"
    },
    "TOMCAT_PORT_8080_TCP_ADDR_2": {
      "export": true,
      "masked": false,
      "name": "TOMCAT_PORT_8080_TCP_ADDR_2",
      "value": "192.168.163.233"
    },
    "TOMCAT_PORT_8080_TCP_PORT": {
      "export": true,
      "masked": false,
      "name": "TOMCAT_PORT_8080_TCP_PORT",
      "value": 10017
    },
    "TOMCAT_PORT_8080_TCP_PORT_2": {
      "export": true,
      "masked": false,
      "name": "TOMCAT_PORT_8080_TCP_PORT_2",
      "value": 10017
    },
    "TOMCAT_PORT_8080_TCP_PROTO": {
      "export": true,
      "masked": false,
      "name": "TOMCAT_PORT_8080_TCP_PROTO",
      "value": "tcp"
    },
    "TOMCAT_PORT_8080_TCP_PROTO_2": {
      "export": true,
      "masked": false,
      "name": "TOMCAT_PORT_8080_TCP_PROTO_2",
      "value": "tcp"
    }
  },
  "importedEnvs": {
    "MYSQL_HOST": {
      "export": true,
      "masked": false,
      "name": "MYSQL_HOST",
      "value": "container1413"
    },
    "MYSQL_HOST_2": {
      "export": true,
      "masked": false,
      "name": "MYSQL_HOST_2",
      "value": "container1756"
    },
    "MYSQL_IP": {
      "export": true,
      "masked": false,
      "name": "MYSQL_IP",
      "value": "192.168.163.232"
    },
    "MYSQL_IP_2": {
      "export": true,
      "masked": false,
      "name": "MYSQL_IP_2",
      "value": "192.168.163.233"
    },
    "MYSQL_MASTER": {
      "export": true,
      "masked": false,
      "name": "MYSQL_HOST",
      "value": "container1413"
    },
    "MYSQL_PASSWORD": {
      "export": true,
      "masked": true,
      "name": "MYSQL_PASSWORD",
      "value": "morpheus"
    },
    "MYSQL_PASSWORD_2": {
      "export": true,
      "masked": true,
      "name": "MYSQL_PASSWORD",
      "value": "morpheus"
    },
    "MYSQL_PORT": {
      "export": true,
      "masked": false,
      "name": "MYSQL_PORT",
      "value": 10016
    },
    "MYSQL_PORT_2": {
      "export": true,
      "masked": false,
      "name": "MYSQL_PORT_2",
      "value": 10016
    },
    "MYSQL_PORT_3306_TCP": {
      "export": true,
      "masked": false,
      "name": "MYSQL_PORT_3306_TCP",
      "value": "tcp://192.168.163.232:10016"
    },
    "MYSQL_PORT_3306_TCP_2": {
      "export": true,
      "masked": false,
      "name": "MYSQL_PORT_3306_TCP_2",
      "value": "tcp://192.168.163.233:10016"
    },
    "MYSQL_PORT_3306_TCP_ADDR": {
      "export": true,
      "masked": false,
      "name": "MYSQL_PORT_3306_TCP_ADDR",
      "value": "192.168.163.232"
    },
    "MYSQL_PORT_3306_TCP_ADDR_2": {
      "export": true,
      "masked": false,
      "name": "MYSQL_PORT_3306_TCP_ADDR_2",
      "value": "192.168.163.233"
    },
    "MYSQL_PORT_3306_TCP_PORT": {
      "export": true,
      "masked": false,
      "name": "MYSQL_PORT_3306_TCP_PORT",
      "value": 10016
    },
    "MYSQL_PORT_3306_TCP_PORT_2": {
      "export": true,
      "masked": false,
      "name": "MYSQL_PORT_3306_TCP_PORT_2",
      "value": 10016
    },
    "MYSQL_PORT_3306_TCP_PROTO": {
      "export": true,
      "masked": false,
      "name": "MYSQL_PORT_3306_TCP_PROTO",
      "value": "tcp"
    },
    "MYSQL_PORT_3306_TCP_PROTO_2": {
      "export": true,
      "masked": false,
      "name": "MYSQL_PORT_3306_TCP_PROTO_2",
      "value": "tcp"
    },
    "MYSQL_USERNAME": "morpheus",
    "MYSQL_USERNAME_2": "morpheus"
  }
}

This gets all the environment variables associated with the instance.

HTTP Request

GET https://api.gomorpheus.com/api/instances/:id/envs

URL Parameters

Parameter Description
:id ID of the instance

Get Instance History

curl "$MORPHEUS_API_URL/api/238/history" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structured like this:

{
  "processes": [
    {
      "id": 250,
      "accountId": 1,
      "uniqueId": "cebc47ec-cb2f-417a-886e-dd60cf81db26",
      "processType": {
        "code": "provision",
        "name": "provision"
      },
      "description": null,
      "subType": null,
      "subId": null,
      "zoneId": 34,
      "integrationId": null,
      "instanceId": 238,
      "containerId": 240,
      "serverId": 601,
      "containerName": "apachetest",
      "displayName": "apachetest",
      "timerCategory": "vmware",
      "timerSubCategory": "28",
      "status": "failed",
      "reason": null,
      "percent": 100.0,
      "statusEta": 348246,
      "message": null,
      "output": null,
      "error": null,
      "startDate": "2018-09-28T19:10:56+0000",
      "endDate": "2018-09-28T20:21:49+0000",
      "duration": 4253127,
      "dateCreated": "2018-09-28T19:10:56+0000",
      "lastUpdated": "2018-09-28T20:21:49+0000",
      "createdBy": {
        "username": "admin",
        "displayName": "Admin"
      },
      "updatedBy": {
        "username": "admin",
        "displayName": "Admin"
      },
      "events": [

      ]
    }
  ],
  "meta": {
    "size": 1,
    "total": 1,
    "offset": 0,
    "max": 25
  }
}

This endpoint retrieves the process history for a specific instance.

Alternatively, the Process History endpoint can be used to get the same information.

HTTP Request

GET https://api.gomorpheus.com/api/instances/:id/history

URL Parameters

Parameter Description
:id ID of the instance

Query Parameters

Parameter Default Description
phrase If specified will return a partial match on displayName, message or output
containerId Filter by container id(s)
serverId Filter by server id(s)
zoneId Filter by zone id(s)

Get Container Details

curl "$MORPHEUS_API_URL/api/instances/1216/containers" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structured like this:

{
  "containers": [
    {
      "id": 292,
      "accountId": 1,
      "instance": {
        "id": 294,
        "name": "nginxtest"
      },
      "containerType": {
        "id": 187,
        "code": "nginx-vmware-1.9",
        "category": "nginx",
        "name": "NGINX 1.9"
      },
      "containerTypeSet": {
        "id": 193,
        "code": "nginx-vmware-1.9-set",
        "category": "nginx"
      },
      "server": {
        "id": 653,
        "name": "nginxtest"
      },
      "cloud": {
        "id": 34,
        "name": "myvmware"
      },
      "name": "nginxtest_292",
      "ip": "10.30.20.50",
      "internalIp": "10.30.20.50",
      "internalHostname": "container292",
      "externalHostname": "nginxtest",
      "externalDomain": "localdomain",
      "externalFqdn": "nginxtest.localdomain",
      "ports": [
        {
          "index": 0,
          "external": 80,
          "internal": 80,
          "primaryPort": true,
          "displayName": "Http",
          "export": true,
          "visible": true,
          "loadBalance": true,
          "link": true,
          "exportName": "HTTP",
          "protocol": "http",
          "code": "nginx.80"
        },
        {
          "index": 1,
          "external": 443,
          "internal": 443,
          "primaryPort": false,
          "displayName": "Https",
          "export": true,
          "visible": true,
          "loadBalance": true,
          "link": true,
          "exportName": "HTTPS",
          "protocol": "https",
          "code": "nginx.443"
        }
      ],
      "plan": {
        "id": 76,
        "code": "vm-1024",
        "name": "1 CPU, 1GB Memory"
      },
      "dateCreated": "2019-02-20T18:29:05+0000",
      "lastUpdated": "2019-02-27T21:07:35+0000",
      "statsEnabled": true,
      "status": "running",
      "userStatus": "running",
      "environmentPrefix": null,
      "stats": {
        "ts": "2019-02-27T21:07:31+0000",
        "running": true,
        "userCpuUsage": 0.1504010695,
        "systemCpuUsage": 0.1838235294,
        "usedMemory": 317256000,
        "maxMemory": 1017032000,
        "cacheMemory": 404236000,
        "maxStorage": 10499452928,
        "usedStorage": 3700285440,
        "readIOPS": 0,
        "writeIOPS": 0.35,
        "totalIOPS": 0.35,
        "iops": {
        },
        "netTxUsage": 114,
        "netRxUsage": 2198
      },
      "runtimeInfo": {
      },
      "containerVersion": null,
      "repositoryImage": null,
      "planCategory": null,
      "hostname": "nginxtest",
      "domainName": null,
      "volumeCreated": true,
      "containerCreated": false,
      "maxStorage": 10737418240,
      "maxMemory": 1073741824,
      "maxCores": 1,
      "maxCpu": 1,
      "availableActions": [
        {
          "code": "nginx-1.9-remove-node",
          "name": "Remove Nginx Node"
        }
      ]
    }
  ]
}

This can be valuable for evaluating the details of the compute server(s) running on an instance

HTTP Request

GET https://api.gomorpheus.com/api/instances/:id/containers

URL Parameters

Parameter Description
:id ID of the instance

Get Available Service Plans for an Instance

curl -XGET "https://api.gomorpheus.com/api/instances/service-plans?zoneId=1&layoutId=75" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structure like this:

{
  "plans": [
    {
      "id": 75,
      "name": "1 CPU, 512MB Memory",
      "value": 75,
      "code": "vm-512",
      "maxStorage": 10737418240,
      "maxMemory": 536870912,
      "maxCpu": 1,
      "maxCores": 1,
      "customCpu": false,
      "customMaxMemory": false,
      "customMaxStorage": true,
      "customMaxDataStorage": true,
      "customCoresPerSocket": false,
      "coresPerSocket": 1,
      "storageTypes": [
        {
          "id": 1,
          "editable": false,
          "optionTypes": [

          ],
          "displayOrder": 1,
          "code": "standard",
          "volumeType": "disk",
          "minStorage": null,
          "deletable": false,
          "defaultType": true,
          "createDatastore": null,
          "resizable": false,
          "storageType": null,
          "allowSearch": true,
          "volumeOptionSource": null,
          "displayName": "Disk",
          "minIOPS": null,
          "maxIOPS": null,
          "hasDatastore": true,
          "customSize": true,
          "autoDelete": true,
          "name": "Standard",
          "configurableIOPS": false,
          "customLabel": true,
          "enabled": true,
          "description": "Standard",
          "volumeCategory": "disk",
          "externalId": null,
          "maxStorage": null
        }
      ],
      "rootStorageTypes": [
        {
          "id": 1,
          "editable": false,
          "optionTypes": [

          ],
          "displayOrder": 1,
          "code": "standard",
          "volumeType": "disk",
          "minStorage": null,
          "deletable": false,
          "defaultType": true,
          "createDatastore": null,
          "resizable": false,
          "storageType": null,
          "allowSearch": true,
          "volumeOptionSource": null,
          "displayName": "Disk",
          "minIOPS": null,
          "maxIOPS": null,
          "hasDatastore": true,
          "customSize": true,
          "autoDelete": true,
          "name": "Standard",
          "configurableIOPS": false,
          "customLabel": true,
          "enabled": true,
          "description": "Standard",
          "volumeCategory": "disk",
          "externalId": null,
          "maxStorage": null
        }
      ],
      "addVolumes": true,
      "customizeVolume": true,
      "rootDiskCustomizable": true,
      "noDisks": false,
      "hasDatastore": true,
      "minDisk": 0,
      "maxDisk": null,
      "lvmSupported": true,
      "datastores": {
        "cluster": [
          {
            "id": 54,
            "name": "demo-qnap - 4.3TB Free"
          }
        ],
        "store": [
          {
            "id": 50,
            "name": "datastore1 - 463.4GB Free"
          }
        ]
      },
      "supportsAutoDatastore": true,
      "autoOptions": [
        {
          "id": "autoCluster",
          "name": "Auto - Cluster"
        },
        {
          "id": "auto",
          "name": "Auto - Datastore"
        }
      ],
      "cpuOptions": [

      ],
      "coreOptions": [

      ],
      "memoryOptions": [

      ],
      "rootCustomSizeOptions": {
      },
      "customSizeOptions": {
      },
      "customCores": false,
      "maxDisks": null,
      "memorySizeType": "MB"
    }
  ]
}

This returns a list of all of the service plans available for an instance type. The response includes details about the plans and their configuration options. The parameters zoneId and layoutId are required.

This endpoint can be used to get the list of plans available for creating a new instance or resizing an existing instance.

HTTP Request

GET https://api.gomorpheus.com/api/instances/service-plans

Query Parameters

Parameter Description
zoneId The ID of the Cloud
layoutId The ID of the instance layout

Create an Instance

curl -X POST "https://api.gomorpheus.com/api/instances" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "zoneId": 6,
  "instance": {
    "name": "api-testing2",
    "site": {
      "id": 3
    },
    "instanceType": {
      "code": "Ubuntu"
    },
    "layout": {
      "id": 105
    },
    "plan": {
      "id": 75
    }
  },
  "volumes": [
    {
      "id": -1,
      "rootVolume": true,
      "name": "root",
      "size": 10,
      "sizeId": null,
      "storageType": 1,
      "datastoreId": "autoCluster"
    },
    {
      "id": -1,
      "rootVolume": false,
      "name": "data",
      "size": 5,
      "sizeId": null,
      "storageType": 1,
      "datastoreId": "auto"
    }
  ],
  "networkInterfaces": [
    {
      "network": {
        "id": 5
      },
      "networkInterfaceTypeId": 4
    }
  ],
  "config": {
    "publicKeyId": 14,
    "vmwareResourcePoolId": "resgroup-56",
    "hostId": null,
    "vmwareUsr": "morpheus-api",
    "vmwarePwd": "password",
    "vmwareDomainName": null,
    "vmwareCustomSpec": null
  },
  "evars": [
    {"name": "MY_APP_VAR1", "value": "VALUE1"},
    {"name": "MY_APP_VAR2", "value": "VALUE2"}
  ],
}'

The above command returns a similar JSON structure when submitting a GET request for a single check

HTTP Request

POST https://api.gomorpheus.com/api/instances

JSON Parameters

Parameter Required Default Description
instance Y n/a Key for name, site, instanceType layout, and plan
instance.name Y Name of the instance to be created
instance.site.id Y The Group ID to provision the instance into
instance.instanceType.code Y The type of instance by code we want to fetch
instance.layout.id Y The layout id for the instance type that you want to provision. i.e. single process or cluster
instance.plan.id Y The id for the memory and storage option pre-configured within Morpheus. See Available Service Plans
zoneId Y The Cloud ID to provision the instance onto
evars N [] Environment Variables, an array of objects that have name and value.
copies N 1 Number of copies to provision
layoutSize N 1 Apply a multiply factor of containers/vms within the instance
servicePlanOptions N Map of custom options depending on selected service plan . An example would be maxMemory, or maxCores.
securityGroups N Key for security group configuration. It should be passed as an array of objects containing the id of the security group to assign the instance to
volumes N Key for volume configuration, see Volumes
networkInterfaces N Key for network configuration, see Network Interfaces
config Y Key for specific type configuration, see Config
metadata N Array of name-value pairs for AWS metadata tags Metadata
taskSetId N The Workflow ID to execute.
taskSetName N The Workflow Name to execute.

Volumes

The (optional) volumes parameter is for LV configuration, can create additional LVs at provision It should be passed as an array of Objects with the following attributes:

Parameter Required Default Description
id N -1 The id for the LV configuration being created
rootVolume N true If set to false then a non-root LV will be created
name Y root Name/type of the LV being created
size N [from service plan] Size of the LV to be created in GBs
sizeId N Can be used to select pre-existing LV choices from Morpheus
storageType N Identifier for LV type
datastoreId Y The ID of the specific datastore. Auto selection can be specified as auto or autoCluster (for clusters).

Network Interfaces

The networkInterfaces parameter is for network configuration.

The Options API /api/options/zoneNetworkOptions?zoneId=5&provisionTypeId=10 can be used to see which options are available.

It should be passed as an array of Objects with the following attributes:

Parameter Required Default Description
network.id Y n/a id of the network to be used. A network group can be specified instead by prefixing its ID with networkGroup-.
networkInterfaceTypeId Y n/a The id of type of the network interface.
ipAddress Y n/a The ip address. Not applicable when using DHCP or IP Pools.

Config

The config parameter is for configuration options that are specific to each Provision Type. The Provision Types api can be used to see which options are available.

JSON Config Parameters for VMware
Parameter Required Default Description
publicKeyId N ID of a public key to add to the instance
resourcePoolId Y External ID of the resource group to use for instance
hostId N Specific host to deploy to if so desired
vmwareUsr N Additional user to provision to instance
vmwarePwd N Password for additional user
vmwareDomainName N Domain name to be given to instance
vmwareCustomSpec N Customization spec ID
JSON Config Parameters for Docker
Parameter Required Default Description
provisionServerId N Specific host to deploy to if so desired
resourcePoolId Y External ID of the resource group to use for instance
JSON Config Parameters for Kubernetes
Parameter Required Default Description
resourcePoolId Y ID of the resource group (kubernetes cluster) to use for instance

Metadata

This is specific to AWS Metadata tags. Name-Values pairs can be anything you like and are added to the instance JSON as an array of n-v pairs per the example to the right:

-d '{
  "zoneId": 6,
  "instance": {
    ...
  }
  ...
  "metadata": [
    {
      "id": null,
      "name": "SampleName",
      "value": "SampleValue"
    }
    {
      "id": null,
      "name": "BusinessUnit",
      "value": "QualityAssurance"
    }
  ]
  ...
}

Documentation on ALL of the provision types to come…

There can be additional properties to apply to the instance. For example mysql provisioning requires a set of initial credentials. You can get a list of what these input options are by fetching the instance-types list via the instance-types api and getting available layouts as well as the provision type option types associated with the layout. Currently these input options are available from the option-types map. These however, can be overridden in the event a config options map exists on the layout object within. NOTE: See the API Document on OptionTypes for figuring out how to build property maps from them.

Updating an Instance

curl -X PUT "https://api.gomorpheus.com/api/instances/1" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "instance": {
  "description": "my new redis"
  }}'

The above command returns a similar JSON structure when submitting a GET request for a single check

HTTP Request

PUT https://api.gomorpheus.com/api/instances/:id

URL Parameters

Parameter Description
:id ID of the instance

JSON Instance Parameters

Parameter Default Description
name Unique name scoped to your account for the instance
description Optional description field
tags Tags
instanceContext Environment
metadata Array of metadata objects
powerScheduleType Power Schedule ID
site.id Group ID

Stop an Instance

curl -X PUT "https://api.gomorpheus.com/api/instances/1/stop" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structure like this:

{
  "success": true
}

This will stop all containers running within an instance.

HTTP Request

PUT https://api.gomorpheus.com/api/instances/:id/stop

URL Parameters

Parameter Description
:id ID of the instance

Start an Instance

curl -X PUT "https://api.gomorpheus.com/api/instances/1/start" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structure like this:

{
  "success": true
}

This will start all containers running within an instance.

HTTP Request

PUT https://api.gomorpheus.com/api/instances/:id/start

URL Parameters

Parameter Description
:id ID of the instance

Restart an Instance

curl -X PUT "https://api.gomorpheus.com/api/instances/1/restart" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structure like this:

{
  "success": true
}

This will restart all containers running within an instance. This includes rebuilding the environment variables and applying settings to the docker containers.

HTTP Request

PUT https://api.gomorpheus.com/api/instances/:id/restart

URL Parameters

Parameter Description
:id ID of the instance

Suspend an Instance

curl -X PUT "https://api.gomorpheus.com/api/instances/1/suspend" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structure like this:

{
  "success": true
}

This will suspend all containers in the instance.

HTTP Request

PUT https://api.gomorpheus.com/api/instances/:id/eject

URL Parameters

Parameter Description
:id ID of the instance

Eject an Instance

curl -X PUT "https://api.gomorpheus.com/api/instances/1/eject" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structure like this:

{
  "success": true
}

This will eject any ISO media on all containers in the instance.

HTTP Request

PUT https://api.gomorpheus.com/api/instances/:id/eject

URL Parameters

Parameter Description
:id ID of the instance

Resize an Instance

curl -X PUT "https://api.gomorpheus.com/api/instances/1/resize" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "instance": {
    "id": 1,
    "plan": {
      "id": 15
    }
  },
  "volumes": [
    {
      "id": "-1",
      "rootVolume": true,
      "name": "root",
      "size": 20,
      "sizeId": null,
      "storageType": null,
      "datastoreId": null
    }
  ],
  "deleteOriginalVolumes": true
}'

The above command returns JSON structure like this:

{
  "success": true
}

It is possible to resize containers within an instance by increasing their memory plan or storage limit. This is done by assigning a new service plan to the container.

HTTP Request

PUT https://api.gomorpheus.com/api/instances/:id/resize

URL Parameters

Parameter Description
:id ID of the instance

JSON Parameters

Parameter Required Default Description
instance.plan.id no null The map containing the id of the service plan you wish to apply to the containers in this instance
volumes no defaults to plan config Can be used to grow just the logical volume of the instance instead of choosing a plan
deleteOriginalVolumes no false Delete the original volumes after resizing. (Amazon only)

Clone an Instance

curl -X PUT "https://api.gomorpheus.com/api/instances/1/clone" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "name": "New Name",
    "group": {
      "id": 1
  }}'

The above command returns JSON structure like this:

{
  "success": true
}

One can easily clone an instance and all containers within that instance. The containers are backed up via the backup services and used as a snapshot to produce a clone of the instance. It is possible to clone this app instance into an entirely different availability zone.

HTTP Request

PUT https://api.gomorpheus.com/api/instances/:id/clone

URL Parameters

Parameter Description
:id ID of the instance

JSON Parameters

Parameter Default Description
group null the map containing the id of the server group you would like to clone into.
group null the map containing the id of the server group you would like to clone into.
name null A name for the new cloned instance. If none is specified the existing name will be duplicated with the ‘clone’ suffix added.

This endpoint also supports all of the same parameters as [Create and Instance][#create-an-instance], so you can override any configuration options when provisioning the clone.

Backup an Instance

curl -X PUT "https://api.gomorpheus.com/api/instances/1773/backup" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structure that looks like this:

{
    "success": true
}

HTTP Request

PUT https://api.gomorpheus.com/api/instances/:id/backup

URL Parameters

Parameter Description
:id ID of the instance

Get list of backups for an Instance

curl "$MORPHEUS_API_URL/api/instances/1773/backups" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structure that looks like this:

{
    "instance": {
      "id": 1773
    },
    "backups": [
    ]
}

HTTP Request

GET https://api.gomorpheus.com/api/instances/:id/backups

URL Parameters

Parameter Description
:id ID of the instance

Import Snapshot of an Instance

curl -X PUT "https://api.gomorpheus.com/api/instances/1/import-snapshot" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "storageProviderId": 1
  }'

The above command returns JSON structure like this:

{
  "success": true
}

It is possible to import a snapshot of an instance. This creates a Virtual Image of the instance as it currently exists.

HTTP Request

PUT https://api.gomorpheus.com/api/instances/:id/import-snapshot

URL Parameters

Parameter Description
:id ID of the instance

JSON Parameters

Parameter Default Description
storageProviderId null Optional storage provider to use.

Get Security Groups

curl -XGET "https://api.gomorpheus.com/api/instances/1/security-groups" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structure like this:

{
  "success": true,
  "firewallEnabled": true,
  "securityGroups": [
    {
      "id": 19,
      "accountId": 1,
      "name": "All Tomcat Access",
      "description": "Allow everyone to access Tomcat"
    }
  ]
}

This returns a list of all of the security groups applied to an instance and whether the firewall is enabled.

HTTP Request

GET https://api.gomorpheus.com/api/instances/:id/security-groups

URL Parameters

Parameter Description
:id ID of the instance

Set Security Groups

curl -X POST "https://api.gomorpheus.com/api/instances/1/security-groups" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "securityGroupIds": [19, 2] }'

The above command returns JSON structure similar to the 'get’ of security groups.

HTTP Request

POST https://api.gomorpheus.com/api/instances/:id/security-groups

URL Parameters

Parameter Description
:id ID of the instance

JSON Parameters

Parameter Default Description
securityGroupIds List of all security groups ids which should be applied. If no security groups should apply, pass ’[]’

This defines the list of all the security groups applied to an instance.

Delete an Instance

curl -XDELETE "$MORPHEUS_API_URL/api/instances/1" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structure like this:

{
  "success": true
}

Will delete an instance and all associated monitors and backups.

HTTP Request

DELETE https://api.gomorpheus.com/api/instances/:id

URL Parameters

Parameter Description
:id ID of the instance

Query Parameters

Parameter Default Description
preserveVolumes off Preserve Volumes
keepBackups off Preserve copy of backups
releaseEIPs on Release EIPs
force off Force Delete

Get All Instance Types

Fetch the list of available instance types. These can vary in range from database containers, to web containers, to custom containers. .

curl "$MORPHEUS_API_URL/api/instance-types"
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structured like this

{
  "instanceTypes": [
    {
      "id": 12,
      "name": "ActiveMQ",
      "code": "activemq",
      "category": "messaging",
      "active": true,
      "versions": [
        "5.11"
      ],
      "instanceTypeLayouts": [
        {
          "id": 14,
          "code": "activemq-5.11",
          "name": "Single Process",
          "description": "This will provision a single process with no redundancy",
          "provisionType": { /* see provision types */ },
          "optionTypes": { /** see option types **/}
        }
      ]
    },
    {
      "id": 13,
      "name": "Cassandra",
      "code": "cassandra",
      "category": "nosql",
      "active": true,
      "versions": [
        "2.1"
      ],
      "instanceTypeLayouts": [
        {
          "id": 15,
          "code": "cassandra-2.1-single",
          "name": "Single Process",
          "description": "This will provision a single process with no redundancy",
          "provisionType": { /* see provision types */ },
          "optionTypes": { /** see option types **/ }
        }
      ]
    },
    {
      "id": 10,
      "name": "Confluence",
      "code": "confluence",
      "category": "utils",
      "active": true,
      "versions": [
        "5.7"
      ],
      "instanceTypeLayouts": [
        {
          "id": 12,
          "code": "confluence-5.7",
          "name": "Single Process",
          "description": "This will provision a single process with no redundancy",
          "provisionType": { /* see provision types */ },
          "optionTypes": { /** see option types **/ }
        }
      ]
    },
    {
      "id": 5,
      "name": "Elastic Search",
      "code": "elasticsearch",
      "category": "nosql",
      "active": true,
      "versions": [
        "1.5"
      ],
      "instanceTypeLayouts": [
        {
          "id": 3,
          "code": "elasticsearch-1.5-single",
          "name": "Single Process",
          "description": "This will provision a single process with no redundancy",
          "provisionType": { /* see provision types */ },
          "optionTypes": { /** see option types **/ }
        },
        {
          "id": 4,
          "code": "elasticsearch-1.5-cluster",
          "name": "Cluster",
          "description": "This will provision two nodes, in multi master cluster",
          "provisionType": { /* see provision types */ },
          "optionTypes": { /** see option types **/ }
        }
      ]
    },
    {
      "id": 7,
      "name": "Jenkins",
      "code": "jenkins",
      "category": "utils",
      "active": true,
      "versions": [
        "1.596"
      ],
      "instanceTypeLayouts": [
        {
          "id": 8,
          "code": "jenkins-1.596",
          "name": "Single Process",
          "description": "This will provision a single process with no redundancy",
          "provisionType": { /* see provision types */ },
          "optionTypes": { /** see option types **/ }
        }
      ]
    },
    {
      "id": 2,
      "name": "Memcached",
      "code": "memcached",
      "category": "cache",
      "active": true,
      "versions": [
        "1.4"
      ],
      "instanceTypeLayouts": [
        {
          "id": 11,
          "code": "memcached-1.4-single",
          "name": "Single Process",
          "description": "This will provision a single process with no redundancy",
          "provisionType": { /* see provision types */ },
          "optionTypes": { /** see option types **/ }
        }
      ]
    },
    {
      "id": 4,
      "name": "Mongo",
      "code": "mongo",
      "category": "nosql",
      "active": true,
      "versions": [
        "3.0"
      ],
      "instanceTypeLayouts": [
        {
          "id": 16,
          "code": "mongo-3.0-rs",
          "name": "ReplicaSet",
          "description": "This will provision a 3 node replicaSet",
          "provisionType": { /* see provision types */ },
          "optionTypes": { /** see option types **/ }
        },
        {
          "id": 6,
          "code": "mongo-3.0-single",
          "name": "Single Process",
          "description": "This will provision a single process with no redundancy",
          "provisionType": { /* see provision types */ },
          "optionTypes": { /** see option types **/ }
        }
      ]
    },
    {
      "id": 3,
      "name": "MySQL",
      "code": "mysql",
      "category": "sql",
      "active": true,
      "versions": [
        "5.6"
      ],
      "instanceTypeLayouts": [
        {
          "id": 5,
          "code": "mysql-5.6-single",
          "name": "Single Process",
          "description": "This will provision a single process with no redundancy",
          "provisionType": { /* see provision types */ },
          "optionTypes": { /** see option types **/ }
        }
      ]
    },
    {
      "id": 8,
      "name": "Nexus",
      "code": "nexus",
      "category": "utils",
      "active": true,
      "versions": [
        "2.11"
      ],
      "instanceTypeLayouts": [
        {
          "id": 9,
          "code": "nexus-2.11",
          "name": "Single Process",
          "description": "This will provision a single process with no redundancy",
          "provisionType": { /* see provision types */ },
          "optionTypes": { /** see option types **/ }
        }
      ]
    },
    {
      "id": 14,
      "name": "Nginx",
      "code": "nginx",
      "category": "web",
      "active": true,
      "versions": [
        "1.9"
      ],
      "instanceTypeLayouts": [

      ]
    },
    {
      "id": 11,
      "name": "Postgres",
      "code": "postgres",
      "category": "sql",
      "active": true,
      "versions": [
        "9.4"
      ],
      "instanceTypeLayouts": [
        {
          "id": 13,
          "code": "postgres-9.4-single",
          "name": "Single Process",
          "description": "This will provision a single process with no redundancy",
          "provisionType": { /* see provision types */ },
          "optionTypes": { /** see option types **/ }
        }
      ]
    },
    {
      "id": 9,
      "name": "RabbitMQ",
      "code": "rabbitmq",
      "category": "utils",
      "active": true,
      "versions": [
        "3.5"
      ],
      "instanceTypeLayouts": [
        {
          "id": 10,
          "code": "rabbitmq-3.5",
          "name": "Single Process",
          "description": "This will provision a single process with no redundancy",
          "provisionType": { /* see provision types */ },
          "optionTypes": { /** see option types **/ }
        }
      ]
    },
    {
      "id": 1,
      "name": "Redis",
      "code": "redis",
      "category": "cache",
      "active": true,
      "versions": [
        "3.0"
      ],
      "instanceTypeLayouts": [
        {
          "id": 1,
          "code": "redis-3.0-single",
          "name": "Single Process",
          "description": "This will provision a single process with no redundancy",
          "provisionType": { /* see provision types */ },
          "optionTypes": { /** see option types **/ }
        },
        {
          "id": 2,
          "code": "redis-3.0-master-slave",
          "name": "Master\/Slave",
          "description": "This will provision 2 containers, one master and 1 slave.",
          "provisionType": { /* see provision types */ },
          "optionTypes": { /** see option types **/ }
        }
      ]
    },
    {
      "id": 6,
      "name": "Tomcat",
      "code": "tomcat",
      "category": "web",
      "active": true,
      "versions": [
        "7.0.62"
      ],
      "instanceTypeLayouts": [
        {
          "id": 7,
          "code": "tomcat-7.0.62-single",
          "name": "Single Process",
          "description": "This will provision a single process with no redundancy",
          "provisionType": { /* see provision types */ },
          "optionTypes": { /** see option types **/ }
        }
      ]
    }
  ]
}

HTTP Request

GET https://api.gomorpheus.com/api/instance-types

Get Specific Instance Type

curl "$MORPHEUS_API_URL/api/instance-types/12"
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structured like this

{
  "success": true,
  "instanceType": {
    "id": 12,
    "name": "ActiveMQ",
    "code": "activemq",
    "category": "messaging",
    "active": true,
    "versions": [
      "5.11"
    ],
    "instanceTypeLayouts": [
      {
        "id": 14,
        "code": "activemq-5.11",
        "name": "Single Process",
        "description": "This will provision a single process with no redundancy",
        "provisionType": { /* see provision types */ },
        "optionTypes": { /** see option types **/ }
      }
    ]
  }
}

HTTP Request

GET https://api.gomorpheus.com/api/instance-types/:id

Apps

Apps are groupings of instances that are linked together to form a full application stack. They can be created with existing templates or new templates, as well as from existing instances.

Get All Apps

curl "$MORPHEUS_API_URL/api/apps" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structured like this:

{
  "apps": [
    {
      "id": 1,
      "name": "My Test App",
      "description": "Sample Description",
      "accountId": 1,
      "account": {
        "id": 1,
        "name": "root"
      },
      "siteId": 1,
      "group": {
        "id": 1,
        "name": "My Group"
      },
      "blueprint": {
        "id": 135,
        "name": "Grails Example",
        "type": "morpheus"
      },
      "status": "running",
      "instanceCount": 2,
      "containerCount": 2,
      "dateCreated": "2015-06-09T20:59:17Z",
      "lastUpdated": "2015-06-09T21:00:19Z",
      "appTiers": [
        {
          "tier": {
            "id": 2,
            "name": "App"
          },
          "appInstances": [
            {
              "instance": {
                "id": 53,
                "name": "Test App - Grails"
              }
            }
          ]
        },
        {
          "tier": {
            "id": 5,
            "name": "Database"
          },
          "appInstances": [
            {
              "instance": {
                "id": 54,
                "name": "Test App - MySQL"
              }
            }
          ]
        }
      ],
      "stats": {
        "usedMemory": 0,
        "maxMemory": 1073741824,
        "usedStorage": 0,
        "maxStorage": 21474836480,
        "running": 0,
        "total": 0,
        "cpuUsage": 0,
        "instanceCount": 2
      }
    }
  ],
  "meta": {
    "offset": 0,
    "max": 25,
    "size": 1,
    "total": 1
  }
}

This endpoint retrieves a paginated list of apps.

Query Parameters

Parameter Default Description
max 25 Max number of results to return
offset 0 Offset of records you want to load
name Filter by name
phrase Filter by wildcard search of name and description
createdBy Filter by Created By (User) ID. Accepts multiple values.

Get a Specific App

curl "$MORPHEUS_API_URL/api/apps/4" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structured like this:

{
  "app": {
    "id": 1,
    "name": "My Test App",
    "description": "Sample Description",
    "accountId": 1,
    "account": {
      "id": 1,
      "name": "root"
    },
    "siteId": 1,
    "group": {
      "id": 1,
      "name": "My Group"
    },
    "blueprint": {
      "id": 135,
      "name": "Grails Example",
      "type": "morpheus"
    },
    "status": "running",
    "instanceCount": 2,
    "containerCount": 2,
    "dateCreated": "2015-06-09T20:59:17Z",
    "lastUpdated": "2015-06-09T21:00:19Z",
    "appTiers": [
      {
        "tier": {
          "id": 2,
          "name": "App"
        },
        "appInstances": [
          {
            "instance": {
              "id": 53,
              "name": "Test App - Grails"
            }
          }
        ]
      },
      {
        "tier": {
          "id": 5,
          "name": "Database"
        },
        "appInstances": [
          {
            "instance": {
              "id": 54,
              "name": "Test App - MySQL"
            }
          }
        ]
      }
    ],
    "stats": {
      "usedMemory": 0,
      "maxMemory": 1073741824,
      "usedStorage": 0,
      "maxStorage": 21474836480,
      "running": 0,
      "total": 0,
      "cpuUsage": 0,
      "instanceCount": 2
    }
  }
}

This endpoint retrieves a specific app.

HTTP Request

GET https://api.gomorpheus.com/api/apps/:id

URL Parameters

Parameter Description
:id ID of the app

Create an App

curl -XPOST "$MORPHEUS_API_URL/api/apps" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"app":{
    "name": "sampleapp",
    "description": "A sample app",
    "group": {
      "id": 1
    }
  }}'

The above command returns JSON structured like getting a single app.

HTTP Request

POST https://api.gomorpheus.com/api/apps

JSON App Parameters

Parameter Default Description
name A name for the app
description Optional description field
group A Map containing the id of the Group

Updating an App Name or Description

curl -XPUT "$MORPHEUS_API_URL/api/apps/2" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"app":{
    "name": "My Sample App",
    "description": "A new description of this app",
  }}'

The above command returns JSON structured like getting a single app.

HTTP Request

PUT https://api.gomorpheus.com/api/apps/:id

URL Parameters

Parameter Description
:id ID of the app

JSON App Parameters

Parameter Default Description
name A name for the app
description Optional description field

Add Existing Instance to App

curl -XPOST "$MORPHEUS_API_URL/api/apps/1/add-instance" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"instanceId": 55, tierName: "App"}'

The above command returns JSON structured like getting a single app.

HTTP Request

POST https://api.gomorpheus.com/api/apps/:id/add-instance

URL Parameters

Parameter Description
:id ID of the app

JSON Parameters

Parameter Default Description
instanceId The ID of the instance being added
tierName The Name of the Tier

Remove Instance from App

curl -XPOST "$MORPHEUS_API_URL/api/apps/1/remove-instance" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"instanceId": 55}'

The above command returns JSON structured like getting a single app.

HTTP Request

POST https://api.gomorpheus.com/api/apps/:id/remove-instance

URL Parameters

Parameter Description
:id ID of the app

JSON Parameters

Parameter Default Description
instanceId The ID of the instance being removed

Get Security Groups

curl -XGET "https://api.gomorpheus.com/api/apps/1/security-groups" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structure like this:

{
  "success": true,
  "firewallEnabled": true,
  "securityGroups": [
    {
      "id": 19,
      "accountId": 1,
      "name": "All Tomcat Access",
      "description": "Allow everyone to access Tomcat"
    }
  ]
}

This returns a list of all of the security groups applied to an app and whether the firewall is enabled.

HTTP Request

GET https://api.gomorpheus.com/api/apps/:id/security-groups

URL Parameters

Parameter Description
:id ID of the app

Set Security Groups

curl -XPOST "$MORPHEUS_API_URL/api/apps/1/security-groups" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "securityGroupIds": [19, 2] }'

The above command returns JSON structure similar to the ‘get’ of security groups.

HTTP Request

POST https://api.gomorpheus.com/api/apps/:id/security-groups

URL Parameters

Parameter Description
:id ID of the app

JSON Parameters

Parameter Default Description
securityGroupIds List of all security groups ids which should be applied. If no security groups should apply, pass ’[]’

Delete an App

curl -XDELETE "$MORPHEUS_API_URL/api/apps/1" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structure like this:

{
  "success": true
}

Will delete an app. Use removeInstances=on to also delete the instances in the app and all associated monitors and backups.

HTTP Request

DELETE https://api.gomorpheus.com/api/apps/:id

URL Parameters

Parameter Description
:id ID of the app

Query Parameters

Parameter Default Description
removeInstances off Remove Instances
preserveVolumes off Preserve Volumes
keepBackups off Preserve copy of backups
releaseEIPs on Release EIPs
force off Force Delete

Blueprints

Blueprints are templates for creating apps. They are a set of instance configurations, organized by tier, and scoped by group, cloud and environment.

A Blueprint may also be referred to as a App Template or appTemplate.

Get All Blueprints

curl "$MORPHEUS_API_URL/api/blueprints" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structured like this:

{
  "blueprints": [
    {
      "id": 135,
      "name": "test",
      "type": "morpheus",
      "description": null,
      "category": null,
      "config": {
        "image": "/assets/apps/template.png",
        "tiers": {
          "Web": {
            "linkedTiers": [

            ],
            "tierIndex": 1,
            "instances": [
              {
                "instance": {
                  "type": "nginx"
                },
                "groups": {
                  "My Group": {
                    "clouds": {
                      "My Cloud": {
                        "instance": {
                          "layout": {
                            "code": "nginx-vmware-1.9-single",
                            "id": 179
                          },
                          "name": "test-nginx-${sequence}",
                          "allowExisting": false,
                          "createUser": "on",
                          "type": "nginx",
                          "userGroup": {
                            "id": ""
                          }
                        },
                        "networkInterfaces": [
                          {
                            "ipMode": "",
                            "primaryInterface": true,
                            "network": {
                              "id": "",
                              "hasPool": false
                            },
                            "networkInterfaceTypeId": 4,
                            "networkInterfaceTypeIdName": "VMXNET 3"
                          }
                        ],
                        "volumes": [
                          {
                            "vId": 255,
                            "controllerMountPoint": "46:0:4:0",
                            "size": 10,
                            "maxIOPS": null,
                            "name": "root",
                            "rootVolume": true,
                            "storageType": 1,
                            "datastoreId": "autoCluster",
                            "maxStorage": 0
                          }
                        ],
                        "config": {
                          "resourcePoolId": "resgroup-123",
                          "createUser": true
                        },
                        "plan": {
                          "code": "vm-1024",
                          "id": 76
                        }
                      }
                    }
                  }
                }
              }
            ]
          }
        },
        "name": "test",
        "templateImage": "",
        "type": "morpheus",
        "config": {
          "isVpcSelectable": true,
          "isEC2": false
        }
      },
      "visibility": "private",
      "resourcePermission": {
        "all": true,
        "sites": [

        ]
      }
    }
  ],
  "meta": {
    "offset": 0,
    "max": "1",
    "size": 1,
    "total": 1
  }
}

This endpoint retrieves all blueprints.

HTTP Request

GET https://api.gomorpheus.com/api/blueprints

Query Parameters

Parameter Default Description
max 25 Max number of results to return
offset 0 Offset of records you want to load
name Filter by name
phrase Filter by wildcard search of name and description

Get a Specific Blueprint

curl "$MORPHEUS_API_URL/api/blueprints/4" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structured like this:

{
  "blueprint": {
    "id": 135,
    "name": "test",
    "type": "morpheus",
    "description": null,
    "category": null,
    "config": {
      "image": "/assets/apps/template.png",
      "tiers": {
        "Web": {
          "linkedTiers": [

          ],
          "tierIndex": 1,
          "instances": [
            {
              "instance": {
                "type": "nginx"
              },
              "groups": {
                "My Group": {
                  "clouds": {
                    "My Cloud": {
                      "instance": {
                        "layout": {
                          "code": "nginx-vmware-1.9-single",
                          "id": 179
                        },
                        "name": "test-nginx-${sequence}",
                        "allowExisting": false,
                        "createUser": "on",
                        "type": "nginx",
                        "userGroup": {
                          "id": ""
                        }
                      },
                      "networkInterfaces": [
                        {
                          "ipMode": "",
                          "primaryInterface": true,
                          "network": {
                            "id": "",
                            "hasPool": false
                          },
                          "networkInterfaceTypeId": 4,
                          "networkInterfaceTypeIdName": "VMXNET 3"
                        }
                      ],
                      "volumes": [
                        {
                          "vId": 255,
                          "controllerMountPoint": "46:0:4:0",
                          "size": 10,
                          "maxIOPS": null,
                          "name": "root",
                          "rootVolume": true,
                          "storageType": 1,
                          "datastoreId": "autoCluster",
                          "maxStorage": 0
                        }
                      ],
                      "config": {
                        "resourcePoolId": "resgroup-123",
                        "createUser": true
                      },
                      "plan": {
                        "code": "vm-1024",
                        "id": 76
                      }
                    }
                  }
                }
              }
            }
          ]
        }
      },
      "name": "test",
      "templateImage": "",
      "type": "morpheus",
      "config": {
        "isVpcSelectable": true,
        "isEC2": false
      }
    },
    "visibility": "private",
    "resourcePermission": {
      "all": true,
      "sites": [

      ]
    }
  }
}

This endpoint retrieves a specific blueprint.

HTTP Request

GET https://api.gomorpheus.com/api/blueprints/:id

Create a Blueprint

curl -XPOST "$MORPHEUS_API_URL/api/blueprints" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "sample",
    "description": "A sample blueprint",
    "type": "morpheus",
    "tiers": {
      "Web": {
        "linkedTiers": [

        ],
        "tierIndex": 1,
        "instances": [
          {
            "instance": {
              "type": "nginx"
            },
            "groups": {
              "My Group": {
                "clouds": {
                  "My Cloud": {
                    "instance": {
                      "layout": {
                        "code": "nginx-vmware-1.9-single",
                        "id": 179
                      },
                      "name": "test-nginx-${sequence}",
                      "allowExisting": false,
                      "createUser": "on",
                      "type": "nginx",
                      "userGroup": {
                        "id": ""
                      }
                    },
                    "networkInterfaces": [
                      {
                        "ipMode": "",
                        "primaryInterface": true,
                        "network": {
                          "id": "",
                          "hasPool": false
                        },
                        "networkInterfaceTypeId": 4,
                        "networkInterfaceTypeIdName": "VMXNET 3"
                      }
                    ],
                    "volumes": [
                      {
                        "vId": 255,
                        "controllerMountPoint": "46:0:4:0",
                        "size": 10,
                        "maxIOPS": null,
                        "name": "root",
                        "rootVolume": true,
                        "storageType": 1,
                        "datastoreId": "autoCluster",
                        "maxStorage": 0
                      }
                    ],
                    "config": {
                      "resourcePoolId": "resgroup-123",
                      "createUser": true
                    },
                    "plan": {
                      "code": "vm-1024",
                      "id": 76
                    }
                  }
                }
              }
            }
          }
        ]
      }
    }
  }'

The above command returns JSON structured like getting a single blueprint.

HTTP Request

POST https://api.gomorpheus.com/api/blueprints

JSON Blueprint Parameters

Parameter Default Description
name A name for the blueprint
description Optional description field
category morpheus Optional category field
type morpheus Blueprint Type. The default is ‘morpheus’.
tiers A Map containing a key for each tier and all their instances.

Blueprint Tiers Configuration

The blueprint tiers can be structured so that instance configurations are scoped to a specific environment, group and/or cloud. The environments key is the environment name. The groups key is the group name. The clouds key is the cloud name. The order of scoping must always be done in the order: environments, groups, and then clouds.

Example: json { "name": "sample blueprint", "type": "morpheus", "tiers": { "App": { "tierIndex": 1 "linkedTiers": [], "instances": [ { "instance": { "type": "activemq" }, "environments": { "Dev": { "groups": { "My Group": { "clouds": { "My Cloud": { "instance": { "layout": { "code": "nginx-vmware-1.9-single", "id": 179 }, "name": "test-nginx-${sequence}" }, "plan": { "code": "vm-1024", "id": 76 } } } } } } } } ], } } }

Updating a Blueprint

curl -XPUT "$MORPHEUS_API_URL/api/blueprints/2" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "sample",
    "description": "A sample nginx blueprint",
    "type": "morpheus",
    "tiers": {
      "Web": {
        "linkedTiers": [

        ],
        "tierIndex": 1,
        "instances": [
          {
            "instance": {
              "type": "nginx"
            },
            "groups": {
              "My Group": {
                "clouds": {
                  "My Cloud": {
                    "instance": {
                      "layout": {
                        "code": "nginx-vmware-1.9-single",
                        "id": 179
                      },
                      "name": "test-nginx-${sequence}",
                      "allowExisting": false,
                      "createUser": "on",
                      "type": "nginx",
                      "userGroup": {
                        "id": ""
                      }
                    },
                    "networkInterfaces": [
                      {
                        "ipMode": "",
                        "primaryInterface": true,
                        "network": {
                          "id": "",
                          "hasPool": false
                        },
                        "networkInterfaceTypeId": 4,
                        "networkInterfaceTypeIdName": "VMXNET 3"
                      }
                    ],
                    "volumes": [
                      {
                        "vId": 255,
                        "controllerMountPoint": "46:0:4:0",
                        "size": 10,
                        "maxIOPS": null,
                        "name": "root",
                        "rootVolume": true,
                        "storageType": 1,
                        "datastoreId": "autoCluster",
                        "maxStorage": 0
                      }
                    ],
                    "config": {
                      "resourcePoolId": "resgroup-123",
                      "createUser": true
                    },
                    "plan": {
                      "code": "vm-1024",
                      "id": 76
                    }
                  }
                }
              }
            }
          }
        ]
      }
    }
  }'

The above command returns JSON structured like getting a single blueprint.

HTTP Request

PUT https://api.gomorpheus.com/api/blueprints/:id

JSON Blueprint Parameters

Same as Create.

This overwrites the entire config, so the entire blueprint config should be passed.

Update Blueprint Permissions

curl -XPOST "$MORPHEUS_API_URL/api/blueprints/1/update-permissions" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "resourcePermission": {
    "all":false,
    "sites": [
      {"id": 1}
    ]
  }}'

The above command returns JSON structured like getting a single blueprint.

HTTP Request

POST https://api.gomorpheus.com/api/blueprints/:id/update-permissions

JSON Parameters

Parameter Default Description
resourcePermission.all Enable access for all groups
resourcePermission.sites Enable access for specific groups only

Update Blueprint Image

curl -XPOST "$MORPHEUS_API_URL/api/blueprints/1/image" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"
  -F 'templateImage=@filename'

The above command returns JSON structured like getting a single blueprint.

HTTP Request

POST https://api.gomorpheus.com/api/blueprints/:id/image

Parameters

Parameter Default Description
templateImage Image File png,jpg,svg

Upload a new logo image. Expects multipart form data as the request format, not JSON.

Delete a Blueprint

curl -XDELETE "$MORPHEUS_API_URL/api/blueprints/1" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structure like this:

{
  "success": true
}

HTTP Request

DELETE https://api.gomorpheus.com/api/blueprints/:id

Automation

The Automation API endpoints provide the management of Tasks, Workflows, Executions, Scale Thresholds, Power and Execute Scheduling.

Tasks

Provides API interfaces for managing the creation and modification of automation tasks. Tasks are used in workflows for automation.

curl "$MORPHEUS_API_URL/api/tasks"
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structured like this:

{
  "tasks": [
     {
      "id": 5,
      "accountId": 1,
      "name": "aptitude upgrade",
      "taskType": {
        "id": 1,
        "code": "script",
        "name": "Shell Script"
      },
      "taskOptions": {
        "script": "apt-get upgrade -y"
      }
    },
  ],
  "meta": {
    "offset": 0,
    "max": 25,
    "size": 1,
    "total": 1
  }
}

This endpoint retrieves all tasks.

HTTP Request

GET https://api.gomorpheus.com/api/tasks

Query Parameters

Parameter Default Description
max 25 Max number of results to return
offset 0 Offset of records you want to load
sort name Sort order
direction asc Sort direction, use ‘desc’ to reverse sort
phrase Filter by matching name
name Filter by name
taskTypeCodes Filter by task type code(s).

Get a Specific Task

curl "$MORPHEUS_API_URL/api/tasks/1" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structured like this:

{
  "task": {
      "id": 5,
      "accountId": 1,
      "name": "aptitude upgrade",
      "taskType": {
        "id": 1,
        "code": "script",
        "name": "Shell Script"
      },
      "taskOptions": {
        "script": "apt-get upgrade -y"
      }
    }
}

This endpoint will retrieve a specific task by id

HTTP Request

GET https://api.gomorpheus.com/api/tasks/:id

URL Parameters

Parameter Description
ID The ID of the task

Create a Task

curl -XPOST "$MORPHEUS_API_URL/api/tasks" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"task": {
    "name": "cleanup tmp files",
    "taskType": {
      "code": "script"
    },
    "taskOptions": {
      "script": "rm -rf /var/www/app1/tmp/*\nrm -rf /var/www/app2/tmp/*"
    }
  }}'

The above command returns JSON structured like getting a single task:

HTTP Request

POST https://api.gomorpheus.com/api/tasks

JSON Parameters

Parameter Default Description
name A unique name for the task
code A unique code for the task
taskType.code The type of task
taskOptions Map of options specific to each type. eg. script
resultType The result type eg. value, exitCode, keyValue, json
executeTarget The execution target. eg. local,remote,resource. The default value varies by task type.
retryable false If the task should be retried or not.
retryCount The number of times to retry.
retryDelaySeconds The delay, between retries.

JSON Parameters for Execute Target: Local

Parameter Default Description
taskOptions.localScriptGitId The Git Repo ID
taskOptions.localScriptGitRef The Git Repo Ref eg. master

These additional task options are available when using executeTarget of local.

JSON Parameters for Execute Target: Remote

Parameter Default Description
taskOptions.host Host or IP Address for remote execution
taskOptions.port 22 Port for remote execution
taskOptions.username Username for remote execution
taskOptions.password Password for remote execution

These additional task options are available when using executeTarget of remote.

Updating a Task

curl -XPUT "$MORPHEUS_API_URL/api/tasks/5" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"task":{
    "name": "my task",
  }}'

The above command returns JSON structured like getting a single task:

HTTP Request

PUT https://api.gomorpheus.com/api/tasks/:id

URL Parameters

Parameter Description
ID The ID of the task

JSON Parameters

Same as Create.

Delete a Task

curl -XDELETE "$MORPHEUS_API_URL/api/tasks/1" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON Structured like this:

{
  "success": true
}

HTTP Request

DELETE https://api.gomorpheus.com/api/tasks/:id

URL Parameters

Parameter Description
ID The ID of the task

If a task is still tied to workflows, the delete will fail.

Task Types

A Task Type is a type of automation task. Each type defines its own set of options to be configured for each task.

curl "$MORPHEUS_API_URL/api/task-types"
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structured like this:

{
  "taskTypes": [
    {
      "id": 1,
      "code": "script",
      "name": "Shell Script",
      "category": "script",
      "description": null,
      "optionTypes": [
        {
          "id": 254,
          "name": "Script",
          "code": "script",
          "description": null,
          "fieldName": "script",
          "fieldLabel": "Script",
          "fieldContext": "taskOptions",
          "fieldGroup": null,
          "fieldClass": null,
          "fieldAddOn": null,
          "placeHolder": null,
          "helpBlock": null,
          "defaultValue": null,
          "optionSource": null,
          "type": "code-editor",
          "advanced": false,
          "required": false,
          "editable": false,
          "config": {
          },
          "displayOrder": 5,
          "wrapperClass": null,
          "enabled": true,
          "noBlank": null,
          "dependsOnCode": null,
          "contextualDefault": null
        }
      ]
    },
    {
      "id": 2,
      "code": "sshTask",
      "name": "SSH Script",
      "category": "script",
      "description": null,
      "optionTypes": [
        {
          "id": 258,
          "name": "Key",
          "code": "sshKey",
          "description": null,
          "fieldName": "sshKey",
          "fieldLabel": "Key",
          "fieldContext": "taskOptions",
          "fieldGroup": null,
          "fieldClass": null,
          "fieldAddOn": null,
          "placeHolder": null,
          "helpBlock": null,
          "defaultValue": null,
          "optionSource": "keyPairs",
          "type": "select",
          "advanced": false,
          "required": false,
          "editable": false,
          "config": {
          },
          "displayOrder": 2,
          "wrapperClass": null,
          "enabled": true,
          "noBlank": null,
          "dependsOnCode": null,
          "contextualDefault": null
        },
        {
          "id": 254,
          "name": "Script",
          "code": "script",
          "description": null,
          "fieldName": "script",
          "fieldLabel": "Script",
          "fieldContext": "taskOptions",
          "fieldGroup": null,
          "fieldClass": null,
          "fieldAddOn": null,
          "placeHolder": null,
          "helpBlock": null,
          "defaultValue": null,
          "optionSource": null,
          "type": "code-editor",
          "advanced": false,
          "required": false,
          "editable": false,
          "config": {
          },
          "displayOrder": 5,
          "wrapperClass": null,
          "enabled": true,
          "noBlank": null,
          "dependsOnCode": null,
          "contextualDefault": null
        },
        {
          "id": 259,
          "name": "IP Address",
          "code": "host",
          "description": null,
          "fieldName": "host",
          "fieldLabel": "IP Address",
          "fieldContext": "taskOptions",
          "fieldGroup": null,
          "fieldClass": null,
          "fieldAddOn": null,
          "placeHolder": null,
          "helpBlock": null,
          "defaultValue": null,
          "optionSource": null,
          "type": "text",
          "advanced": false,
          "required": false,
          "editable": false,
          "config": {
          },
          "displayOrder": 0,
          "wrapperClass": null,
          "enabled": true,
          "noBlank": null,
          "dependsOnCode": null,
          "contextualDefault": null
        },
        {
          "id": 257,
          "name": "Password",
          "code": "password",
          "description": null,
          "fieldName": "password",
          "fieldLabel": "Password",
          "fieldContext": "taskOptions",
          "fieldGroup": null,
          "fieldClass": null,
          "fieldAddOn": null,
          "placeHolder": null,
          "helpBlock": null,
          "defaultValue": null,
          "optionSource": null,
          "type": "password",
          "advanced": false,
          "required": false,
          "editable": false,
          "config": {
          },
          "displayOrder": 4,
          "wrapperClass": null,
          "enabled": true,
          "noBlank": null,
          "dependsOnCode": null,
          "contextualDefault": null
        },
        {
          "id": 260,
          "name": "Port",
          "code": "port",
          "description": null,
          "fieldName": "port",
          "fieldLabel": "Port",
          "fieldContext": "taskOptions",
          "fieldGroup": null,
          "fieldClass": null,
          "fieldAddOn": null,
          "placeHolder": null,
          "helpBlock": null,
          "defaultValue": null,
          "optionSource": null,
          "type": "text",
          "advanced": false,
          "required": false,
          "editable": false,
          "config": {
          },
          "displayOrder": 1,
          "wrapperClass": null,
          "enabled": true,
          "noBlank": null,
          "dependsOnCode": null,
          "contextualDefault": null
        },
        {
          "id": 256,
          "name": "Username",
          "code": "username",
          "description": null,
          "fieldName": "username",
          "fieldLabel": "Username",
          "fieldContext": "taskOptions",
          "fieldGroup": null,
          "fieldClass": null,
          "fieldAddOn": null,
          "placeHolder": null,
          "helpBlock": null,
          "defaultValue": null,
          "optionSource": null,
          "type": "text",
          "advanced": false,
          "required": false,
          "editable": false,
          "config": {
          },
          "displayOrder": 3,
          "wrapperClass": null,
          "enabled": true,
          "noBlank": null,
          "dependsOnCode": null,
          "contextualDefault": null
        }
      ]
    }
  ]
}

HTTP Request

GET https://api.gomorpheus.com/api/task-types

Query Parameters

Parameter Default Description
name If specified will return an exact match on name or code
code If specified will return an exact match on code

Get a Specific Task Type

curl "$MORPHEUS_API_URL/api/task-types/1" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structured like this:

{
  "success": true,
  "taskType": {
      "id": 1,
      "code": "script",
      "name": "Shell Script",
      "category": "script",
      "description": null,
      "optionTypes": [
        {
          "id": 254,
          "name": "Script",
          "code": "script",
          "description": null,
          "fieldName": "script",
          "fieldLabel": "Script",
          "fieldContext": "taskOptions",
          "fieldGroup": null,
          "fieldClass": null,
          "fieldAddOn": null,
          "placeHolder": null,
          "helpBlock": null,
          "defaultValue": null,
          "optionSource": null,
          "type": "code-editor",
          "advanced": false,
          "required": false,
          "editable": false,
          "config": {
          },
          "displayOrder": 5,
          "wrapperClass": null,
          "enabled": true,
          "noBlank": null,
          "dependsOnCode": null,
          "contextualDefault": null
        }
      ]
    }
}

This endpoint will retrieve a specific task type by id

HTTP Request

GET https://api.gomorpheus.com/api/task-types/:id

URL Parameters

Parameter Description
ID The ID of the task type

Workflows

Provides API interfaces for managing the creation and modification of automation workflows. Workflows, also called Task Sets, are a collection of tasks that are organized in phases. A task phase determines if/when each task runs.

A Workflow may also be referred to as a Task Set or taskSet.

curl "$MORPHEUS_API_URL/api/task-sets" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structured like this:

{
  "taskSets": [
    {
      "id": 13,
      "name": "my workflow",
      "description": null,
      "dateCreated": "2017-06-26T15:36:19+0000",
      "lastUpdated": "2017-06-26T15:44:38+0000",
      "accountId": 1,
      "tasks": [
        8
      ],
      "taskSetTasks": [
        {
          "id": 51,
          "taskPhase": "provision",
          "taskOrder": 2,
          "task": {
            "id": 8,
            "name": "my task",
            "taskType": {
              "id": 1,
              "code": "script",
              "name": "Shell Script"
            },
            "taskOptions": {
              "script": "echo  \"hello\""
            }
          }
        }
      ]
    }
  ],
  "meta": {
    "offset": 0,
    "max": 25,
    "size": 1,
    "total": 1
  }
}

This endpoint retrieves all workflows.

HTTP Request

GET https://api.gomorpheus.com/api/task-sets

Query Parameters

Parameter Default Description
max 25 Max number of results to return
offset 0 Offset of records you want to load
sort name Sort order
direction asc Sort direction, use ‘desc’ to reverse sort
phrase Filter by matching name
name Filter by name

Get a Specific Workflow

curl "$MORPHEUS_API_URL/api/task-sets/1" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structured like this:

{
  "taskSet": {
    "id": 8,
    "name": "uname",
    "description": "",
    "dateCreated": "2017-05-24T20:24:02+0000",
    "lastUpdated": "2017-05-24T20:24:02+0000",
    "accountId": 1,
    "tasks": [
      10
    ],
    "taskSetTasks": [
      {
        "id": 33,
        "taskPhase": "postProvision",
        "taskOrder": 0,
        "task": {
          "id": 10,
          "name": "uname",
          "taskType": {
            "id": 1,
            "code": "script",
            "name": "Shell Script"
          },
          "taskOptions": {
            "script": "echo `uname a`"
          }
        }
      }
    ]
  }
}

This endpoint will retrieve a specific workflow by id

HTTP Request

GET https://api.gomorpheus.com/api/task-sets/:id

URL Parameters

Parameter Description
ID The ID of the workflow

Create a Workflow

curl -XPOST "$MORPHEUS_API_URL/api/task-sets" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"taskSet": {
    "name": "my workflow",
    "tasks": [
      {
        "taskId": 3
      },
      {
        "taskId": 8
      },
      {
        "taskId": 9,
        "taskPhase": "postProvision"
      }
    ]
  }}'

The above command returns JSON structured like getting a single workflow:

HTTP Request

POST https://api.gomorpheus.com/api/task-sets

JSON Parameters

Parameter Default Description
name A unique name for the workflow
description A description of the workflow
tasks [] List of task objects in order
tasks.taskId Task ID
tasks.taskPhase provision Task Phase.

Updating a Workflow

curl -XPUT "$MORPHEUS_API_URL/api/task-sets/5" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"taskSet":{
    "tasks": [
      {
        "taskId": 3
      }
    ]
  }}'

The above command returns JSON structured like getting a single workflow:

HTTP Request

PUT https://api.gomorpheus.com/api/task-sets/:id

URL Parameters

Parameter Description
ID The ID of the workflow

JSON Parameters

Parameter Default Description
name A unique name for the workflow
description A description of the workflow
tasks [] List of task objects in order
tasks.taskId Task ID
tasks.taskPhase provision Task Phase.

Delete a Workflow

curl -XDELETE "$MORPHEUS_API_URL/api/task-sets/1" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON Structured like this:

{
  "success": true
}

HTTP Request

DELETE https://api.gomorpheus.com/api/task-sets/:id

URL Parameters

Parameter Description
ID The ID of the workflow

Power Schedules

Power Schedules can be configured to automatically power on and off your instances and servers.

curl "$MORPHEUS_API_URL/api/power-schedules" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structured like this:

{
  "schedules": [
    {
      "id": 1,
      "name": "weekday daytime",
      "description": "weekday daytime hours",
      "enabled": true,
      "scheduleType": "power",
      "scheduleTimezone": "America/New_York",
      "sundayOn": 0.0,
      "sundayOff": 0.0,
      "mondayOn": 7.0,
      "mondayOff": 19.0,
      "tuesdayOn": 7.0,
      "tuesdayOff": 19.0,
      "wednesdayOn": 7.0,
      "wednesdayOff": 19.0,
      "thursdayOn": 7.0,
      "thursdayOff": 19.0,
      "fridayOn": 7.0,
      "fridayOff": 19.0,
      "saturdayOn": 0.0,
      "saturdayOff": 0.0,
      "totalMonthlyHoursSaved": 463.32,
      "dateCreated": "2018-03-01T07:56:38+0000",
      "lastUpdated": "2018-09-13T21:38:19+0000"
    }
  ],
  "meta": {
    "size": 1,
    "total": 1,
    "max": 25,
    "offset": 0
  }
}

This endpoint retrieves all power schedules associated with the account.

HTTP Request

GET https://api.gomorpheus.com/api/power-schedules

Query Parameters

Parameter Default Description
name If specified will return an exact match on name
phrase If specified will return a partial match on name

Get a Specific Power Schedule

curl "$MORPHEUS_API_URL/api/power-schedules/2" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structured like this:

{
  "schedule": {
    "id": 2,
    "name": "my hours",
    "description": null,
    "enabled": true,
    "scheduleType": "power",
    "scheduleTimezone": "America/New_York",
    "sundayOn": 5.5,
    "sundayOff": 24.0,
    "mondayOn": 0.0,
    "mondayOff": 24.0,
    "tuesdayOn": 0.0,
    "tuesdayOff": 24.0,
    "wednesdayOn": 0.0,
    "wednesdayOff": 24.0,
    "thursdayOn": 0.0,
    "thursdayOff": 24.0,
    "fridayOn": 0.0,
    "fridayOff": 24.0,
    "saturdayOn": 0.0,
    "saturdayOff": 24.0,
    "totalMonthlyHoursSaved": 23.595,
    "dateCreated": "2018-03-07T18:34:08+0000",
    "lastUpdated": "2018-03-07T18:34:08+0000"
  },
  "instances": [

  ],
  "servers": [

  ]
}

This endpoint retrieves a specific power schedule.

HTTP Request

GET https://api.gomorpheus.com/api/power-schedules/:id

URL Parameters

Parameter Description
ID The ID of the power schedule to retrieve

Create a Power Schedule

curl -XPOST "$MORPHEUS_API_URL/api/power-schedules" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "schedule": {
    "name": "business hours only",
    "description": null,
    "enabled": true,
    "scheduleType": "power",
    "scheduleTimezone": "UTC",
    "sundayOn": 0,
    "sundayOff": 0,
    "mondayOn": 7,
    "mondayOff": 19,
    "tuesdayOn": 7,
    "tuesdayOff": 19,
    "wednesdayOn": 7,
    "wednesdayOff": 19,
    "thursdayOn": 7,
    "thursdayOff": 19,
    "fridayOn": 7,
    "fridayOff": 19,
    "saturdayOn": 0,
    "saturdayOff": 0,
    "enabled": true
  }
}'

The above command returns JSON structured like getting a single power schedule:

HTTP Request

POST https://api.gomorpheus.com/api/power-schedules

JSON Parameters

Parameter Default Description
name A name for the power schedule
description A description for the power schedule
scheduleType Type of schedule: Power (power), Power Off (power off)
scheduleTimezone UTC Time Zone eg. America/New_York, Europe/Amsterdam, etc.
enabled true Enabled
sundayOn 0 Saturday Start
sundayOff 24 Saturday End
mondayOn 0 Monday Start
mondayOff 24 Monday Stop
tuesdayOn 0 Tuesday Start
tuesdayOff 24 Tuesday Stop
wednesdayOn 0 Wednesday Start
wednesdayOff 24 Wednesday Stop
thursdayOn 0 Thursday Start
thursdayOff 24 Thursday Stop
fridayOn 0 Friday Start
fridayOff 24 Friday Stop
saturdayOn 0 Saturday Start
saturdayOff 24 Saturday Stop

Update a Power Schedule

curl -XPUT "$MORPHEUS_API_URL/api/power-schedules/2" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "schedule": {
    "mondayOff": 20,
    "tuesdayOff": 20,
    "wednesdayOff": 20,
    "thursdayOff": 20,
    "fridayOff": 15
  }
}'

The above command returns JSON structured like getting a single power schedule:

HTTP Request

PUT https://api.gomorpheus.com/api/power-schedules/:id

JSON Parameters

See Create.

Delete a Power Schedule

curl -XDELETE "$MORPHEUS_API_URL/api/power-schedules/1" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON Structured like this:

{
  "success": true
}

Will delete a power schedule from the system and make it no longer usable.

HTTP Request

DELETE https://api.gomorpheus.com/api/power-schedules/:id

URL Parameters

Parameter Description
ID The ID of the power schedule

Add Instances to a Power Schedule

curl -XPUT "$MORPHEUS_API_URL/api/power-schedules/2/add-instances" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "instances": [
    231, 232
  ]
}'

The above command returns JSON structured like this:

{
  "success": true
}

Add one or many instances to a power schedule.

HTTP Request

PUT https://api.gomorpheus.com/api/power-schedules/:id/add-instances

URL Parameters

Parameter Description
ID The ID of the power schedule

JSON Parameters

Parameter Default Description
instances Array of Instance IDs to add

Remove Instances from a Power Schedule

curl -XPUT "$MORPHEUS_API_URL/api/power-schedules/2/remove-instances" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "instances": [
    232
  ]
}'

The above command returns JSON structured like this:

{
  "success": true
}

Remove one or many instances from a power schedule.

HTTP Request

PUT https://api.gomorpheus.com/api/power-schedules/:id/remove-instances

URL Parameters

Parameter Description
ID The ID of the power schedule

JSON Parameters

Parameter Default Description
instances Array of Instance IDs to remove

Add Servers to a Power Schedule

curl -XPUT "$MORPHEUS_API_URL/api/power-schedules/2/add-servers" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "servers": [
    6,7,8
  ]
}'

The above command returns JSON structured like this:

{
  "success": true
}

Add one or many servers to a power schedule.

HTTP Request

PUT https://api.gomorpheus.com/api/power-schedules/:id/add-servers

URL Parameters

Parameter Description
ID The ID of the power schedule

JSON Parameters

Parameter Default Description
servers Array of Server IDs to add

Remove Servers from a Power Schedule

curl -XPUT "$MORPHEUS_API_URL/api/power-schedules/2/remove-servers" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "servers": [
    7,8
  ]
}'

The above command returns JSON structured like this:

{
  "success": true
}

Remove one or many servers from a power schedule.

HTTP Request

PUT https://api.gomorpheus.com/api/power-schedules/:id/remove-servers

URL Parameters

Parameter Description
ID The ID of the power schedule

JSON Parameters

Parameter Default Description
servers Array of Server IDs to remove

Execute Schedules

Execute Schedules are definitions for recurring schedules. These schedules can be used in your backup jobs.

curl "$MORPHEUS_API_URL/api/execute-schedules" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structured like this:

{
  "schedules": [
    {
      "id": 1,
      "name": "daily",
      "description": "Daily at Midnight",
      "enabled": true,
      "scheduleType": "execute",
      "scheduleTimezone": "America/New_York",
      "cron": "0 0 * * *"
      "dateCreated": "2018-03-01T07:56:38+0000",
      "lastUpdated": "2018-09-13T21:38:19+0000"
    },
    {
      "id": 2,
      "name": "weekly",
      "description": "Weekly on Sunday at Midnight",
      "enabled": true,
      "scheduleType": "execute",
      "scheduleTimezone": "America/New_York",
      "cron": "0 0 * * 7"
      "dateCreated": "2018-03-01T07:56:38+0000",
      "lastUpdated": "2018-09-13T21:38:19+0000"
    }
  ],
  "meta": {
    "size": 1,
    "total": 1,
    "max": 25,
    "offset": 0
  }
}

This endpoint retrieves all execute schedules associated with the account.

HTTP Request

GET https://api.gomorpheus.com/api/execute-schedules

Query Parameters

Parameter Default Description
name If specified will return an exact match on name
phrase If specified will return a partial match on name

Get a Specific Execute Schedule

curl "$MORPHEUS_API_URL/api/execute-schedules/1" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structured like this:

{
  "schedule": {
    "id": 1,
    "name": "daily",
    "description": "Daily at Midnight",
    "enabled": true,
    "scheduleType": "execute",
    "scheduleTimezone": "America/New_York",
    "cron": "0 0 * * *"
    "dateCreated": "2018-03-01T07:56:38+0000",
    "lastUpdated": "2018-09-13T21:38:19+0000"
  }
}

This endpoint retrieves a specific execute schedule.

HTTP Request

GET https://api.gomorpheus.com/api/execute-schedules/:id

URL Parameters

Parameter Description
ID The ID of the execute schedule to retrieve

Create an Execute Schedule

curl -XPOST "$MORPHEUS_API_URL/api/execute-schedules" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "schedule": {
    "name": "Friday at Midnight",
    "description": null,
    "enabled": true,
    "scheduleType": "execute",
    "scheduleTimezone": "UTC",
    "cron": "0 0 * * 5"
  }
}'

The above command returns JSON structured like getting a single execute schedule:

HTTP Request

POST https://api.gomorpheus.com/api/execute-schedules

JSON Parameters

Parameter Default Description
name A name for the execute schedule
description A description for the execute schedule
scheduleType Type of schedule: Execute (execute)
scheduleTimezone UTC Time Zone eg. America/New_York, Europe/Amsterdam, etc.
cron 0 0 * * * Cron Expression. The default is daily at midnight
enabled true Enabled

Update an Execute Schedule

curl -XPUT "$MORPHEUS_API_URL/api/execute-schedules/2" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "schedule": {
    "description": "Daily at 2AM",
    "cron": "0 2 * * *"
  }
}'

The above command returns JSON structured like getting a single execute schedule:

HTTP Request

PUT https://api.gomorpheus.com/api/execute-schedules/:id

JSON Parameters

See Create.

Delete an Execute Schedule

curl -XDELETE "$MORPHEUS_API_URL/api/execute-schedules/1" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON Structured like this:

{
  "success": true
}

Will delete an execute schedule from the system and make it no longer usable.

HTTP Request

DELETE https://api.gomorpheus.com/api/execute-schedules/:id

URL Parameters

Parameter Description
ID The ID of the execute schedule

Virtual Images

Virtual Images can be managed via the API.

Get List of Virtual Images

curl "$MORPHEUS_API_URL/api/virtual-images"
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structured like this:

{
  "virtualImages": [
    {
      "id": 764,
      "name": "testimage",
      "description": null,
      "ownerId": 1,
      "imageType": "vmware",
      "userUploaded": true,
      "userDefined": false,
      "systemImage": false,
      "isCloudInit": true,
      "sshUsername": "root",
      "sshPassword": "****",
      "sshKey": null,
      "osType": {
        "id": 9,
        "name": "ubuntu 64-bit",
        "description": null,
        "vendor": "canonical",
        "category": "ubuntu",
        "osFamily": "debian",
        "osVersion": "all",
        "bitCount": 64,
        "platform": "linux"
      },
      "minDisk": null,
      "minRam": null,
      "rawSize": 56077536,
      "trialVersion": false,
      "virtioSupported": true,
      "isAutoJoinDomain": false,
      "vmToolsInstalled": true,
      "isForceCustomization": false,
      "isSysprep": false,
      "userData": null,
      "storageProvider": {
        "id": 2,
        "name": "local-images"
      },
      "externalId": null,
      "visibility": "private",
      "accounts": [
        {
          "id": 1,
          "name": "root"
        }
      ]
    }
  ],
  "meta": {
    "offset": 0,
    "max": 25,
    "size": 25,
    "total": 43
  }
}

This endpoint retrieves a list of virtual images for the specified filter.

HTTP Request

GET https://api.gomorpheus.com/api/virtual-images

Query Parameters

Parameter Default Description
max 25 Max number of results to return
offset 0 Offset of records you want to load
name Filter by name
phrase Filter by wildcard search of name
lastUpdated Date filter, restricts query to only records with a timestamp is more recent or equal to the date specified
filterType “User” Filter by type, “User”, “System” or “All”
imageType Filter by image type code, “vmware”, “ami”, etc

Get a Specific Virtual Image

curl "$MORPHEUS_API_URL/api/virtual-images/764" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structured like this:

{
  "virtualImage": {
    "id": 764,
    "name": "testimage",
    "description": null,
    "ownerId": 1,
    "imageType": "vmware",
    "userUploaded": true,
    "userDefined": false,
    "systemImage": false,
    "isCloudInit": true,
    "sshUsername": "root",
    "sshPassword": "****",
    "sshKey": null,
    "osType": {
      "id": 9,
      "name": "ubuntu 64-bit",
      "description": null,
      "vendor": "canonical",
      "category": "ubuntu",
      "osFamily": "debian",
      "osVersion": "all",
      "bitCount": 64,
      "platform": "linux"
    },
    "minDisk": null,
    "minRam": null,
    "rawSize": 56077536,
    "trialVersion": false,
    "virtioSupported": true,
    "isAutoJoinDomain": false,
    "vmToolsInstalled": true,
    "isForceCustomization": false,
    "isSysprep": false,
    "userData": null,
    "storageProvider": {
      "id": 2,
      "name": "testdrive2"
    },
    "externalId": null,
    "visibility": "private",
    "accounts": [
      {
        "id": 1,
        "name": "root"
      }
    ]
  },
  "cloudFiles": [
    {
      "name": "testimage.vmdk",
      "size": 1034592
    },
    {
      "name": "testimage.ovf",
      "size": 28038768
    }
  ]
}

This endpoint retrieves a specific virtual image and its files.

HTTP Request

GET https://api.gomorpheus.com/api/virtual-images/:id

URL Parameters

Parameter Description
id The ID of the virtual image

Create a Virtual Image

curl -XPOST "$MORPHEUS_API_URL/api/virtual-images" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"virtualImage":{
    "name": "testimage2",
    "imageType": "vmware",
    "isCloudInit": true,
    "installAgent": true,
    "sshUsername": "root",
    "sshPassword": "mygoodpassword123",
    "sshKey": null,
    "osType": {
      "id": 9
    },
    "virtioSupported": true,
    "vmToolsInstalled": true,

  }}'

The above command returns JSON structured like getting a single virtual image.

This endpoint creates a new virtual image, without any files yet.

HTTP Request

POST https://api.gomorpheus.com/api/virtual-images

JSON Virtual Image Parameters

Parameter Default Description
name A name for the virtual image
imageType Code of image type. eg. vmware, ami, etc.
storageProvider A Map containing the id of the Storage Provider
isCloudInit false Cloud Init Enabled? true or false
userData Cloud-Init User Data, a bash script
installAgent false Install Agent? true or false
sshUsername SSH Username
sshPassword SSH Password
sshKey SSK Key
osType A Map containing the id of the OS Type. This can also be passed as a string (code or name) instead.
visibility “private” private or public
accounts Array of tenant account ids that are allowed access.
isAutoJoinDomain false Auto Join Domain?
virtioSupported true VirtIO Drivers Loaded?
vmToolsInstalled true VM Tools Installed?
isForceCustomization false Force Guest Customization?
trialVersion false Trial Version
isSysprep false Sysprep Enabled?

Upload Virtual Image File

curl -XPOST "$MORPHEUS_API_URL/api/virtual-images/765/upload?filename=disk-0.vmdk" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN" \
  --data-binary '@/path/to/file'

The above command returns JSON structure like this:

{
  "success": true
}

This will upload the file and associate it to the Virtual Image.

HTTP Request

POST https://api.gomorpheus.com/api/virtual-images/:id/upload

URL Parameters

Parameter Description
id The ID of the virtual image

Query Parameters

Parameter Description
url Download the file from a remote url. This can be used instead of uploading a local file.
filename Specify a filename for new file.

Remove Virtual Image File

curl -XDELETE "$MORPHEUS_API_URL/api/virtual-images/765/files?filename=testimage.ovf" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structure like this:

{
  "success": true
}

HTTP Request

DELETE https://api.gomorpheus.com/api/virtual-images/:id/files?filename=

URL Parameters

Parameter Description
id The ID of the virtual image

Query Parameters

Parameter Default Description
filename The name of the file to be deleted

Delete a Virtual Image

curl -XDELETE "$MORPHEUS_API_URL/api/virtual-images/765" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structure like this:

{
  "success": true
}

Will delete a virtual image and any associated files.

HTTP Request

DELETE https://api.gomorpheus.com/api/virtual-images/:id

Library

The Library API endpoints provide the management of Instance Types, Layouts, and Container Types.

In the meantime, Morpheus CLI can be used to explore these resources.

    morpheus library-file-templates
    morpheus library-instance-types
    morpheus library-layouts
    morpheus library-node-types
    morpheus library-option-lists
    morpheus library-option-types
    morpheus library-scripts
    morpheus library-upgrades

Option Types

Morpheus has several objects that have dynamic models depending on the type of the object. This includes options when provisioning different instances or even options when defining tasks or creating docker hosts!. This section aims to describe what is contained in the option-types association as well as how to query morpheus for available options in certain option-type scenarios.

Example of an Option Type Record

{
    "optionTypes": [
                {
                    "name": "subnet",
                    "description": null,
                    "fieldName": "subnetId",
                    "fieldLabel": "Subnet",
                    "fieldContext": "config",
                    "fieldAddOn": null,
                    "placeHolder": null,
                    "helpBlock": "",
                    "defaultValue": null,
                    "optionSource": "amazonSubnet",
                    "type": "select",
                    "advanced": false,
                    "required": true,
                    "editable": false,
                    "config": [],
                    "displayOrder": 100
                },
                {
                    "name": "security group",
                    "description": null,
                    "fieldName": "securityId",
                    "fieldLabel": "Security Group",
                    "fieldContext": "config",
                    "fieldAddOn": null,
                    "placeHolder": null,
                    "helpBlock": "",
                    "defaultValue": null,
                    "optionSource": "amazonSecurityGroup",
                    "type": "select",
                    "advanced": false,
                    "required": true,
                    "editable": false,
                    "config": [],
                    "displayOrder": 101
                },
                {
                    "name": "public key",
                    "description": null,
                    "fieldName": "publicKeyId",
                    "fieldLabel": "Public Key",
                    "fieldContext": "config",
                    "fieldAddOn": null,
                    "placeHolder": null,
                    "helpBlock": "",
                    "defaultValue": null,
                    "optionSource": "keyPairs",
                    "type": "select",
                    "advanced": false,
                    "required": false,
                    "editable": false,
                    "config": [],
                    "displayOrder": 9
                }
            ]
}

Option types can easily represent some common input types, including text, number, radio, checkbox, and dropdown/multiple choice.

JSON Parameters

Parameter Description
name The name of the option type for handy reference
description Short description of hte option type (the CLI actually shows this when pressing ? for help)
fieldName The property key for when posting this option type to a JSON POST request
fieldLabel User friendly label for prompting a user for input
fieldContext Some properties need nested i.e. in a config: {} block. This is a . seperated context of where the property should be constructed
placeHolder Any placeholder text when nothing is yet entered
helpBlock Short help text describing the option
defaultValue The default value if no user entry is specified. This value should be passed to the desired JSON Map if nothing else is entered
optionSource Option source references an API endpoint for receiving a JSON list of available options for this field.
type The type of input. I.e. text, select, radio,checkbox, etc.
required Is this field entry required for the request
editable Used primarily on tasks and workflows. Basically wether or not the field can be overridden optionally when the object is run
displayOrder The order with which the fields should be prompted. This is rather important when using optionSource in some scenarios for determining available values.
config: Any special configuration options pertaining to specific input types, like a radio button.

Get Option Source Data

curl "$MORPHEUS_API_URL/api/options/keyPairs"
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structured like this

[
    ["name": "Davids Key Pair", "value": 1]
]

HTTP Request

GET https://api.gomorpheus.com/api/options/:optionSource

Returns a list of name/value pairs for option-type models. Some option-types depend on input data for proper representation. This typically includes zoneId or siteId for the item being provisioned as request parameters or sometimes previous option type parameters.

Deployments

Provides API’s used for creating “Deployment archives” for use with deployable instance types (i.e. Tomcat, Nginx, Apache, etc.). These endpoints also provide a means to trigger a deploy as well as to rollback from a failed deploy. There is a flow to creating a deployment archive. First you must create an appDeploy record. Then you can freely upload files to that deployment archive. Once your upload is complete it is easy to simply trigger the deploy.

Get all Deployments

curl "$MORPHEUS_API_URL/api/instances/1/deploy" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structured like this:

{
  "appDeploys": [
    {
      "config": null,
      "dateCreated": "2015-11-14T23:49:24Z",
      "deployDate": "2015-11-14T23:49:47Z",
      "deployGroup": null,
      "deployType": "browser",
      "fetchUrl": null,
      "gitRef": null,
      "gitUrl": null,
      "id": 2,
      "instanceId": 5,
      "keyPair": {
        "id": 1,
        "name": null
      },
      "lastUpdated": "2015-11-14T23:49:47Z",
      "status": "committed",
      "userVersion": null
    }
  ],
  "success": true
}

This endpoint retrieves all deploys that were created for a given instance

HTTP Request

GET https://api.gomorpheus.com/api/instances/1/deploy

Create a new Deployment

curl -XPOST "$MORPHEUS_API_URL/api/instances/1/deploy"
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"
  -H "Content-Type: application/json" \
  -d '{"appDeploy":{
    "deployType": "browser",
    "gitUrl": null,
    "fetchUrl": null,
    "gitRef": null,
    "userVersion": "1.0.0"
  }}'

The above command returns JSON structured like this:

{
  "appDeploy": {
    "deployType": "browser",
    "gitUrl": null,
    "fetchUrl": null,
    "gitRef": null,
    "userVersion": "1.0.0",
    "status": "open",
    "dateCreated": null,
    "lastUpdated": null,
    "config": null,
    "deployGroup": null,
    "userVersion": "1.0.0"
  }
}

This endpoint will create a new AppDeploy entry configured for the specific instance in the url. Depending on the deployment type you may want to upload files to the archive.

HTTP Request

POST https://api.gomorpheus.com/api/instances/:id/deploy

JSON App Deploy Parameters

Parameter Default Description
userVersion Deployment Verison userVersion identifier.
versionId Deployment Version ID. This can be passed instead of userVersion.
deployType browser The type of deployment. File based is browser, git for git and fetch for fetching from a url
gitUrl The ssh git url to use to fetch files for the archive
gitRef The branch or tag name to be used to fetch from on git.
fetchUrl Used for fetch deploy type. Can fetch a zip file or general file and extract into archive
deployGroup Not yet in use but used to organize deploys for multiple apps in the same group
configMap JSON encoded list of parameters that varies by instance type. See below for more information

Upload Files to Deployment Archive

Execution Request

Provides API interfaces for executing an arbitrary script or command on an instance, container or host.

curl -XPOST "$MORPHEUS_API_URL/api/execution-request/execute?instanceId=256" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "script": "uname -a"
}'

The above command returns JSON structured like this:

{
  "executionRequest": {
    "id": 24,
    "uniqueId": "f22e1292-4407-44c0-b2c7-698ee2241491",
    "containerId": null,
    "serverId": null,
    "instanceId": 256,
    "stdOut": null,
    "stdErr": null,
    "exitCode": null,
    "status": "pending",
    "expiresAt": "2018-11-30T18:23:01+0000",
    "createdById": 1
  }
}

HTTP Request

POST https://api.gomorpheus.com/api/execution-request/execute

Query Parameters

Parameter Default Description
instanceId Instance ID to execute request on
containerId Container ID to execute request on
serverId Host ID to execute request on

JSON Parameters

Parameter Default Description
script A script or command to be executed

This endpoint executes the provided script on the specified instance, container or server.

Get a Specific Execution Request

curl "$MORPHEUS_API_URL/api/execution-request/f22e1292-4407-44c0-b2c7-698ee2241491" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structured like this:

{
  "executionRequest": {
    "id": 24,
    "uniqueId": "f22e1292-4407-44c0-b2c7-698ee2241491",
    "containerId": null,
    "serverId": null,
    "instanceId": 256,
    "stdOut": "Linux apachetest 3.19.0-69-generic #77~14.04.1-Ubuntu SMP Tue Aug 30 01:29:21 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux\n",
    "stdErr": null,
    "exitCode": 0,
    "status": "complete",
    "expiresAt": "2018-11-30T18:23:02+0000",
    "createdById": 1
  }
}

HTTP Request

GET https://api.gomorpheus.com/api/execution-request/:uniqueId

URL Parameters

Parameter Description
uniqueId The Unique ID of the execution request

This endpoint retrieves a specific execution request.

Infrastructure

The Infrastructure API endpoints correspond to the Morpheus UI section called Infrastructure.

Groups

Groups are used to organize provisioned servers in your infrastructure. When a user on the system provisions an instance like MySQL, they can select which group to provision the instance into. This can be used to scope servers by environment or by region.

A Group may also be referred to as a Site or site.

Get All Groups

curl "$MORPHEUS_API_URL/api/groups"
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structured like this:

{
  "groups": [
    {
      "id": 1,
      "accountId": 1,
      "name": "Amazon East",
      "code": "amazon",
      "active": true,
      "location": null,
      "zones": [
        {
          "id": 1,
          "accountId": 1,
          "groupId": 1,
          "name": "VPC 1a",
          "description": "1a VPC Subnet",
          "location": null,
          "visibility": "private",
          "zoneTypeId": 1
        }
      ]
    }
  ]
}

This endpoint retrieves all groups and a list of zones associated with the group by id.

HTTP Request

GET https://api.gomorpheus.com/api/groups

Query Parameters

Parameter Default Description
lastUpdated A date filter, restricts query to only load groups updated more recent or equal to the date specified
name If specified will return an exact match group

Get a Specific Group

curl "$MORPHEUS_API_URL/api/groups/1" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structured like this:

{
  "success": true,
  "group": {
    "id": 1,
    "accountId": 1,
    "name": "Vagrant",
    "code": null,
    "active": true,
    "location": null,
    "zones": [
      {
        "id": 1,
        "accountId": 1,
        "groupId": 1,
        "name": "Davids Laptop",
        "description": "My Laptop Vagrant",
        "location": null,
        "visibility": "private",
        "zoneTypeId": 1
      }
    ]
  }
}

This endpoint retrieves a specific group.

HTTP Request

GET https://api.gomorpheus.com/api/groups/:id

URL Parameters

Parameter Description
ID The ID of the group to retrieve

Create a Group

curl -XPOST "$MORPHEUS_API_URL/api/groups" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"group":{
    "name": "My Group",
    "description": "My description",
    "location": "US EAST"
  }}'

The above command returns JSON structured like getting a single group:

HTTP Request

POST https://api.gomorpheus.com/api/groups

JSON Check Group Parameters

Parameter Default Description
name A unique name scoped to your account for the group
code Optional code for use with policies
location Optional location argument for your group

Updating a Group

curl -XPUT "$MORPHEUS_API_URL/api/groups/1" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"group":{
    "name": "My Group",
    "location": "US EAST"
  }}'

The above command returns JSON structured like getting a single group:

HTTP Request

PUT https://api.gomorpheus.com/api/groups/:id

JSON Check Group Parameters

Parameter Default Description
name A unique name scoped to your account for the group
code Optional code for use with policies
location Optional location for your group

Updating Group Zones

curl -XPUT "$MORPHEUS_API_URL/api/groups/1/update-zones" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"group":{
    "zones": [
      {"id": 1}, {"id": 2}, {"id": 5}
    ]
  }}'

The above command returns JSON Structured like this:

{
  "success": true
}

This will update the zones that are assigned to the group. Any zones that are not passed in the zones parameter will be removed from the group.

HTTP Request

PUT https://api.gomorpheus.com/api/groups/:id/update-zones

JSON Update Group Zones Parameters

Parameter Default Description
zones An array of all the zones assigned to this group.

Delete a Group

curl -XDELETE "$MORPHEUS_API_URL/api/groups/1" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON Structured like this:

{
  "success": true
}

If a group has zones or servers still tied to it, a delete action will fail

HTTP Request

DELETE https://api.gomorpheus.com/api/groups/:id

Clouds

Clouds are a means of zoning various servers based on provisioning type or subnets. Typically an instance or host belongs to a cloud. The cloud holds the credentials necessary to provision virtual machines on the cloud provider’s api. Cloud provider types include: Openstack, Amazon AWS, Nutanix, VMWare vCenter, etc. Of course, we also have the Standard cloud type which allows for manual vm procurement.

A Cloud may also be referred to as a Zone or zone.

Get All Clouds

curl "$MORPHEUS_API_URL/api/zones"
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structured like this:

{
  "zones": [
    {
      "id": 1,
      "accountId": 1,
      "groupId": 1,
      "name": "Davids Laptop",
      "description": "My Laptop Vagrant",
      "location": null,
      "visibility": "public",
      "zoneTypeId": 1
    }
  ]
}

This endpoint retrieves all zones and a list of zones associated with the zone by id.

HTTP Request

GET https://api.gomorpheus.com/api/zones

Query Parameters

Parameter Default Description
lastUpdated A date filter, restricts query to only load zones updated more recent or equal to the date specified
name If specified will return an exact match zone
type If specified will return all zones by type code (standard,openstack,amazon)
groupId If specified will return all zones assigned to a server group by id.

Get a Specific Cloud

curl "$MORPHEUS_API_URL/api/zones/1" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structured like this:

{
  "success": true,
  "zone": {
    "id": 1,
    "accountId": 1,
    "groupId": 1,
    "name": "Davids Laptop",
    "description": "My Laptop Vagrant",
    "location": null,
    "visibility": "public",
    "zoneTypeId": 1
  }
}

This endpoint retrieves a specific zone.

HTTP Request

GET https://api.gomorpheus.com/api/zones/:id

URL Parameters

Parameter Description
ID The ID of the zone to retrieve

Create a Cloud

curl -XPOST "$MORPHEUS_API_URL/api/zones" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"zone":{
    "name": "My Cloud",
    "code": "mycloud",
    "description": "My description",
    "location": "US EAST",
    "zoneType": {"code": "standard"},
    "groupId": 1
  }}'

The above command returns JSON structured like getting a single cloud:

HTTP Request

POST https://api.gomorpheus.com/api/zones

JSON Cloud Parameters

Parameter Default Description
name A unique name scoped to your account for the cloud
description Optional description field if you want to put more info there
code Optional code for use with policies
location Optional location for your cloud
visibility private private or public
zoneType “standard” Map containing code or id of the cloud type
groupId Specifies which Server group this cloud should be assigned to
accountId Specifies which Tenant this cloud should be assigned to

Additional config properties are dynamic and depend on the specified type of cloud. See Cloud Types.

Updating a Cloud

curl -XPUT "$MORPHEUS_API_URL/api/zones/1" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"zone":{
    "name": "My Cloud",
    "description": "My description",
    "location": "US EAST",
    "zoneType": {"code": "standard"},
    "groupId": 1,
    "config": null
  }}'

The above command returns JSON structured like getting a single zone:

HTTP Request

PUT https://api.gomorpheus.com/api/zones/:id

JSON Cloud Parameters

Parameter Default Description
name A unique name scoped to your account for the zone
description Optional description field if you want to put more info there
code Optional code for use with policies
location Optional location for your zone
visibility private private or public
accountId Specifies which Tenant this zone should be assigned to
config For non standard zone types, this is a json encoded string with config properties for openstack and Amazon. See the section on specific zone types for details.

Additional config properties are dynamic and depend on the type of cloud. See Cloud Types.

Delete a Cloud

curl -XDELETE "$MORPHEUS_API_URL/api/zones/1" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON Structured like this:

{
  "success": true
}

If a zone has zones or servers still tied to it, a delete action will fail

HTTP Request

DELETE https://api.gomorpheus.com/api/zones/:id

Get Security Groups

curl -XGET "https://api.gomorpheus.com/api/zones/1/security-groups" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structure like this:

{
  "success": true,
  "firewallEnabled": true,
  "securityGroups": [
    {
      "id": 19,
      "accountId": 1,
      "name": "All Tomcat Access",
      "description": "Allow everyone to access Tomcat"
    }
  ]
}

This returns a list of all of the security groups applied to a zone and whether the firewall is enabled.

HTTP Request

GET https://api.gomorpheus.com/api/zones/:id/security-groups

Set Security Groups

curl -XPOST "$MORPHEUS_API_URL/api/zones/1/security-groups" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ "securityGroupIds": [19, 2] }'

The above command returns JSON structure similar to the ‘get’ of security groups.

HTTP Request

POST https://api.gomorpheus.com/api/zones/:id/security-groups

JSON Parameters

Parameter Default Description
securityGroupIds List of all security groups ids which should be applied. If no security groups should apply, pass ’[]’

Cloud Types

Fetch a paginated list of available cloud types. This returns the configuration options for each type.

curl "$MORPHEUS_API_URL/api/zone-types"
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structured like this

{
  "zoneTypes": [
    {
      "id": 3,
      "name": "Amazon",
      "code": "amazon",
      "description": "amazon zone",
      "serverTypes": [],
      "optionTypes": []
    },
    {
      "id": 2,
      "name": "Openstack",
      "code": "openstack",
      "description": "openstac zone",
      "serverTypes": [],
      "optionTypes": []
    },
    {
      "id": 1,
      "name": "Standard",
      "code": "standard",
      "description": "Standard zone - manually managed servers or virtual machines"
      "serverTypes": [],
      "optionTypes": []
    }
  ]
}

HTTP Request

GET https://api.gomorpheus.com/api/zone-types

Query Parameters

Parameter Default Description
max Max number of results to return. Default is all (no limit).
offset 0 Offset of records you want to load
sort displayOrder Sort order
direction asc Sort direction, use ‘desc’ to reverse sort
name Filter by name or code
code Filter by code
phrase Filter by wildcard search of name, code and description
provisionType Filter by Provision Type code

Get Specific Cloud Type

curl "$MORPHEUS_API_URL/api/zone-types/1"
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structured like this

{
  "success": true,
  "zoneType": {
    "id": 1,
    "name": "Standard",
    "code": "standard",
    "description": "Standard zone - manually managed servers or virtual machines"
    serverTypes: [],
    optionTypes: []
  }
}

HTTP Request

GET https://api.gomorpheus.com/api/zone-types/:id

Data Stores

Data Stores can be managed for each Compute Zone (Cloud) in your infrastructure.

curl "$MORPHEUS_API_URL/api/zones/5/data-stores"
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structured like this:

{
  "datastores": [
    {
      "id": 50,
      "name": "datastore1",
      "zone": {
        "id": 34,
        "name": "test-vmware"
      },
      "type": "generic",
      "freeSpace": 421317836800,
      "online": false,
      "active": false,
      "visibility": "private",
      "tenants": [
        {
          "id": 1,
          "name": "root"
        }
      ]
    }
  ],
  "meta": {
    "size": 7,
    "total": 7,
    "max": 25,
    "offset": 0
  }
}

This endpoint retrieves all data stores under a cloud.

HTTP Request

GET https://api.gomorpheus.com/api/zones/:zoneId/data-stores

URL Parameters

Parameter Description
zoneId The ID of the cloud

Query Parameters

Parameter Default Description
phrase Filter on partial match of name
name Filter on exact match of name

Get a Specific Data Store

curl "$MORPHEUS_API_URL/api/zones/5/data-stores/50" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structured like this:

{
  "datastore": {
    "id": 50,
    "name": "datastore1",
    "zone": {
      "id": 34,
      "name": "test-vmware"
    },
    "type": "generic",
    "freeSpace": 421317836800,
    "online": true,
    "active": true,
    "visibility": "private",
    "tenants": [
      {
        "id": 1,
        "name": "root"
      }
    ],
    "resourcePermission": {
      "all": false,
      "sites": [
        {
          "id": 1,
          "name": "group1"
        },
        {
          "id": 2,
          "name": "group2"
        },
      ]
    }
  }
}

This endpoint retrieves a specific data store.

HTTP Request

GET https://api.gomorpheus.com/api/zones/:zoneId/data-stores/:id

URL Parameters

Parameter Description
zoneId The ID of the cloud
id The ID of the data store to retrieve

Updating a Data Store

curl -XPUT "$MORPHEUS_API_URL/api/zones/5/data-stores/50" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"datastore":{
    "active": true,
    "visibility": "private",
    "tenantPermissions": {
      "accounts": [1,2,3,4,5]
    },
    "resourcePermissions": {
      "all": false,
      "sites": [
        {"id": 1}, {"id": 2}, {"id": 3}
      ]
    }
  }}'

The above command returns JSON structured like getting a single data store:

This endpoint allows updating settings for a data store.

HTTP Request

PUT https://api.gomorpheus.com/api/zones/:zoneId/data-stores/:id

URL Parameters

Parameter Description
zoneId The ID of the cloud
id The ID of the data store

JSON Parameters

Parameter Default Description
active Activate (true) or disable (false) the datastore
visibility private private or public
tenantPermissions.accounts Array of tenant account ids that are allowed access
resourcePermissions.all Pass true to allow access all groups
resourcePermissions.sites Array of groups that are allowed access

Resource Pools

Resource Pools can be managed for each Compute Zone (Cloud) in your infrastructure.

curl "$MORPHEUS_API_URL/api/zones/5/resource-pools"
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structured like this:

{
  "resourcePools": [
    {
      "id": 89,
      "name": "labs",
      "description": "labs - vpc-231b2e3c - 10.50.0.0/16",
      "zone": {
        "id": 8,
        "name": "labs-aws"
      },
      "parent": null,
      "type": "vpc",
      "externalId": "vpc-231b2e3c",
      "iacId": null,
      "visibility": "private",
      "readOnly": false,
      "defaultPool": false,
      "active": true,
      "status": "available",
      "config": {
        "cidrBlock": "10.50.0.0/16",
        "tenancy": "default"
      },
      "tenants": [
        {
          "id": 1,
          "name": "root"
        }
      ],
      "resourcePermission": {
        "all": true,
        "sites": [

        ],
        "allPlans": true,
        "plans": [

        ]
      },
      "depth": 0
    }
  ],
  "meta": {
    "size": 1,
    "total": 1,
    "max": 25,
    "offset": 0
  }
}

This endpoint retrieves all resource pools under a cloud.

HTTP Request

GET https://api.gomorpheus.com/api/zones/:zoneId/resource-pools

URL Parameters

Parameter Description
zoneId The ID of the cloud

Query Parameters

Parameter Default Description
phrase Filter on partial match of name
name Filter on exact match of name

Get a Specific Resource Pool

curl "$MORPHEUS_API_URL/api/zones/5/resource-pools/50" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structured like this:

{
  "resourcePool": {
    "id": 89,
    "name": "labs",
    "description": "labs - vpc-231b2e3c - 10.50.0.0/16",
    "zone": {
      "id": 8,
      "name": "labs-aws"
    },
    "parent": null,
    "type": "vpc",
    "externalId": "vpc-231b2e3c",
    "iacId": null,
    "visibility": "private",
    "readOnly": false,
    "defaultPool": false,
    "active": true,
    "status": "available",
    "config": {
      "cidrBlock": "10.50.0.0/16",
      "tenancy": "default"
    },
    "tenants": [
      {
        "id": 1,
        "name": "root"
      }
    ],
    "resourcePermission": {
      "all": true,
      "sites": [

      ],
      "allPlans": true,
      "plans": [

      ]
    },
    "depth": 0
  }
}

This endpoint retrieves a specific resource pool.

HTTP Request

GET https://api.gomorpheus.com/api/zones/:zoneId/resource-pools/:id

URL Parameters

Parameter Description
zoneId The ID of the cloud
id The ID of the resource pool to retrieve

Create a Resource Pool

curl -XPOST "$MORPHEUS_API_URL/api/zones/5/resource-pools" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"resourcePool": {
    "name": "mypool",
    "config": {
      "cidrBlock": "10.20.254.0/28",
      "tenancy": "default"
    },
    "tenantPermissions": {
      "accounts": [1,2,3,4,5]
    },
    "resourcePermissions": {
      "all": false,
      "sites": [
        {"id": 1}, {"id": 2}, {"id": 3}
      ]
    }
  }}'

The above command returns JSON structured like getting a single resource pool:

This endpoint allows updating settings for a resource pool. Only certain types of clouds support creating and deleting resource pools. Configuration options vary by type.

HTTP Request

POST https://api.gomorpheus.com/api/zones/:zoneId/resource-pools

URL Parameters

Parameter Description
zoneId The ID of the cloud

JSON Parameters

Parameter Default Description
name Name
defaultPool false Set as the Default Pool
defaultImage false Set as the Default Image Target
active true Activate (true) or disable (false) the resource pool
visibility private private or public
tenantPermissions.accounts Array of tenant account ids that are allowed access
resourcePermissions.all true Pass true to allow access all groups
resourcePermissions.sites Array of groups that are allowed access
resourcePermissions.allPlans true Pass true to allow access all plans
resourcePermissions.plans Array of plans that are allowed access

JSON Parameters for Amazon Resource Pool

Parameter Default Description
config.cidrBlock Provide the base CIDR Block to use for this VPC (must be between a /16 and /28 Block)
config.tenancy default default or dedicated

JSON Parameters for Cloud Foundry

Parameter Default Description
config.managers [] Array of manager usernames
config.developers [] Array of developer usernames
config.auditors [] Array of auditor usernames

Updating a Resource Pool

curl -XPUT "$MORPHEUS_API_URL/api/zones/5/resource-pools/50" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"resourcePool":{
    "active": true,
    "visibility": "private",
    "tenantPermissions": {
      "accounts": [1,2,3,4,5]
    },
    "resourcePermissions": {
      "all": false,
      "sites": [
        {"id": 1}, {"id": 2}, {"id": 3}
      ]
    }
  }}'

The above command returns JSON structured like getting a single resource pool:

This endpoint allows updating settings for a resource pool.

HTTP Request

PUT https://api.gomorpheus.com/api/zones/:zoneId/resource-pools/:id

URL Parameters

Parameter Description
zoneId The ID of the cloud
id The ID of the resource pool

JSON Parameters

Parameter Default Description
active Activate (true) or disable (false) the resource pool
visibility private private or public
tenantPermissions.accounts Array of tenant account ids that are allowed access
resourcePermissions.all Pass true to allow access all groups
resourcePermissions.sites Array of groups that are allowed access
resourcePermissions.allPlans Pass true to allow access all plans
resourcePermissions.plans Array of plans that are allowed access

Delete a Resource Pool

curl -XDELETE "$MORPHEUS_API_URL/api/zones/5/resource-pools/50" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structure like this:

{
  "success": true
}

HTTP Request

DELETE https://api.gomorpheus.com/api/zones/:zoneId/resource-pools/:id

URL Parameters

Parameter Description
zoneId The ID of the cloud
id The ID of the resource pool

Resource Folders

Resource Folders can be managed for each Compute Zone (Cloud) in your infrastructure.

curl "$MORPHEUS_API_URL/api/zones/5/folders"
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structured like this:

{
  "folders": [
    {
      "id": 50,
      "name": "My Folder",
      "zone": {
        "id": 5,
        "name": "test-vmware"
      },
      "parent": null,
      "type": "default",
      "externalId": "group-v2342",
      "visibility": "private",
      "readOnly": false,
      "defaultFolder": false,
      "defaultStore": false,
      "active": true,
      "tenants": [
        {
          "id": 1,
          "name": "root",
          "defaultStore": false,
          "defaultTarget": false
        }
      ],
      "resourcePermission": {
        "all": true,
        "sites": [

        ],
        "allPlans": true,
        "plans": [

        ]
      },
      "depth": 0
    }
  ],
  "meta": {
    "size": 1,
    "total": 30,
    "offset": 0,
    "max": 25
  }
}

This endpoint retrieves all resource folders under a cloud.

HTTP Request

GET https://api.gomorpheus.com/api/zones/:zoneId/folders

URL Parameters

Parameter Description
zoneId The ID of the cloud

Query Parameters

Parameter Default Description
phrase Filter on partial match of name
name Filter on exact match of name

Get a Specific Resource Folder

curl "$MORPHEUS_API_URL/api/zones/5/folders/50" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structured like this:

{
  "folder": {
    "id": 50,
    "name": "My Folder",
    "zone": {
      "id": 5,
      "name": "test-vmware"
    },
    "parent": null,
    "type": "default",
    "externalId": "group-v2342",
    "visibility": "private",
    "readOnly": false,
    "defaultFolder": false,
    "defaultStore": false,
    "active": true,
    "tenants": [
      {
        "id": 1,
        "name": "root",
        "defaultStore": false,
        "defaultTarget": false
      }
    ],
    "resourcePermission": {
      "all": true,
      "sites": [

      ],
      "allPlans": true,
      "plans": [

      ]
    }
  }
}

This endpoint retrieves a specific resource folder.

HTTP Request

GET https://api.gomorpheus.com/api/zones/:zoneId/folders/:id

URL Parameters

Parameter Description
zoneId The ID of the cloud
id The ID of the resource folder to retrieve

Updating a Resource Folder

curl -XPUT "$MORPHEUS_API_URL/api/zones/5/folders/50" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"folder":{
    "active": true,
    "visibility": "private",
    "tenantPermissions": {
      "accounts": [1]
    },
    "resourcePermissions": {
      "all": false,
      "sites": [
        {"id": 1}, {"id": 2}, {"id": 3}
      ]
    }
  }}'

The above command returns JSON structured like getting a single resource folder:

This endpoint allows updating settings for a resource folder.

HTTP Request

PUT https://api.gomorpheus.com/api/zones/:zoneId/folders/:id

URL Parameters

Parameter Description
zoneId The ID of the cloud
id The ID of the resource folder

JSON Parameters

Parameter Default Description
defaultFolder false Set as the Default Folder
defaultImage false Set as the Default Image Target
active Activate (true) or disable (false) the resource folder
visibility private private or public
tenantPermissions.accounts Array of tenant account ids that are allowed access
resourcePermissions.all Pass true to allow access all groups
resourcePermissions.sites Array of groups that are allowed access
resourcePermissions.allPlans Pass true to allow access all plans
resourcePermissions.plans Array of plans that are allowed access

Clusters

Clusters is for creating and managing Kubernetes Clusters, Morpheus managed Docker Clusters, KVM Clusters, or Cloud specific Kubernetes services such as EKS. The Triforce Cluster is a combination Kubernetes, KVM and Functions* Cluster, with all nodes supporting all three provision types.

A Cluster may also be referred to as an Server Group or serverGroup.

Get All Clusters

curl "$MORPHEUS_API_URL/api/clusters" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structured like this:

{
    "clusters": [
        {
            "id": 1,
            "name": "cluster-1",
            "code": null,
            "category": null,
            "visibility": "public",
            "description": null,
            "location": null,
            "enabled": false,
            "serviceUrl": null,
            "serviceHost": null,
            "servicePath": null,
            "serviceHostname": null,
            "servicePort": 22,
            "serviceUsername": null,
            "servicePassword": null,
            "serviceToken": null,
            "serviceAccess": null,
            "serviceCert": null,
            "serviceConfig": null,
            "serviceVersion": null,
            "searchDomains": null,
            "enableInternalDns": false,
            "internalId": null,
            "externalId": null,
            "datacenterId": null,
            "status": "provisioning",
            "statusDate": "2019-08-14T04:42:22+0000",
            "statusMessage": null,
            "inventoryLevel": "full",
            "lastSync": "2019-08-09T23:32:04+0000",
            "nextRunDate": "2019-08-14T04:47:22+0000",
            "lastSyncDuration": 138,
            "dateCreated": "2019-07-29T20:34:27+0000",
            "lastUpdated": "2019-08-14T04:42:22+0000",
            "serviceEntry": null,
            "createdBy": {
                "id": 1,
                "username": "root"
            },
            "userGroup": null,
            "layout": {
                "id": 3,
                "name": "Amazon Docker Host",
                "provisionTypeCode": "amazon"
            },
            "owner": {
                "id": 1,
                "name": "Stubby Toes Inc."
            },
            "servers": [
                {
                    "id": 1,
                    "name": "cluster-1",
                    "typeSet": {
                        "id": 5,
                        "code": "kubernetes-amazon-ubuntu-16.04-set",
                        "name": "kubernetes master"
                    },
                    "computeServerType": {
                        "id": 99,
                        "code": "amazonLinux",
                        "nodeType": "morpheus-node"
                    }
                }
            ],
            "accounts": [

            ],
            "integrations": [

            ],
            "site": {
                "id": 2,
                "name": "stubby toes aws group"
            },
            "type": {
                "id": 2,
                "name": "Docker Cluster"
            },
            "zone": {
                "id": 3,
                "name": "stubby toes aws cloud",
                "zoneType": {
                    "id": 12
                }
            },
            "config": null,
            "workers": [
                {
                    "id": 7,
                    "name": "cluster-1",
                    "status": "provisioning",
                    "powerState": "on"
                }
            ],
            "workerCount": 1,
            "workerStats": {
                "usedStorage": 0,
                "maxStorage": 21474836480,
                "usedMemory": 0,
                "maxMemory": 536870912,
                "usedCpu": 0.0,
                "cpuUsage": 0.0,
                "cpuUsagePeak": 0.0,
                "cpuUsageAvg": 0.0
            }
        }
    ],
    "meta": {
        "size": 5,
        "total": 5,
        "max": 25,
        "offset": 0
    }
}

This endpoint retrieves all clusters and a list of clusters associated with the zone by id.

HTTP Request

GET https://api.gomorpheus.com/api/clusters

Query Parameters

Parameter Default Description
max 25 Max number of results to return
offset 0 Offset of records you want to load
sort name Sort order
direction asc Sort direction, use ‘desc’ to reverse sort
phrase Name or serviceUrl filter, restricts query to only load clusters which contain the phrase specified
name Name filter, restricts query to only load clusters matching the name specified
zoneId Zone filter, restricts query to only load clusters of a specified zone
typeId Type filter, restricts query to only load clusters of a specified cluster type

Get a Specific Cluster

curl "$MORPHEUS_API_URL/api/clusters/1" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structured like this:

{
    "cluster": {
        "id": 3,
        "name": "kubernetes-cluster",
        "code": null,
        "category": null,
        "visibility": "public",
        "description": null,
        "location": null,
        "enabled": false,
        "serviceUrl": null,
        "serviceHost": null,
        "servicePath": null,
        "serviceHostname": null,
        "servicePort": 22,
        "serviceUsername": null,
        "servicePassword": null,
        "serviceToken": null,
        "serviceAccess": null,
        "serviceCert": null,
        "serviceConfig": null,
        "serviceVersion": null,
        "searchDomains": null,
        "enableInternalDns": false,
        "apiKey": "2006d897-664b-427a-a4eb-f0b23285a54a",
        "internalId": null,
        "externalId": null,
        "datacenterId": null,
        "status": "provisioning",
        "statusDate": "2019-07-29T23:44:34+0000",
        "statusMessage": null,
        "inventoryLevel": "full",
        "lastSync": null,
        "nextRunDate": "2019-08-14T04:47:22+0000",
        "lastSyncDuration": null,
        "dateCreated": "2019-07-29T23:40:56+0000",
        "lastUpdated": "2019-08-14T04:43:54+0000",
        "serviceEntry": null,
        "createdBy": {
            "id": 1,
            "username": "root"
        },
        "userGroup": null,
        "layout": {
            "id": 4,
            "name": "Kubernetes 1.14 Cluster on Ubuntu 16.04, Weave, OpenEBS",
            "provisionTypeCode": "amazon"
        },
        "owner": {
            "id": 1,
            "name": "Stubby Toes Inc."
        },
        "servers": [
            {
                "id": 14,
                "name": "kube1-worker-2",
                "computeServerType": {
                    "id": 192,
                    "code": "amazonKubeWorker",
                    "nodeType": "kube-worker"
                }
            },
            {
                "id": 12,
                "name": "kube1-master",
                "computeServerType": {
                    "id": 191,
                    "code": "amazonKubeMaster",
                    "nodeType": "kube-master"
                }
            },
            {
                "id": 13,
                "name": "kube1-worker-1",
                "computeServerType": {
                    "id": 192,
                    "code": "amazonKubeWorker",
                    "nodeType": "kube-worker"
                }
            },
            {
                "id": 15,
                "name": "kube1-worker-3",
                "computeServerType": {
                    "id": 192,
                    "code": "amazonKubeWorker",
                    "nodeType": "kube-worker"
                }
            }
        ],
        "accounts": [

        ],
        "integrations": [

        ],
        "site": {
            "id": 2,
            "name": "aws group"
        },
        "type": {
            "id": 1,
            "name": "Kubernetes Cluster"
        },
        "zone": {
            "id": 3,
            "name": "aws cloud",
            "zoneType": {
                "id": 12
            }
        },
        "config": "{\"initConfig\":\"\"}",
        "workerStats": {
            "usedStorage": 0,
            "maxStorage": 53687091200,
            "usedMemory": 0,
            "maxMemory": 2147483648,
            "usedCpu": 0.0,
            "cpuUsage": 0.0,
            "cpuUsagePeak": 0.0,
            "cpuUsageAvg": 0.0
        },
        "containersCount": 35,
        "servicesCount": 1,
        "deploymentsCount": 1,
        "podsCount": 33,
        "jobsCount": 1,
        "volumesCount": 2,
        "namespacesCount": 1,
        "workersCount": 4,
        "permissions": {
            "resourcePool": {
                "id": 12,
                "visibility": "public"
            },
            "resourcePermissions": {
                "allGroups": true,
                "defaultStore": false,
                "allPlans": false,
                "defaultTarget": false,
                "morpheusResourceType": "ComputeZonePool",
                "morpheusResourceId": 12,
                "canManage": false,
                "all": true,
                "account": {
                    "id": 1
                },
                "sites": [
                    {
                        "id": 2,
                        "name": "dans aws group",
                        "default": true
                    }
                ],
                "plans": [
                    {
                        "id": 88,
                        "name": "128MB Memory, 1GB Storage",
                        "default": false
                    }
                ]
            }
        }
    }
}

This endpoint retrieves a specific cluster.

HTTP Request

GET https://api.gomorpheus.com/api/clusters/:id

URL Parameters

Parameter Description
ID ID of the cluster

Create a Cluster

curl -XPOST "$MORPHEUS_API_URL/api/clusters" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"cluster": {
        "type": "docker-cluster",
        "name": "stubby toes docker cluster",
        "description": "cluster description",
        "group": {"id": 2},
        "cloud": {"id": 3},
        "layout": "docker-amazon-ubuntu-16.04-single",
        "server": {
            "config": {
                "resourcePool": "vpc-d673ebb3",
                "publicIpType": "subnet",
                "createUser": false
            },
            "name": "tippytoes",
            "plan": {
                "code": "amazon-t2.nano",
                "options": {
                    "maxMemory": 536870912,
                    "cpuCount": 1,
                    "coreCount": 1,
                    "coresPerSocket": 1
                }
            },
            "volumes": [
                {
                    "id": -1,
                    "rootVolume": true,
                    "name": "root",
                    "size": 10,
                    "sizeId": null,
                    "storageType": 10,
                    "datastoreId": null
                }
            ],
            "networkInterfaces": [
                {
                    "network": {
                        "id": "network-20"
                    }
                }
            ],
            "securityGroups": [
                "sg-052d3dacc2b663fdd"
            ],
            "visibility": "private",
            "userGroup": {
                "id": 1
            },
            "networkDomain": null,
            "hostname": null
        }
    }}'

The above command returns a similar JSON structure when submitting a GET request for a single check

HTTP Request

POST https://api.gomorpheus.com/api/clusters

JSON Parameters

Parameter Required Default Description
type Y n/a Type of cluster to be created
name Y n/a Name of the cluster to be created
description N Description of the cluster to be created
group.id Y n/a The Group ID to provision the cluster into
cloud.id Y n/a The Cloud ID to provision the host into
layout.id Y n/a The Layout ID for the host type(s) that will be provisioned for the cluster
server Y n/a Key for server configuration, see Server

Server

The server parameter is for server host configuration that are specific to each Provision Type. The Provision Types api can be used to see which options are available.

Parameter Required Default Description
config Y Key for specific host type configuration, see Config
name Y n/a Name to be used for host(s) created in the cluster
plan.id Y The id for the memory and storage option pre-configured within Morpheus.
plan.options N Map of custom options depending on selected service plan . An example would be maxMemory, or maxCores.
volumes N Key for volume configuration, see Volumes
networkInterfaces N Key for network configuration, see Network Interfaces
securityGroups N Key for security group configuration. It should be passed as an array of objects containing the id of the security group to assign the host to
visibility N private Visibility for server host
userGroup.id N User Group ID for server host
hostname N Hostname for server host

Volumes

The (optional) volumes parameter is for LV configuration, can create additional LVs at provision It should be passed as an array of Objects with the following attributes:

Parameter Required Default Description
id N -1 The id for the LV configuration being created
rootVolume N true If set to false then a non-root LV will be created
name Y root Name/type of the LV being created
size N [from service plan] Size of the LV to be created in GBs
sizeId N Can be used to select pre-existing LV choices from Morpheus
storageType N Identifier for LV type
datastoreId Y The ID of the specific datastore. Auto selection can be specified as auto or autoCluster (for clusters).

Network Interfaces

The networkInterfaces parameter is for network configuration.

The Options API /api/options/zoneNetworkOptions?zoneId=5&provisionTypeId=10 can be used to see which options are available.

It should be passed as an array of Objects with the following attributes:

Parameter Required Default Description
network.id Y n/a id of the network to be used. A network group can be specified instead by prefixing its ID with networkGroup-.
networkInterfaceTypeId Y n/a The id of type of the network interface.
ipAddress Y n/a The ip address. Not applicable when using DHCP or IP Pools.

Config

The config parameter is for configuration options that are specific to each Provision Type. The Provision Types api can be used to see which options are available.

Update Cluster

curl -XPUT "$MORPHEUS_API_URL/api/clusters/1" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"cluster": {
       "name": "Cluster Name",
       "description": "Cluster Description",
       "enabled": true,
       "serviceUrl": "https://api-endpoint.com",
       "refresh": true
      }}' 

The above command returns a similar JSON structure when submitting a GET request for a single cluster

HTTP Request

PUT https://api.gomorpheus.com/api/clusters/:id

URL Parameters

Parameter Description
id The ID of the cluster

JSON Cluster Parameters

Parameter Default Description
name Cluster name
description Cluster description
enabled Cluster enabled
serviceUrl Cluster API Url
refresh Queue cluster refresh

Update Cluster Permissions

curl -XPUT "$MORPHEUS_API_URL/api/clusters/1/permissions" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"permissions": {
       "resourcePermissions": {
         "all": true,
         "sites": [{"id": 1, "default": true}],
         "allPlans": true,
         "plans": [{"id": 1, "default": false}]
       }
      }}' 

The above command returns a similar JSON structure when submitting a GET request for a single cluster

HTTP Request

PUT https://api.gomorpheus.com/api/clusters/:id/permissions

URL Parameters

Parameter Description
id The ID of the cluster

JSON Cluster Parameters

Parameter Required Default Description
permissions Y n/a Key for server configuration, see Permissions

Permissions

The permissions parameter is for permissions for clusters and namespaces.

Parameter Default Description
resourcePool.visibility Applicable to clusters only
resourcePermissions.all Pass true to allow access to all groups
resourcePermissions.sites Array of groups that are allowed access
resourcePermissions.allPlans Pass true to allow access to all plans
resourcePermissions.plans Array of plans that are allowed access
tenantPermissions.accounts Array of tenant account ids that are allowed access

Delete a Cluster

curl -XDELETE "$MORPHEUS_API_URL/api/clusters/1" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structure like this:

{
  "success": true
}

Will delete a cluster and associated resources, hosts, volumes asynchronously

HTTP Request

DELETE https://api.gomorpheus.com/api/clusters/:id

Query Parameters

Parameter Default Description
removeResources on Remove Infrastructure.
removeInstances off Remove Associated Hosts
preserveVolumes off Preserve Volumes
releaseEIPs on Release EIPs
force off Force Delete

Get API Config

curl "$MORPHEUS_API_URL/api/clusters/1/api-config" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN" \
  -H "Content-Type: application/json" 

The above comand returns JSON structure like this:

{
  "serviceUrl": null,
  "serviceHost": null,
  "servicePath": null,
  "serviceHostname": null,
  "servicePort": 22,
  "serviceUsername": null,
  "servicePassword": null,
  "serviceToken": null,
  "serviceAccess": null,
  "serviceCert": null,
  "serviceConfig": null,
  "serviceVersion": null
}

This endpoint retrieves the API configuration for a specified cluster. The configuration is cluster type specific, see API Config Mappings

API Config Mappings

See below for cluster type specific mappings

Kubernetes

Config Purpose
serviceToken API Token
serviceAccess Kube Config

HTTP Request

GET https://api.gomorpheus.com/api/clusters/:id/api-config

URL Parameters

Parameter Description
id The ID of the cluster

List Namespaces (Kubernetes)

curl "$MORPHEUS_API_URL/api/clusters/:cluster_id/namespaces" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structure like this:

{
  "namespaces": [
    {
      "id": 1,
      "name": "Namespace",
      "description": "Some details about namespace",
      "regionCode": null,
      "externalId": null,
      "status": "available",
      "active": true
    }
  ],
  "meta": {
    "size": 1,
    "total": 1,
    "offset": 0,
    "max": 25
  }
}

HTTP Request

GET https://api.gomorpheus.com/api/clusters/:clusterId/namespaces

URL Parameters

Parameter Description
clusterId The ID of the cluster

Get Namespace (Kubernetes)

curl "$MORPHEUS_API_URL/api/clusters/:clusterId/namespaces/:id" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structured like this:

{
  "namespace": {
    "id": 13,
    "visibility": "public",
    "name": "My Namespace",
    "description": "new description",
    "status": "available",
    "active": true,
    "permissions": {
      "resourcePermissions": {
        "allGroups": true,
        "defaultStore": false,
        "allPlans": true,
        "defaultTarget": false,
        "morpheusResourceType": "ComputeZonePool",
        "morpheusResourceId": 13,
        "canManage": false,
        "all": true,
        "account": {
          "id": 1
        },
        "sites": [
          {
            "id": 2,
            "name": "aws group",
            "default": false
          }
        ],
        "plans": [
          {
            "id": 88,
            "name": "128MB Memory, 1GB Storage",
            "default": true
          }
        ]
      }
    }
  }
}

This endpoint retrieves a specific namespace of a cluster

HTTP Request

GET https://api.gomorpheus.com/api/clusters/:clusterId/namespaces/:id

URL Parameters

Parameter Description
clusterId The ID of the cluster
id The ID of the namespace

Add Namespace (Kubernetes)

curl -XPOST "$MORPHEUS_API_URL/api/clusters/1/namespaces" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"namespace": {
       "name": "Namespace Name",
       "description": "Description",
       "active": true,
       "resourcePermissions": {
         "all": true,
         "allPlans": true,
         "sites": [{"id": 2,"default": true}],
         "plans": [{"id": 88,"default": false}]
       }
      }}'

The above command returns JSON structure like this:

{
  "success": true,
  "namespace": {
    "id": 1,
    "name": "Namespace Name",
    "description": "Description",
    "regionCode": null,
    "externalId": null,
    "status": "available"
  }
}

HTTP Request

POST https://api.gomorpheus.com/api/clusters/:id/namespaces

URL Parameters

Parameter Description
id The ID of the cluster

JSON Cluster Parameters

Parameter Required Default Description
name Y Namespace name
description N Namespace description
active N false Namespace active
resourcePermissions N Key for resource permission configuration, see Resource Permissions

Resource Permissions

The resourcePermissions parameter is a map for namespace group and service plan permissions.

Parameter Required Default Description
all N Pass true to allow access to all groups
sites N Array of groups that are allowed access
allPlans N Pass true to allow access to all service plans
plans N n/a Array of service plans that are allowed access

Update Namespace (Kubernetes)

curl -XPUT "$MORPHEUS_API_URL/api/clusters/1/namespaces/1" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"namespace": {
       "description": "Description",
       "active": true,
       "permissions": {
         "resourcePermissions": {
           "all": true,
           "sites": [{"id": 1, "default": true}],
           "allPlans": true,
           "plans": [{"id": 1, "default": false}]
         }
       }  
      }}'

The above command returns same JSON structure as Add Namespace

HTTP Request

PUT https://api.gomorpheus.com/api/clusters/:clusterId/namespaces/:id

URL Parameters

Parameter Description
clusterId The ID of the cluster
id The ID of the namespace

JSON Cluster Parameters

Parameter Required Default Description
description N Namespace description
active N false Namespace active
permissions N Key for resource permission configuration, see Permissions

Delete a Namespace (Kubernetes)

curl -XDELETE "$MORPHEUS_API_URL/api/clusters/1/namespaces/1" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structure like this:

{
  "success": true
}

Will delete a namespace from the specified cluster

HTTP Request

DELETE https://api.gomorpheus.com/api/clusters/:clusterId/namespaces/:id

URL Parameters

Parameter Description
clusterId The ID of the cluster
id The ID of the namespace to delete

Query Parameters

Parameter Default Description
force off Force Delete

Add Worker

curl -XPOST "$MORPHEUS_API_URL/api/clusters/:id/servers" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"server": {
        "config": {
            "resourcePool": "vpc-d673ebb3",
            "publicIpType": "subnet",
            "createUser": false
        },
        "name": "tippytoes",
        "plan": {
            "code": "amazon-t2.nano",
            "options": {
                "maxMemory": 536870912,
                "cpuCount": 1,
                "coreCount": 1,
                "coresPerSocket": 1
            }
        },
        "volumes": [
            {
                "id": -1,
                "rootVolume": true,
                "name": "root",
                "size": 10,
                "sizeId": null,
                "storageType": 10,
                "datastoreId": null
            }
        ],
        "networkInterfaces": [
            {
                "network": {
                    "id": "network-20"
                }
            }
        ],
        "securityGroups": [
            "sg-052d3dacc2b663fdd"
        ],
        "visibility": "private",
        "userGroup": {
            "id": 1
        },
        "networkDomain": null,
        "hostname": null,
        "taskSet": {
          "id": 2
        }       
    }}'

The above command returns JSON structure like this:

{
  "success": true
}

HTTP Request

POST https://api.gomorpheus.com/api/clusters/:id/servers

URL Parameters

Parameter Description
id The ID of the cluster

JSON Parameters

Parameter Description
server Key for server configuration, see Server

Get Workers

curl "$MORPHEUS_API_URL/api/clusters/:id/workers" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structured like this:

{
  "workers": [
    {
      "id": 11,
      "externalId": "i-03a65f2d1d34f4d76",
      "internalId": null,
      "accountId": 1,
      "account": {
        "name": "Stubby Toes Inc."
      },
      "name": "kube-worker-1",
      "visibility": "public",
      "description": null,
      "zoneId": 3,
      "siteId": 2,
      "sshHost": null,
      "sshPort": 22,
      "externalIp": null,
      "internalIp": "172.31.7.195",
      "volumeId": null,
      "platform": null,
      "platformVersion": null,
      "sshUsername": "root",
      "sshPassword": "****",
      "osDevice": "/dev/sda",
      "dataDevice": "/dev/sdb",
      "lvmEnabled": false,
      "apiKey": "9f91db5c-25fc-4869-9881-f65b76c4c58a",
      "softwareRaid": false,
      "dateCreated": "2019-07-29T23:41:19+0000",
      "lastUpdated": "2019-08-09T21:25:44+0000",
      "stats": {
        "usedStorage": null,
        "reservedStorage": 0,
        "maxStorage": 10737418240,
        "usedMemory": 0,
        "reservedMemory": 0,
        "maxMemory": 536870912
      },
      "status": "failed",
      "statusMessage": null,
      "errorMessage": null,
      "statusDate": null,
      "statusPercent": null,
      "statusEta": null,
      "powerState": "unknown",
      "computeServerType": {
        "id": 192,
        "code": "amazonKubeWorker",
        "name": "Amazon Kubernetes Worker",
        "managed": true,
        "externalDelete": true
      },
      "agentInstalled": false,
      "lastAgentUpdate": null,
      "agentVersion": null,
      "maxCores": 1,
      "maxMemory": 536870912,
      "maxStorage": 10737418240,
      "maxCpu": null,
      "serverOs": null,
      "enabled": true,
      "zone": {
        "id": 3,
        "name": "stubby toes aws cloud"
      },
      "plan": {
        "id": 1,
        "code": "amazon-t2.nano",
        "name": "Amazon T2 Nano - 1 Core, 0.5GB Memory"
      },
      "containers": [

      ]
    }
  ]  
}

This endpoint retrieves workers of a specified cluster.

HTTP Request

GET https://api.gomorpheus.com/api/clusters/:id/workers

URL Parameters

Parameter Description
id The ID of the cluster

Query Parameters

Parameter Default Description
phrase Name filter, restricts query to only load workers matching the name or display name

Get Masters (Kubernetes)

curl "$MORPHEUS_API_URL/api/clusters/:id/masters" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structured similar to Get Workers

This endpoint retrieves masters of a specified kubernetes cluster.

HTTP Request

GET https://api.gomorpheus.com/api/clusters/:id/masters

URL Parameters

Parameter Description
id The ID of the cluster

Query Parameters

Parameter Default Description
phrase Name filter, restricts query to only load workers matching the name or display name

Get Volumes

curl "$MORPHEUS_API_URL/api/clusters/:id/volumes" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structured like this:

{
  "volumes": [
    {
      "id": 123,
      "displayOrder": 0,
      "active": true,
      "usedStorage": 0,
      "resizeable": true,
      "online": true,
      "deviceDisplayName": "xvda",
      "name": "root",
      "externalId": "vol-076adc80392a1217a",
      "volumeType": "disk",
      "deviceName": "/dev/sda1",
      "removable": false,
      "readOnly": false,
      "zoneId": 3,
      "rootVolume": true,
      "category": "kubernetes.persistentVolumeClaim.cluster.3",
      "status": "provisioned",
      "maxStorage": 21474836480,
      "account": {
        "id": 1
      },
      "type": {
        "id": 10
      }
    }
  ],
  "meta": {
    "size": 1,
    "total": 1,
    "offset": 0,
    "max": 25
  }
}

This endpoint retrieves volumes of a specified cluster.

HTTP Request

GET https://api.gomorpheus.com/api/clusters/:id/volumes

URL Parameters

Parameter Description
id The ID of the cluster

Query Parameters

Parameter Default Description
max 25 Max number of results to return
offset 0 Offset of records you want to load
sort name Sort order
order asc Sort direction, use 'desc’ to reverse sort
phrase Name or internalId filter, restricts query to only load volumes which contain the phrase specified

Delete a Volume

curl -XDELETE "$MORPHEUS_API_URL/api/clusters/:clusterId/volumes/:id" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structure like this:

{
  "success": true
}

Will delete a volume from the specified cluster

HTTP Request

DELETE https://api.gomorpheus.com/api/clusters/:clusterId/volumes/:id

URL Parameters

Parameter Description
clusterId The ID of the cluster
id The ID of the volume to delete

Query Parameters

Parameter Default Description
force off Force Delete

Get Containers

curl "$MORPHEUS_API_URL/api/clusters/:id/containers" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structured like this:

{
  "containers": [
    {
      "id": 14,
      "uuid": "",
      "accountId": 1,
      "instance": null,
      "containerType": {
        "id": 50,
        "code": "ubuntu-14.04.03",
        "category": null,
        "name": "Ubuntu 14.04"
      },
      "containerTypeSet": {
        "id": null,
        "code": null,
        "category": null
      },
      "server": {
        "id": 20,
        "name": "cluster 2"
      },
      "cloud": {
        "id": 3,
        "name": "aws cloud"
      },
      "name": "ubuntu_14",
      "ip": "172.31.0.197",
      "internalIp": "172.31.0.197",
      "internalHostname": "container14",
      "externalHostname": "container14",
      "externalDomain": "localdomain",
      "externalFqdn": "container14.localdomain",
      "ports": [

      ],
      "plan": {
        "id": null,
        "code": null,
        "name": null
      },
      "dateCreated": null,
      "lastUpdated": "2019-10-01T13:55:23+0000",
      "statsEnabled": false,
      "status": "unknown",
      "userStatus": "stopped",
      "environmentPrefix": null,
      "stats": {
      },
      "runtimeInfo": {
      },
      "containerVersion": null,
      "repositoryImage": null,
      "planCategory": null,
      "hostname": null,
      "domainName": null,
      "volumeCreated": false,
      "containerCreated": false,
      "maxStorage": null,
      "maxMemory": null,
      "maxCores": null,
      "maxCpu": null,
      "availableActions": [

      ]
    }
  ],
  "meta": {
    "size": 1,
    "total": 1,
    "offset": 0,
    "max": 25
  }
}

This endpoint retrieves containers of a specified cluster.

HTTP Request

GET https://api.gomorpheus.com/api/clusters/:id/containers

URL Parameters

Parameter Description
id The ID of the cluster

Query Parameters

Parameter Default Description
max 25 Max number of results to return
offset 0 Offset of records you want to load
sort name Sort order
order asc Sort direction, use 'desc’ to reverse sort
phrase Name or internalId filter, restricts query to only load containers which contain the phrase specified
resourceLevel Resource level filter: app, system, storage, logging

Get Deployments

curl "$MORPHEUS_API_URL/api/clusters/:id/deployments" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structured like this:

{
  "deployments": [
    {
      "id": 4,
      "name": "test deployment display name",
      "code": "test_deployment_code",
      "description": null,
      "category": "kubernetes.deployment.cluster.3",
      "resourceLevel": "app",
      "resourceType": "deployment",
      "managed": false,
      "status": "starting",
      "lastUpdated": "2019-10-01T02:09:53+0000",
      "owner": {
        "id": 1
      },
      "totalCpuUsage": 0,
      "stats": {
      }
    }
  ],
  "meta": {
    "size": 1,
    "total": 1,
    "offset": 0,
    "max": 25
  }
}

This endpoint retrieves deployments of a specified cluster.

HTTP Request

GET https://api.gomorpheus.com/api/clusters/:id/deployments

URL Parameters

Parameter Description
id The ID of the cluster

Query Parameters

Parameter Default Description
max 25 Max number of results to return
offset 0 Offset of records you want to load
sort name Sort order
order asc Sort direction, use 'desc’ to reverse sort
phrase Name or internalId filter, restricts query to only load deployments which contain the phrase specified
resourceLevel Resource level filter: app, system, storage, logging

Get Jobs

curl "$MORPHEUS_API_URL/api/clusters/:id/jobs" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structured like this:

{
  "jobs": [
    {
      "id": 5,
      "name": "Job 1",
      "type": "morpheus.task",
      "status": null,
      "namespace": null,
      "category": "kubernetes.job.cluster.3",
      "description": null,
      "enabled": true,
      "dateCreated": "2019-09-29T19:51:37+0000",
      "lastUpdated": "2019-09-29T20:00:58+0000",
      "lastRun": null,
      "createdBy": {
        "id": 1,
        "username": "root"
      }
    }
  ],
  "meta": {
    "size": 1,
    "total": 1,
    "offset": 0,
    "max": 25
  }
}

This endpoint retrieves jobs of a specified cluster.

HTTP Request

GET https://api.gomorpheus.com/api/clusters/:id/jobs

URL Parameters

Parameter Description
id The ID of the cluster

Query Parameters

Parameter Default Description
max 25 Max number of results to return
offset 0 Offset of records you want to load
sort name Sort order
order asc Sort direction, use 'desc’ to reverse sort
phrase Name or internalId filter, restricts query to only load jobs which contain the phrase specified

Get Pods

curl "$MORPHEUS_API_URL/api/clusters/:id/pods" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structured like this:

{
  "pods": [
    {
      "id": 30,
      "name": "test pod display name",
      "code": "test_pod_code",
      "description": null,
      "category": "kubernetes.pod.cluster.3",
      "resourceLevel": null,
      "resourceType": "pod",
      "managed": false,
      "status": "unknown",
      "lastUpdated": "2019-10-01T00:29:07+0000",
      "owner": {
        "id": 1
      },
      "totalCpuUsage": 0,
      "stats": {
      }
    }
  ],
  "meta": {
    "size": 1,
    "total": 1,
    "offset": 0,
    "max": 25
  }
}

This endpoint retrieves pods of a specified cluster.

HTTP Request

GET https://api.gomorpheus.com/api/clusters/:id/pods

URL Parameters

Parameter Description
id The ID of the cluster

Query Parameters

Parameter Default Description
max 25 Max number of results to return
offset 0 Offset of records you want to load
sort name Sort order
order asc Sort direction, use 'desc’ to reverse sort
phrase Name or internalId filter, restricts query to only load pods which contain the phrase specified
resourceLevel Resource level filter: app, system, storage, logging

Get Services

curl "$MORPHEUS_API_URL/api/clusters/:id/services" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structured like this:

{
  "services": [
    {
      "id": 5,
      "name": "test service",
      "type": null,
      "code": null,
      "externalIp": null,
      "internalIp": null,
      "externalPort": null,
      "internalPort": null,
      "status": null,
      "dateCreated": null,
      "lastUpdated": null
    }
  ],
  "meta": {
    "size": 1,
    "total": 1,
    "offset": 0,
    "max": 25
  }
}

This endpoint retrieves services of a specified cluster.

HTTP Request

GET https://api.gomorpheus.com/api/clusters/:id/services

URL Parameters

Parameter Description
id The ID of the cluster

Query Parameters

Parameter Default Description
max 25 Max number of results to return
offset 0 Offset of records you want to load
sort name Sort order
order asc Sort direction, use 'desc’ to reverse sort
phrase Name or internalId filter, restricts query to only load services which contain the phrase specified

Get Stateful Sets

curl "$MORPHEUS_API_URL/api/clusters/:id/statefulsets" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structured like this:

{
  "statefulsets": [    
    {
      "id": 3,
      "name": "test statefulset display name",
      "code": "test_code",
      "description": null,
      "category": "kubernetes.statefulset.cluster.3",
      "resourceLevel": null,
      "resourceType": "statefulset",
      "managed": false,
      "status": "starting",
      "lastUpdated": "2019-10-01T02:10:32+0000",
      "owner": {
        "id": 1
      },
      "totalCpuUsage": 0,
      "stats": {
      }
    }  
  ],
  "meta": {
    "size": 1,
    "total": 1,
    "offset": 0,
    "max": 25
  }
}

This endpoint retrieves stateful sets of a specified cluster.

HTTP Request

GET https://api.gomorpheus.com/api/clusters/:id/statefulsets

URL Parameters

Parameter Description
id The ID of the cluster

Query Parameters

Parameter Default Description
max 25 Max number of results to return
offset 0 Offset of records you want to load
sort name Sort order
order asc Sort direction, use 'desc’ to reverse sort
phrase Name or internalId filter, restricts query to only load stateful sets which contain the phrase specified
resourceLevel Resource level filter: app, system, storage, logging

Delete Container

curl -XDELETE "$MORPHEUS_API_URL/api/clusters/:clusterId/containers/:id" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structure like this:

{
  "success": true
}

Will delete a container from the specified cluster

HTTP Request

DELETE https://api.gomorpheus.com/api/clusters/:clusterId/containers/:id

URL Parameters

Parameter Description
clusterId The ID of the cluster
id The ID of the container to delete

Query Parameters

Parameter Default Description
force off Force Delete

Delete a Deployment

curl -XDELETE "$MORPHEUS_API_URL/api/clusters/:clusterId/deployments/:id" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structure like this:

{
  "success": true
}

Will delete a deployment from the specified cluster

HTTP Request

DELETE https://api.gomorpheus.com/api/clusters/:clusterId/deployments/:id

URL Parameters

Parameter Description
clusterId The ID of the cluster
id The ID of the deployment to delete

Query Parameters

Parameter Default Description
force off Force Delete

Delete a Job

curl -XDELETE "$MORPHEUS_API_URL/api/clusters/:clusterId/jobs/:id" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structure like this:

{
  "success": true
}

Will delete a job from the specified cluster

HTTP Request

DELETE https://api.gomorpheus.com/api/clusters/:clusterId/jobs/:id

URL Parameters

Parameter Description
clusterId The ID of the cluster
id The ID of the job to delete

Query Parameters

Parameter Default Description
force off Force Delete

Delete a Service

curl -XDELETE "$MORPHEUS_API_URL/api/clusters/:clusterId/services/:id" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structure like this:

{
  "success": true
}

Will delete a service from the specified cluster

HTTP Request

DELETE https://api.gomorpheus.com/api/clusters/:clusterId/services/:id

URL Parameters

Parameter Description
clusterId The ID of the cluster
id The ID of the service to delete

Query Parameters

Parameter Default Description
force off Force Delete

Delete a Stateful Set

curl -XDELETE "$MORPHEUS_API_URL/api/clusters/:clusterId/statefulsets/:id" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structure like this:

{
  "success": true
}

Will delete a stateful set from the specified cluster

HTTP Request

DELETE https://api.gomorpheus.com/api/clusters/:clusterId/statefulsets/:id

URL Parameters

Parameter Description
clusterId The ID of the cluster
id The ID of the stateful set to delete

Query Parameters

Parameter Default Description
force off Force Delete

Restart a Container

curl -XPUT "$MORPHEUS_API_URL/api/clusters/:clusterId/containers/:id/restart" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structure like this:

{
  "success": true
}

Will restart a container in the specified cluster

HTTP Request

PUT https://api.gomorpheus.com/api/clusters/:clusterId/containers/:id/restart

URL Parameters

Parameter Description
clusterId The ID of the cluster
id The ID of the container to restart

Restart a Deployment

curl -XPUT "$MORPHEUS_API_URL/api/clusters/:clusterId/deployments/:id/restart" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structure like this:

{
  "success": true
}

Will restart a deployment in the specified cluster

HTTP Request

PUT https://api.gomorpheus.com/api/clusters/:clusterId/deployments/:id/restart

URL Parameters

Parameter Description
clusterId The ID of the cluster
id The ID of the deployment to restart

Restart a Pod

curl -XPUT "$MORPHEUS_API_URL/api/clusters/:clusterId/pods/:id/restart" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structure like this:

{
  "success": true
}

Will restart a pod in the specified cluster

HTTP Request

PUT https://api.gomorpheus.com/api/clusters/:clusterId/pods/:id/restart

URL Parameters

Parameter Description
clusterId The ID of the cluster
id The ID of the pod to restart

Restart a Stateful Set

curl -XPUT "$MORPHEUS_API_URL/api/clusters/:clusterId/statefulsets/:id/restart" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structure like this:

{
  "success": true
}

Will restart a stateful set in the specified cluster

HTTP Request

PUT https://api.gomorpheus.com/api/clusters/:clusterId/statefulsets/:id/restart

URL Parameters

Parameter Description
clusterId The ID of the cluster
id The ID of the stateful set to restart

Get Cluster History

curl "$MORPHEUS_API_URL/api/clusters/:clusterId/history" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structured like this:

{
  "processes": [
    {
      "id": 250,
      "accountId": 1,
      "uniqueId": "cebc47ec-cb2f-417a-886e-dd60cf81db26",
      "processType": {
        "code": "provision",
        "name": "provision"
      },
      "description": null,
      "subType": null,
      "subId": null,
      "zoneId": 34,
      "integrationId": null,
      "instanceId": 238,
      "containerId": 240,
      "serverId": 601,
      "containerName": "apachetest",
      "displayName": "apachetest",
      "timerCategory": "vmware",
      "timerSubCategory": "28",
      "status": "failed",
      "reason": null,
      "percent": 100.0,
      "statusEta": 348246,
      "message": null,
      "output": null,
      "error": null,
      "startDate": "2018-09-28T19:10:56+0000",
      "endDate": "2018-09-28T20:21:49+0000",
      "duration": 4253127,
      "dateCreated": "2018-09-28T19:10:56+0000",
      "lastUpdated": "2018-09-28T20:21:49+0000",
      "createdBy": {
        "username": "admin",
        "displayName": "Admin"
      },
      "updatedBy": {
        "username": "admin",
        "displayName": "Admin"
      },
      "events": [

      ]
    }
  ],
  "meta": {
    "size": 1,
    "total": 1,
    "offset": 0,
    "max": 25
  }
}

This endpoint retrieves the process history for a specific cluster.

HTTP Request

GET https://api.gomorpheus.com/api/clusters/:id/history

Get Cluster History Details

curl "$MORPHEUS_API_URL/api/clusters/:clusterId/history/:processId" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structured like this:

{
  "process": {
    "id": 7,
    "accountId": 1,
    "uniqueId": "17bac5a4-b417-4004-ad5a-d05d16c42757",
    "processType": {
      "code": "serverProvision",
      "name": "server provision"
    },
    "description": null,
    "subType": null,
    "subId": null,
    "zoneId": null,
    "integrationId": null,
    "instanceId": null,
    "containerId": null,
    "serverId": 12,
    "containerName": null,
    "displayName": "kube1-master",
    "timerCategory": "amazonKubeMaster.provision",
    "timerSubCategory": null,
    "status": "complete",
    "reason": null,
    "percent": 100.0,
    "statusEta": 23108,
    "message": null,
    "output": null,
    "error": null,
    "startDate": "2019-07-29T23:40:56+0000",
    "endDate": "2019-07-29T23:41:19+0000",
    "duration": 22785,
    "dateCreated": "2019-07-29T23:40:56+0000",
    "lastUpdated": "2019-07-29T23:41:19+0000",
    "createdBy": {
      "username": "root",
      "displayName": "Stubby Toes"
    },
    "updatedBy": {
      "username": "root",
      "displayName": "Stubby Toes"
    },
    "events": [

    ]
  }
}

This endpoint retrieves the history for a specific cluster process.

HTTP Request

GET https://api.gomorpheus.com/api/clusters/:clusterId/history/:processId

Get Cluster History Event

curl "$MORPHEUS_API_URL/api/clusters/:clusterId/history/events/:eventId" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structured like this:

{
  "processEvent": {
    "id": 6,
    "processId": 125,
    "accountId": 1,
    "uniqueId": "f1ec503c-365a-4002-8fc5-2c0f3e9121d1",
    "processType": {
      "code": "provisionImage",
      "name": "prepare image"
    },
    "description": null,
    "refType": "computeServer",
    "refId": 129,
    "subType": null,
    "subId": null,
    "zoneId": null,
    "integrationId": null,
    "instanceId": null,
    "containerId": null,
    "serverId": 129,
    "containerName": null,
    "displayName": "dans-docker-host-2",
    "status": "failed",
    "reason": null,
    "percent": 100.0,
    "statusEta": 180000,
    "message": "failed to provision server",
    "output": null,
    "error": null,
    "startDate": "2019-09-25T17:49:23+0000",
    "endDate": "2019-09-25T17:49:43+0000",
    "duration": 20199,
    "dateCreated": "2019-09-25T17:49:23+0000",
    "lastUpdated": "2019-09-25T17:50:56+0000",
    "createdBy": {
      "username": "root",
      "displayName": "Stubby Toes"
    },
    "updatedBy": {
      "username": "root",
      "displayName": "Stubby Toes"
    }
  }
}

This endpoint retrieves the process event for a specific cluster process event.

HTTP Request

GET https://api.gomorpheus.com/api/clusters/:clusterId/history/events/:eventId

Get Datastores

curl "$MORPHEUS_API_URL/api/clusters/:id/datastores"
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structured like this:

{
  "datastores": [
    {
      "id": 4,
      "name": "vsanDatastore",
      "code": null,
      "type": "vsan",
      "visibility": "privates",
      "storageSize": 3000483446784,
      "freeSpace": 1634729396798,
      "drsEnabled": false,
      "active": true,
      "allowWrite": true,
      "defaultStore": false,
      "online": true,
      "allowRead": true,
      "allowProvision": true,
      "refType": "ComputeServerGroup",
      "refId": 3,
      "externalId": "datastore-58601",
      "zone": {
        "id": 4
      },
      "zonePool": {
        "id": 9
      },
      "owner": {
        "id": 1
      },
      "tenants": [
        {
          "id": 1,
          "name": "Stubby Toes Inc."
        }
      ],
      "datastores": [

      ]
    }
  ],
  "meta": {
    "size": 1,
    "total": 1,
    "max": 25,
    "offset": 0
  }
}

This endpoint retrieves datastores of a specified cluster.

HTTP Request

GET https://api.gomorpheus.com/api/clusters/:id/datastores

URL Parameters

Parameter Description
id The ID of the cluster

Query Parameters

Parameter Default Description
max 25 Max number of results to return
offset 0 Offset of records you want to load
sort name Sort order
order asc Sort direction, use 'desc’ to reverse sort
phrase Name filter, restricts query to only load datastores which contain the phrase specified
name Name filter, restricts query to only load datastore of specified name
code Code filter, restricts query to only load datastore of specified code
hideInactive false If true restricts query to only load active datastores

Get a Specific Datastore

curl "$MORPHEUS_API_URL/api/clusters/1/datastores/1" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structured like this:

{
  "datastore": {
    "id": 4,
    "name": "vsanDatastore",
    "code": null,
    "type": "vsan",
    "visibility": "privates",
    "storageSize": 3000483446784,
    "freeSpace": 1634729396798,
    "drsEnabled": false,
    "active": true,
    "allowWrite": true,
    "defaultStore": false,
    "online": true,
    "allowRead": true,
    "allowProvision": true,
    "refType": "ComputeServerGroup",
    "refId": 3,
    "externalId": "datastore-58601",
    "zone": {
      "id": 4
    },
    "zonePool": {
      "id": 9
    },
    "owner": {
      "id": 1
    },
    "tenants": [
      {
        "id": 1,
        "name": "Stubby Toes Inc."
      }
    ],
    "permissions": {
      "resourcePermissions": {
        "allGroups": true,
        "defaultStore": false,
        "allPlans": false,
        "defaultTarget": false,
        "morpheusResourceType": "Datastore",
        "morpheusResourceId": 4,
        "canManage": false,
        "all": true,
        "account": {
          "id": 1
        },
        "sites": [],
        "plans": []
      },
      "tenantPermissions": {
        "accounts": [           
          1
        ]
      }
    },
    "datastores": [

    ]
  }
}

This endpoint retrieves a specific cluster datastore.

HTTP Request

GET https://api.gomorpheus.com/api/clusters/:clusterId/datastores/:id

URL Parameters

Parameter Description
Cluster ID ID of the cluster
ID ID of datastore

Update Datastore

curl -XPUT "$MORPHEUS_API_URL/api/clusters/1/datastores/1" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"datastore": {
        "active": true,
        "permissions": {
          "resourcePermissions": {
            "all": true,
            "sites": [
              {
                "id": 2
              }
            ]
          },
          "tenantPermissions": {
            "accounts": [
              1
            ]
          }
        },
        "visibility": "private" 
      }}'

The above command returns same JSON structure Get Datastore

HTTP Request

PUT https://api.gomorpheus.com/api/clusters/:clusterId/datastores/:id

URL Parameters

Parameter Description
clusterId The ID of the cluster
id The ID of the datastore

JSON Cluster Parameters

Parameter Required Default Description
visibility N private Visibility for datastore
active N true Datastore active
permissions N Key for resource permission configuration, see Permissions

Hosts

A Host, or Server, is either a bare metal machine or virtual machine that is provisioned into morpheus via Chef. These servers are setup as Docker Hosts and used to provision containers into. They also run the morphd agent which reports host statistics and logs back to the morpheus stack.

A Host may also be referred to as a Server or server.

Get All Hosts

curl "$MORPHEUS_API_URL/api/servers"
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structured like this:

{
  "servers": [
    {
      "id": 1,
      "accountId": 1,
      "name": "dre-matrix-1",
      "visibility": "public",
      "description": "dre-matrix-1",
      "zoneId": 1,
      "siteId": 1,
      "sshHost": "10.100.54.2",
      "internalIp": "10.100.54.2",
      "externalIp": "10.100.54.2",
      "sshPort": 22,
      "volumeId": null,
      "platform": null,
      "platformVersion": null,
      "sshUsername": "vagrant",
      "sshPassword": "****",
      "osDevice": "\/dev\/sda",
      "dataDevice": "\/dev\/sdb",
      "apiKey": "a3914182-0f2f-4e9c-a6d2-63822747b9cd",
      "softwareRaid": false,
      "config": null,
      "capacityInfo": {
        "class": "com.morpheus.ComputeCapacityInfo",
        "id": 1,
        "maxCores": null,
        "maxMemory": 2099228672,
        "maxStorage": 42945478656,
        "server": {
          "class": "com.morpheus.ComputeServer",
          "id": 1
        },
        "usedMemory": 1073741824,
        "usedStorage": 3221225472
      },
      "dateCreated": "2015-06-09T12:43:51Z",
      "lastUpdated": "2015-06-09T12:47:42Z",
      "lastStats": "{\"cpuIdleTime\":131115400,\"cpuSystemTime\":76300,\"cpuTotalTime\":131297000,\"cpuUsage\":0.13391375541687012,\"cpuUserTime\":105300,\"freeMemory\":91340800,\"freeSwap\":0,\"ts\":\"2015-06-10T13:11:45+0000\",\"usedMemory\":2007887872,\"usedSwap\":0}",
      "status": "provisioned",
      "interfaces": [
        {
          "id": 1,
          "active": true,
          "dhcp": true,
          "ipAddress": "10.100.54.2",
          "ipSubnet": null,
          "ipv6Address": null,
          "ipv6Subnet": null,
          "name": "eth1",
          "network": null,
          "networkPosition": null,
          "primaryInterface": true,
          "publicIpAddress": null,
          "publicIpv6Address": null,
          "server": {
            "id": 1
          }
        }
      ],
      "zone": {
        "id": 1,
        "accountId": 1,
        "groupId": 1,
        "name": "Davids Laptop",
        "description": "My Laptop Vagrant",
        "location": null,
        "visibility": "public",
        "zoneTypeId": 1
      }
    },
    {
      "id": 2,
      "accountId": 1,
      "name": "dre-matrix-2",
      "visibility": "public",
      "description": "dre-matrix-2",
      "zoneId": 1,
      "siteId": 1,
      "sshHost": "10.100.54.3",
      "internalIp": "10.100.54.3",
      "externalIp": "10.100.54.3",
      "sshPort": 22,
      "volumeId": null,
      "platform": null,
      "platformVersion": null,
      "sshUsername": "vagrant",
      "sshPassword": "****",
      "osDevice": "\/dev\/sda",
      "dataDevice": "\/dev\/sdb",
      "apiKey": "c3c12af8-1db2-44b3-930d-87f914b14577",
      "softwareRaid": false,
      "config": null,
      "capacityInfo": {
        "id": 2,
        "maxCores": null,
        "maxMemory": 2099228672,
        "maxStorage": 42945478656,
        "server": {
          "id": 2
        },
        "usedMemory": 1073741824,
        "usedStorage": 3221225472
      },
      "dateCreated": "2015-06-09T14:07:57Z",
      "lastUpdated": "2015-06-09T14:17:51Z",
      "lastStats": "{\"cpuIdleTime\":130016650,\"cpuSystemTime\":1041990,\"cpuTotalTime\":131172760,\"cpuUsage\":0.1677870750427246,\"cpuUserTime\":114120,\"freeMemory\":215248896,\"freeSwap\":0,\"ts\":\"2015-06-10T13:18:33+0000\",\"usedMemory\":1883979776,\"usedSwap\":0}",
      "status": "provisioned",
      "interfaces": [
        {
          "id": 2,
          "active": true,
          "dhcp": true,
          "ipAddress": "10.100.54.3",
          "ipSubnet": null,
          "ipv6Address": null,
          "ipv6Subnet": null,
          "name": "eth1",
          "network": null,
          "networkPosition": null,
          "primaryInterface": true,
          "publicIpAddress": null,
          "publicIpv6Address": null,
          "server": {
            "id": 2
          }
        }
      ],
      "zone": {
        "id": 1,
        "accountId": 1,
        "groupId": 1,
        "name": "Davids Laptop",
        "description": "My Laptop Vagrant",
        "location": null,
        "visibility": "public",
        "zoneTypeId": 1
      }
    }
  ],
  "serverCount": 2,
  "stats": {
    "1": {
      "usedStorage": 48861184,
      "reservedStorage": 3221225472,
      "maxStorage": 42945478656,
      "usedMemory": 2007887872,
      "reservedMemory": 1073741824,
      "maxMemory": 2099228672
    },
    "2": {
      "usedStorage": 18976768,
      "reservedStorage": 3221225472,
      "maxStorage": 42945478656,
      "usedMemory": 1883979776,
      "reservedMemory": 1073741824,
      "maxMemory": 2099228672
    }
  }
}

This endpoint retrieves a paginated list of hosts.

HTTP Request

GET https://api.gomorpheus.com/api/servers

Query Parameters

Parameter Default Description
name Filter by name
phrase Filter by wildcard search of name and description
siteId Filter by group ID
zoneId Filter by zone ID
clusterId Filter by cluster ID
managed Filter by managed (true) or unmanaged (false)
serverType Filter by server type code
powerState Filter by power status
ip Filter by IP address
vm Filter to show only Virtual Machines (true)
vmHypervisor Filter to show only VM Hypervisors (true)
bareMetalHost Filter to show only Baremetal Servers (true)
status Filter by status
agentInstalled Filter by agent installed (true)
max 25 Max number of results to return
offset 0 Offset of records you want to load
lastUpdated Date filter, restricts query to only load servers updated timestamp is more recent or equal to the date specified
createdBy Filter by Created By (User) ID. Accepts multiple values.

Get a Specific Host

curl "$MORPHEUS_API_URL/api/servers/1" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structured like this:

{
  "success": true,
  "server": {
    "id": 1,
    "accountId": 1,
    "name": "dre-matrix-1",
    "visibility": "public",
    "description": "dre-matrix-1",
    "zoneId": 1,
    "siteId": 1,
    "sshHost": "10.100.54.2",
    "internalIp": "10.100.54.2",
    "externalIp": "10.100.54.2",
    "sshPort": 22,
    "volumeId": null,
    "platform": null,
    "platformVersion": null,
    "sshUsername": "vagrant",
    "sshPassword": "****",
    "osDevice": "\/dev\/sda",
    "dataDevice": "\/dev\/sdb",
    "apiKey": "a3914182-0f2f-4e9c-a6d2-63822747b9cd",
    "softwareRaid": false,
    "config": null,
    "capacityInfo": {
      "class": "com.morpheus.ComputeCapacityInfo",
      "id": 1,
      "maxCores": null,
      "maxMemory": 2099228672,
      "maxStorage": 42945478656,
      "server": {
        "class": "com.morpheus.ComputeServer",
        "id": 1
      },
      "usedMemory": 1073741824,
      "usedStorage": 3221225472
    },
    "dateCreated": "2015-06-09T12:43:51Z",
    "lastUpdated": "2015-06-09T12:47:42Z",
    "lastStats": "{\"cpuIdleTime\":131294520,\"cpuSystemTime\":76390,\"cpuTotalTime\":131476290,\"cpuUsage\":0.10046958923339844,\"cpuUserTime\":105380,\"freeMemory\":91181056,\"freeSwap\":0,\"ts\":\"2015-06-10T13:14:45+0000\",\"usedMemory\":2008047616,\"usedSwap\":0}",
    "status": "provisioned",
    "interfaces": [
      {
        "id": 1,
        "active": true,
        "dhcp": true,
        "ipAddress": "10.100.54.2",
        "ipSubnet": null,
        "ipv6Address": null,
        "ipv6Subnet": null,
        "name": "eth1",
        "network": null,
        "networkPosition": null,
        "primaryInterface": true,
        "publicIpAddress": null,
        "publicIpv6Address": null,
        "server": {
          "id": 1
        }
      }
    ],
    "zone": {
      "id": 1,
      "accountId": 1,
      "groupId": 1,
      "name": "Davids Laptop",
      "description": "My Laptop Vagrant",
      "location": null,
      "visibility": "public",
      "zoneTypeId": 1
    }
  }
}

This endpoint retrieves a specific host.

HTTP Request

GET https://api.gomorpheus.com/api/servers/:id

URL Parameters

Parameter Description
ID ID of the check to retrieve

Get Available Service Plans for a Host

curl -XGET "https://api.gomorpheus.com/api/servers/service-plans?zoneId=2&serverTypeId=60" \
  -H "Authorization: BEARER $MORPHEUS_API_TOKEN"

The above command returns JSON structure like this:

{
  "plans": [
    {
      "id": 75,
      "name": "1 CPU, 512MB Memory",
      "value": 75,
      "code": "vm-512",
      "maxStorage": 10737418240,
      "maxMemory": 536870912,
      "maxCpu": 1,
      "maxCores": 1,
      "customCpu": false,
      "customMaxMemory": false,
      "customMaxStorage": <