NAV
shell

Introduction

Welcome to the Morpheus API Documentation. Morpheus is a powerful provisioning service complete with monitoring, logging, backups, and application deployment strategies.

We currently provide an OAUTH 2.0 based authentication model and are working on language specific libraries for ruby and a few others.

Authentication

The Morpheus API follows the OAuth 2.0 Specification and acts as an OAUTH 2.0 provider. To authorize your account you will need to use the same credentials you normally use to login to morpheus which will provide you with an accessToken as well as a refreshToken.

To authorize, use this code:

# With shell, you can just pass the correct header with each request
curl -X POST --data "username=meow&password=meow" "https://morpheus-appliance-url/oauth/token?grant_type=password&scope=write&client_id=morph-customer"

#Returns:
{
  "access_token": "d0cc2cc4-f7f5-4713-a874-34491e7707de",
  "expires_in": 31535996,
  "refresh_token": "cda88865-f88d-4ed9-a621-424d9361beb2",
  "scope": "write",
  "token_type": "bearer"
}

Make sure to replace morpheus-appliance-url with your appliance url and meow with your username and password.

Morpheus expects all api requests to use the resultant access_token from the request made during authentication. This can be passed via the Authorization header. Be sure to replace the access_token with the actual token received from the OAuth request.

Authorization: BEARER access_token

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 "https://api.gomorpheus.com/api/apps"
  -H "Authorization: BEARER access_token"

The above command returns JSON structured like this:

{
  "apps": [
    {
      "id": 1,
      "accountId": 1,
      "name": "My Test App",
      "description": "Sample Description",
      "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 all apps and the correlated instances. Server data is encrypted in the database.

HTTP Request

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

Query Parameters

Parameter Default Description
max 25 Max number of results to return
offset 0 Offset of records you want to load
name null Filter by name
phrase null Filter by wildcard search of name and description
lastUpdated null Date filter, restricts query to only load apps updated timestamp is more recent or equal to the date specified

Get a Specific App

curl "https://api.gomorpheus.com/api/apps/4" \
  -H "Authorization: BEARER access_token"

The above command returns JSON structured like this:

{
  "app": {
    "id": 1,
    "accountId": 1,
    "name": "My Test App",
    "description": "Sample Description",
    "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

Create an App

curl -XPOST "https://api.gomorpheus.com/api/apps" \
  -H "Authorization: BEARER access_token" \
  -H "Content-Type: application/json" \
  -d '{"app":{
    "name": "sampleapp",
    "description": "A sample app",
    "site": {
      "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 null A name for the app
description null Optional description field
site null A Map containing the id of the Site

Updating an App Name or Description

curl -XPUT "https://api.gomorpheus.com/api/apps/2" \
  -H "Authorization: BEARER access_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

JSON App Parameters

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

Add Existing Instance to App

curl -XPOST "https://api.gomorpheus.com/api/apps/1/add-instance" \
  -H "Authorization: BEARER access_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

JSON Parameters

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

Remove Instance from App

curl -XPOST "https://api.gomorpheus.com/api/apps/1/remove-instance" \
  -H "Authorization: BEARER access_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

JSON Parameters

Parameter Default Description
instanceId null The ID of the instance being added

Get Security Groups

curl -XGET "https://api.gomorpheus.com/api/apps/1/security-groups" \
  -H "Authorization: BEARER access_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

Set Security Groups

curl -XPUT "https://api.gomorpheus.com/api/apps/1/security-groups" \
  -H "Authorization: BEARER access_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

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

JSON Parameters

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

Disable the firewall

curl -XPUT "https://api.gomorpheus.com/api/apps/1/security-groups/disable" \
  -H "Authorization: BEARER access_token"

The above command returns JSON structure like this:

{
  "success": true
}

This will disable the firewall. Any configured security groups will not be applied.

HTTP Request

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

Enable the firewall

curl -XPUT "https://api.gomorpheus.com/api/apps/1/security-groups/enable" \
  -H "Authorization: BEARER access_token"

The above command returns JSON structure like this:

{
  "success": true
}

This will enable the firewall. Any configured security groups will be applied.

HTTP Request

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

Delete an App

curl -XDELETE "https://api.gomorpheus.com/api/apps/1" \
  -H "Authorization: BEARER access_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/instances/:id

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

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 "https://api.gomorpheus.com/api/instances?max=3"
  -H "Authorization: BEARER access_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
      ],
      "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
      ],
      "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
      ],
      "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 all instances and their JSON encoded configuration attributes based on check type. Server data is encrypted in the database.

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
lastUpdated null Date filter, restricts query to only load instances updated timestamp is more recent or equal to the date specified

Get a Specific Instance

curl "https://api.gomorpheus.com/api/instances/1216" \
  -H "Authorization: BEARER access_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
    ],
    "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

Get env variables

curl "https://api.gomorpheus.com/api/instances/1216/envs" \
  -H "Authorization: BEARER access_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

Get Security Groups

curl "https://api.gomorpheus.com/api/instances/1666/security-groups" \
  -H "Authorization: BEARER access_token"

The above command returns JSON like this:

{
  "success": true,
  "firewallEnabled": true,
  "securityGroups": [
    {
      "id": 43,
      "accountId": 1,
      "name": "api-tom-test",
      "description": "Test Security Group"
    }
  ]
}

This gets information about the security groups the instance has setup.

HTTP Request

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

Enable security-groups

curl -X PUT "https://api.gomorpheus.com/api/instances/1666/security-groups/enable" \
  -H "Authorization: BEARER access_token"

The above command returns JSON like this:

{
  "success": true
}

This action enables a security group assigned to an instance

HTTP Request

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

Disable security-groups

curl -X PUT "https://api.gomorpheus.com/api/instances/1666/security-groups/disable" \
  -H "Authorization: BEARER access_token"

The above command returns JSON like this:

{
  "success": true
}

HTTP Request

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

Get container details

curl "https://api.gomorpheus.com/api/instances/1216/containers" \
  -H "Authorization: BEARER access_token"

The above command returns JSON structured like this:

{
  "success": true,
  "containers": [
    {
      "id": 1414,
      "name": "tomcat_1414",
      "configs": "{\"evars\":{},\"hosts\":{\"container1414\":\"127.0.0.1\",\"container1759\":\"192.168.163.233\"},\"maxMemory\":1073741824,\"maxStorage\":10737418240,\"mounts\":[{\"containerPath\":\"/morpheus/data\",\"hostPath\":\"/morpheus/container_1414/data\",\"type\":\"data\"},{\"containerPath\":\"/morpheus/logs\",\"hostPath\":\"/morpheus/container_1414/logs\",\"type\":\"logs\"},{\"containerPath\":\"/morpheus/config\",\"hostPath\":\"/morpheus/container_1414/config\",\"type\":\"config\"}],\"ports\":[{\"displayName\":\"Http\",\"export\":true,\"exportName\":null,\"external\":10017,\"index\":0,\"internal\":8080,\"link\":true,\"loadBalance\":true,\"protocol\":\"http\",\"visible\":true}],\"priviligedContainer\":null,\"vm\":false}",
      "containerType": {
        "id": 23,
        "name": "Tomcat 7.0.62"
      },
      "lastStats": "{\"ts\":\"2017-02-11T17:54:30+0000\",\"maxStorage\":10434699264,\"usedStorage\":290037760,\"running\":true,\"userCpuUsage\":0,\"systemCpuUsage\":0.0062528659,\"usedMemory\":770224128,\"maxMemory\":1073741824,\"cacheMemory\":275013632,\"readIOPS\":0,\"writeIOPS\":0,\"totalIOPS\":0,\"netTxUsage\":0,\"netRxUsage\":0}",
      "environmentPrefix": null,
      "status": "running",
      "dateCreated": "2016-12-15T15:22:17Z",
      "ip": "12.96.81.102",
      "externalIp": "12.96.81.102",
      "internalIp": "192.168.163.232",
      "ports": [
        {
          "displayName": "Http",
          "export": true,
          "exportName": null,
          "external": 10017,
          "index": 0,
          "internal": 8080,
          "link": true,
          "loadBalance": true,
          "protocol": "http",
          "visible": true
        }
      ]
    },
    {
      "id": 1759,
      "name": "tomcat_1759",
      "configs": "{\"evars\":{},\"hosts\":{\"container1414\":\"192.168.163.232\",\"container1759\":\"127.0.0.1\"},\"maxMemory\":1073741824,\"maxStorage\":10737418240,\"mounts\":[{\"containerPath\":\"/morpheus/data\",\"hostPath\":\"/morpheus/container_1759/data\",\"type\":\"data\"},{\"containerPath\":\"/morpheus/logs\",\"hostPath\":\"/morpheus/container_1759/logs\",\"type\":\"logs\"},{\"containerPath\":\"/morpheus/config\",\"hostPath\":\"/morpheus/container_1759/config\",\"type\":\"config\"}],\"networkInterfaces\":null,\"ports\":[{\"code\":\"tomcat.8080\",\"displayName\":\"Http\",\"export\":true,\"exportName\":null,\"external\":10017,\"index\":0,\"internal\":8080,\"link\":true,\"loadBalance\":true,\"protocol\":\"http\",\"visible\":true}],\"priviligedContainer\":null,\"serverId\":null,\"storageController\":null,\"vm\":false,\"volumes\":null}",
      "containerType": {
        "id": 23,
        "name": "Tomcat 7.0.62"
      },
      "lastStats": "{\"ts\":\"2017-02-11T17:53:39+0000\",\"maxStorage\":10434699264,\"usedStorage\":288571392,\"running\":true,\"userCpuUsage\":0.0062526053,\"systemCpuUsage\":0.008336807,\"usedMemory\":790220800,\"maxMemory\":1073741824,\"cacheMemory\":190226432,\"readIOPS\":0,\"writeIOPS\":0,\"totalIOPS\":0,\"netTxUsage\":0,\"netRxUsage\":0}",
      "environmentPrefix": null,
      "status": "running",
      "dateCreated": "2017-01-27T19:29:39Z",
      "ip": "12.96.81.103",
      "externalIp": "12.96.81.103",
      "internalIp": "192.168.163.233",
      "ports": [
        {
          "code": "tomcat.8080",
          "displayName": "Http",
          "export": true,
          "exportName": null,
          "external": 10017,
          "index": 0,
          "internal": 8080,
          "link": true,
          "loadBalance": true,
          "protocol": "http",
          "visible": true
        }
      ]
    }
  ]
}

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

Create an Instance

See Provisioning for details.

HTTP Request

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

Updating an Instance

curl -X PUT "https://api.gomorpheus.com/api/instances/1" \
  -H "Authorization: BEARER access_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

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

Updating Instance Notes

curl -X PUT "https://api.gomorpheus.com/api/instances/1/notes" \
  -H "Authorization: BEARER access_token" \
  -H "Content-Type: application/json" \
  -d '{ "instance": {
  "notes": "My notes about this instance."
  }}'

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/notes

JSON Instance Parameters

Parameter Default Description
notes Notes in markdown format.

Stop an Instance

curl -X PUT "https://api.gomorpheus.com/api/instances/1/stop" \
  -H "Authorization: BEARER access_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

Start an Instance

curl -X PUT "https://api.gomorpheus.com/api/instances/1/start" \
  -H "Authorization: BEARER access_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

Restart an Instance

curl -X PUT "https://api.gomorpheus.com/api/instances/1/restart" \
  -H "Authorization: BEARER access_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

Suspend an Instance

curl -X PUT "https://api.gomorpheus.com/api/instances/1/suspend" \
  -H "Authorization: BEARER access_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

Eject an Instance

curl -X PUT "https://api.gomorpheus.com/api/instances/1/eject" \
  -H "Authorization: BEARER access_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

Resize an Instance

curl -X PUT "https://api.gomorpheus.com/api/instances/1/resize" \
  -H "Authorization: BEARER access_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

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 access_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

JSON Parameters

Parameter Default Description
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.

Upgrade an Instance

curl -X PUT "https://api.gomorpheus.com/api/instances/1/upgrade" \
  -H "Authorization: BEARER access_token" \
  -H "Content-Type: application/json" \
  -d '{ "upgrade": {
      "id": 1
  }}'

The above command returns JSON structure like this:

{
  "success": true
}

It is possible to perform certain upgrade options for an instance. See the section on getting a list of upgrade options for a particular instance. Depending on the instance type these could include adding a replica, adding a a tomcat node, adding a mysql save, or master. Entirely depends.

HTTP Request

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

JSON Parameters

Parameter Default Description
upgrade null the map containing the id of the instance type upgrade you would like to perform.

Backup an Instance

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

The above command returns JSON structure that looks like this:

{
    "success": true
}

HTTP Request

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

Get list of backups for an Instance

curl "https://api.gomorpheus.com/api/instances/1773/backups" \
  -H "Authorization: BEARER access_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

Import Snapshot of an Instance

curl -X PUT "https://api.gomorpheus.com/api/instances/1/import-snapshot" \
  -H "Authorization: BEARER access_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

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 access_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

Set Security Groups

curl -X POST "https://api.gomorpheus.com/api/instances/1/security-groups" \
  -H "Authorization: BEARER access_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

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

JSON Parameters

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

Disable the firewall

curl -X PUT "https://api.gomorpheus.com/api/instances/1/security-groups/disable" \
  -H "Authorization: BEARER access_token"

The above command returns JSON structure like this:

{
  "success": true
}

This will disable the firewall. Any configured security groups will not be applied.

HTTP Request

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

Enable the firewall

curl -X PUT "https://api.gomorpheus.com/api/instances/1/security-groups/enable" \
  -H "Authorization: BEARER access_token"

The above command returns JSON structure like this:

{
  "success": true
}

This will enable the firewall. Any configured security groups will be applied.

HTTP Request

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

Delete an Instance

curl -XDELETE "https://api.gomorpheus.com/api/instances/1" \
  -H "Authorization: BEARER access_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

Query Parameters

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

Instance Types

Provides a means to find out which instance types are available to your user account. These can vary in range from database containers, to web containers, to custom containers. .

Get All Instance Types

curl "https://api.gomorpheus.com/api/instance-types"
  -H "Authorization: BEARER access_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 "https://api.gomorpheus.com/api/instance-types/12"
  -H "Authorization: BEARER access_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

Get Upgrade Options

curl "https://api.gomorpheus.com/api/instance-types/upgrades/1"
  -H "Authorization: BEARER access_token"

The above command returns JSON structured like this

{
  "upgrades": [
    {
      "id": 3,
      "code": "tomcat-add-node",
      "containerTypes": null,
      "description": "This will add an additional tomcat node",
      "name": "Add Tomcat Node",
      "sortOrder": 0
    }
  ]
}

HTTP Request

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

Provisioning

Provisioning options will depend heavily on the cloud you are provisioning to. This section is broken out into options based on the instance-type that is being created.

Provision an Instance

curl -X POST "https://api.gomorpheus.com/api/instances" \
  -H "Authorization: BEARER access_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 null Name of the instance to be created
instance.site.id Y null The Group ID to provision the instance into
instance.instanceType.code Y null The type of instance by code we want to fetch
instance.layout.id Y null The layout id for the instance type that you want to provision. i.e. single process or cluster
instance.plan.id Y null The id for the memory and storage option pre-configured within Morpheus
zoneId Y null 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 null Map of custom options depending on selected service plan . An example would be maxMemory, or maxCores.
securityGroups N null 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 null Key for volume configuration, see Volumes
networkInterfaces N null Key for network configuration, see Network Interfaces
config Y null Key for specific type configuration, see Config
metadata N null Array of name-value pairs for AWS metadata tags Metadata
taskSetId N null The Workflow ID 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 null Can be used to select pre-existing LV choices from Morpheus
storageType N null Identifier for LV type
datastoreId Y null 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 null ID of a public key to add to the instance
vmwareResourcePoolId Y null ID of the resource group to use for instance
hostId N null Specific host to deploy to if so desired
vmwareUsr N null Additional user to provision to instance
vmwarePwd N null Password for additional user
vmwareDomainName N null Domain name to be given to instance
vmwareCustomSpec N null Customization spec ID

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.

Provision Types

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 provision-types. 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.

Get All Provision Types

curl "https://api.gomorpheus.com/api/provision-types"
  -H "Authorization: BEARER access_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 "https://api.gomorpheus.com/api/provision-types/9"
  -H "Authorization: BEARER access_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

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 "https://api.gomorpheus.com/api/options/keyPairs"
  -H "Authorization: BEARER access_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.

Deployment Management

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 "https://api.gomorpheus.com/api/instances/1/deploy"
  -H "Authorization: BEARER access_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 "https://api.gomorpheus.com/api/instances/1/deploy"
  -H "Authorization: BEARER access_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 Check Parameters

Parameter Default Description
userVersion null Optional version tag for reference of teh build
deployType browser The type of deployment. File based is browser, git for git and fetch for fetching from a url
gitUrl null The ssh git url to use to fetch files for the archive
gitRef null The branch or tag name to be used to fetch from on git.
fetchUrl null Used for fetch deploy type. Can fetch a zip file or general file and extract into archive
deployGroup null Not yet in use but used to organize deploys for multiple apps in the same group
config null JSON encoded list of parameters that varies by instance type. See below for more information

Upload Files to Deployment Archive

Monitor Checks

These entities define what and when a check is executed within the Morpheus system. Morpheus supports a vast array of different check types (not solely web checks). The API provides a means to list all of an account’s checks in addition to create, modify, mute, and or delete them.

Get All Checks

curl "https://api.gomorpheus.com/api/monitoring/checks"
  -H "Authorization: BEARER access_token"

The above command returns JSON structured like this:

{
  "checks": [
    {
      "id": 798,
      "account": {
        "id": 1
      },
      "active": true,
      "availability": 99.9804109,
      "checkAgent": null,
      "checkIntegrations": [

      ],
      "checkInterval": 300,
      "checkSpec": null,
      "checkType": {
        "id": 1
      },
      "config": "{\n  \"webMethod\" : \"GET\",\n  \"webUrl\" : \"http:\\\/\\\/google.com\"\n}",
      "createIncident": true,
      "dateCreated": "2015-05-16T12:05:23Z",
      "deleted": false,
      "description": null,
      "health": 10,
      "history": "{\"checkDates\":[1433339580607,1433339595119,1433339613169,1433339625412,1433339641010,1433339655209,1433339670178,1433339687802,1433339700471,1433339715171,1433339730710,1433339745351,1433339764299,1433339775508,1433339790377,1433339805373,1433339820944,1433339835996,1433339850317,1433339865833,1433339880884,1433339895489,1433339910554,1433339925660,1433339940875,1433339956143,1433339970551,1433339985179,1433340000961,1433340015765],\"successList\":[true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true],\"healthList\":[10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10],\"timerList\":[347,410,338,337,365,361,373,374,358,337,350,505,342,338,358,359,381,354,353,377,342,344,349,363,329,352,350,348,356,345]}",
      "inUptime": true,
      "lastBoxStats": null,
      "lastCheckStatus": "success",
      "lastError": "http error: Read timed out",
      "lastErrorDate": "2015-05-18T09:25:15Z",
      "lastMessage": "http 200",
      "lastMetric": "200",
      "lastRunDate": "2015-06-03T14:00:16Z",
      "lastStats": null,
      "lastSuccessDate": "2015-06-03T14:00:16Z",
      "lastTimer": 345,
      "lastUpdated": "2015-06-03T14:00:16Z",
      "lastWarningDate": null,
      "name": "Purity Plus",
      "nextRunDate": "2015-06-03T14:00:16Z",
      "severity": "critical",
      "startDate": null
    }
  ]
}

This endpoint retrieves all checks and their JSON encoded configuration attributes based on check type. Check data is encrypted in the database.

HTTP Request

GET https://api.gomorpheus.com/api/monitoring/checks

Query Parameters

Parameter Default Description
max 25 Max number of results to return
offset 0 Offset of records you want to load
lastUpdated null Date filter, restricts query to only load checks updated timestamp is more recent or equal to the date specified
deleted undefined Used to specify you can load previously deleted checks. Useful for synchronizing deleted records in your client side store.

Get a Specific Check

curl "https://api.gomorpheus.com/api/monitoring/checks/1" \
  -H "Authorization: BEARER access_token"

The above command returns JSON structured like this:

{
  "success": true,
  "check:" {
    "id": 798,
    "account": {
      "id": 1
    },
    "active": true,
    "availability": 99.9804109,
    "checkAgent": null,
    "checkIntegrations": [

    ],
    "checkInterval": 300,
    "checkSpec": null,
    "checkType": {
      "id": 1
    },
    "config": "{\n  \"webMethod\" : \"GET\",\n  \"webUrl\" : \"http:\\\/\\\/google.com\"\n}",
    "createIncident": true,
    "dateCreated": "2015-05-16T12:05:23Z",
    "deleted": false,
    "description": null,
    "health": 10,
    "history": "{\"checkDates\":[1433339580607,1433339595119,1433339613169,1433339625412,1433339641010,1433339655209,1433339670178,1433339687802,1433339700471,1433339715171,1433339730710,1433339745351,1433339764299,1433339775508,1433339790377,1433339805373,1433339820944,1433339835996,1433339850317,1433339865833,1433339880884,1433339895489,1433339910554,1433339925660,1433339940875,1433339956143,1433339970551,1433339985179,1433340000961,1433340015765],\"successList\":[true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true,true],\"healthList\":[10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10],\"timerList\":[347,410,338,337,365,361,373,374,358,337,350,505,342,338,358,359,381,354,353,377,342,344,349,363,329,352,350,348,356,345]}",
    "inUptime": true,
    "lastBoxStats": null,
    "lastCheckStatus": "success",
    "lastError": "http error: Read timed out",
    "lastErrorDate": "2015-05-18T09:25:15Z",
    "lastMessage": "http 200",
    "lastMetric": "200",
    "lastRunDate": "2015-06-03T14:00:16Z",
    "lastStats": null,
    "lastSuccessDate": "2015-06-03T14:00:16Z",
    "lastTimer": 345,
    "lastUpdated": "2015-06-03T14:00:16Z",
    "lastWarningDate": null,
    "name": "Purity Plus",
    "nextRunDate": "2015-06-03T14:00:16Z",
    "severity": "critical",
  }
}

This endpoint retrieves a specific check.

HTTP Request

GET https://api.gomorpheus.com/api/monitoring/checks/:id

URL Parameters

Parameter Description
ID ID of the check to retrieve

Create a Check

curl -XPOST "https://api.gomorpheus.com/api/monitoring/checks" \
  -H "Authorization: BEARER access_token" \
  -H "Content-Type: application/json" \
  -d '{"check":{
    "name": "My Check",
    "checkType": {"code": "webGetCheck"},
    "inUptime": true,
    "severity": "critical",
    "description": null,
    "checkInterval": 300,
    "checkAgent": null,
    "active": true,
    "config": "{\n  \"webMethod\" : \"GET\",\n  \"webUrl\" : \"http:\\\/\\\/google.com\"\n}",
  }}'

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/monitoring/checks

JSON Check Parameters

Parameter Default Description
name null Unique name scoped to your account for the check
description null Optional description field
checkType null Check type you want to create, use code and a valid check type: {"code": "webGetCheck"}
checkInterval 300 Number of seconds you want between check executions (minimum value is 60, depending on your subscription plan)
inUptime true Used to determine if check should affect account wide availability calculations
active true Used to determine if check should be scheduled to execute
severity critical Severity level of incidents that are created when this check fails. They can be info, warning, or critical
checkAgent null Specifies agent you want to run the check with i.e. {"id": 1} See Agents for more information
config null JSON encoded list of parameters that varies by check type. See below for more information

Updating a Check

curl -XPUT "https://api.gomorpheus.com/api/monitoring/checks/1" \
  -H "Authorization: BEARER access_token" \
  -H "Content-Type: application/json" \
  -d '{"check":{
    "name": "My Check",
    "checkType": {"code": "webGetCheck"},
    "inUptime": true,
    "severity": "critical",
    "description": null,
    "checkInterval": 300,
    "checkAgent": null,
    "active": true,
    "config": "{\n  \"webMethod\" : \"GET\",\n  \"webUrl\" : \"http:\\\/\\\/google.com\"\n}",
  }}'

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/monitoring/checks/:id

JSON Check Parameters

Parameter Default Description
name null Unique name scoped to your account for the check
description null Optional description field
checkType null Check type you want to create, use code and a valid check type: {"code": "webGetCheck"}
checkInterval 300 Number of seconds you want between check executions (minimum value is 60, depending on your subscription plan)
inUptime true Used to determine if check should affect account wide availability calculations
active true Used to determine if check should be scheduled to execute
severity critical Severity level of incidents that are created when this check fails. They can be info, warning, or critical
checkAgent null Specifies agent you want to run the check with i.e. {"id": 1} See Agents for more information
config null JSON encoded list of parameters that varies by check type. See below for more information

Check Types and Options

We support a wide variety of check types. Each check type varies in its configuration payload when determining how the check should be run.

Creates a Web type Check

Web Get Check

{
  "check": {
    "name": "My Web Check",
    "checkType": {"code": "webGetCheck"},
    "config": "{\"webMethod\":\"GET\",\"webUrl\": \"http:\\\/\\\/google.com\", \"checkUser\":\"basicUser\",\"checkPassword\":\"basicPassword\", \"webTextMatch\": \"Login\", \"textCheckOn\": \"on\"}"
  }
}

Code: webGetCheck

Web check type allows you to perform a standard web request and validate the response came back successfully. Additionally, you can check for matching text within the result. There are several config parameters available for use with this type of check

Parameter Requirement Description
webMethod Yes HTTP method to use for testing (GET or POST)
webUrl Yes Web URL you wish to use to run a check on
checkUser No If you want to use HTTP Basic Authentication, populate this field with the username
checkPassword No If you want to use HTTP basic Authentication, populate this field with the password
textCheckOn No Set value to “on” if you want to turn on text matching
webTextMatch No Set the string you want to look for in the page source

MySQL Check

{
  "check": {
    "name": "MySql Check",
    "checkType": {"code": "mysqlCheck"},
    "config": "{\"dbHost\":\"db.example.org\",\"dbPort\": \"3306\", \"dbUser\":\"basicUser\",\"dbPassword\":\"basicPassword\", \"dbName\": \"mydb\", \"dbQuery\": \"select 1\", \"checkOperator\": \"lt\", \"checkResult\": 2}"
  }
}

Code: mysqlCheck

MySQL check allows you to execute a query so that you may validate the value returned in addition to verifying the database is responding. This can be useful for doing a slow query check or just making sure something isn’t growing out of control.

Parameter Requirement Description
dbHost Yes Hostname or IP address of the MySQL database
dbPort Yes MySQL Port (defaults to 3306)
dbUser Yes Database username
dbPassword Yes Database password, (all check data is encrypted inside the Morpheus database)
dbName Yes Database name you would like to connect to
checkOperator No Can be set to lt (less than), gt (greater than), equal (Equal to) for comparison
checkResult No Numerical value to compare the check result against

SQL Server Check

{
  "check": {
    "name": "SQL Server Check",
    "checkType": {"code": "sqlCheck"},
    "config": "{\"dbHost\":\"db.example.org\",\"dbPort\": \"3306\", \"dbUser\":\"basicUser\",\"dbPassword\":\"basicPassword\", \"dbName\": \"mydb\", \"dbQuery\": \"select 1\", \"checkOperator\": \"lt\", \"checkResult\": 2}"
  }
}

Code: sqlCheck

SQL Server check allows to execute a query so that you may validate the value returned in addition to verifying the database is responding. This can be useful for doing a slow query check or just making sure something isn’t growing out of control.

Parameter Requirement Description
dbHost Yes Hostname or IP address of the SQL database
dbPort Yes SQL Port (defaults to 1433)
dbUser Yes Database username
dbPassword Yes Database password, (all check data is encrypted inside the Morpheus database)
dbName Yes Database name you would like to connect to
checkOperator No Can be set to lt (less than), gt (greater than), equal (Equal to) for comparison
checkResult No Numerical value to compare the check result against

PostgreSQL Check

{
  "check": {
    "name": "PostgerSQL Check",
    "checkType": {"code": "postgresCheck"},
    "config": "{\"dbHost\":\"db.example.org\",\"dbPort\": \"3306\", \"dbUser\":\"basicUser\",\"dbPassword\":\"basicPassword\", \"dbName\": \"mydb\", \"dbQuery\": \"select 1\", \"checkOperator\": \"lt\", \"checkResult\": 2}"
  }
}

Code: postgresCheck

PostgreSQL check allows to execute a query so that you may validate the value returned in addition to verifying the database is responding. This can be useful for doing a slow query check or just making sure something isn’t growing out of control.

Parameter Requirement Description
dbHost Yes Hostname or IP address of the PostgreSQL database
dbPort Yes SQL Port (defaults to 5432)
dbUser Yes Database username
dbPassword Yes Database password, (all check data is encrypted inside the Morpheus database)
dbName Yes Database name you would like to connect to
checkOperator No Can be set to lt (less than), gt (greater than), equal (Equal to) for comparison
checkResult No Numerical value to compare the check result against

Socket Check

{
  "check": {
    "name": "Socket Check",
    "checkType": {"code": "socketCheck"},
    "config": "{\"host\":\"test.example.org\",\"port\": \"3306\", \"send\":\"blah\",\"responseMatch\":\"OK\"}"
  }
}

Code: socketCheck

Socket check confirms a certain TCP port is up and responding in your environment. It can be configured do an initial send upon connect and compare and expected response of the service.

Parameter Requirement Description
host Yes Hostname or IP address of the socket server
port Yes TCP port
send No Connection string you might want to send to the service
responseMatch No Response from the service to match against

Elastic Search Check

{
  "check": {
    "name": "Socket Check",
    "checkType": {"code": "elasticSearchCheck"},
    "config": "{\"esHost\":\"test.example.org\",\"esPort\": \"9200\"}"
  }
}

Code: elasticSearchCheck

Elasticsearch check is capable of connecting to your Elasticsearch, cluster or node, verifying its health. In addition, Morpheus will also pull statistical information such as: document size, capacity, and cpu usage.

Parameter Requirement Description
esHost Yes Hostname or IP address of the Elasticsearch server
esPort Yes Port to connect to the HTTP service

Push Check

{
  "check": {
    "name": "Push Check",
    "checkType": {"code": "pushCheck"}
  }
}

Code: pushCheck

A Push check is a check that is updated by a web hook. An external source is responsible for periodically submitting a check status. Please see the section on Push Checks API for details.

SSH Tunneling

SSH tunneling options allow the different check types to tunnel to a host via a proxy, and execute checks relative to the proxy. A SSH tunnel can use your account generated public and private key-pairs or SSH password (we strongly recommend using a key-pair).

To enable SSH tunneling for a check, add the following parameters to any check type config as seen earlier in the Check Types section.

{
  "check": {
    "name": "Socket Check",
    "checkType": {"code": "elasticSearchCheck"},
    "config": "{\"esHost\":\"test.example.org\",\"esPort\": \"9200\", \"tunnelOn\": \"on\", \"sshHost\": \"example.org\", \"sshPort\": 22, \"sshUser\": \"happyapps\"}"
  }
}
Parameter Requirement Description
tunnelOn Yes Set to on to turn on tunneling
sshHost Yes Hostname or IP address of the proxy host
sshPort No Port for SSH on the proxy host, defaults to 22
sshUser Yes SSH user on the proxy host to login as
sshPassword No Password for user, if not using key based authentication

Mute a Check

curl -XPUT "https://api.gomorpheus.com/api/monitoring/checks/1/mute" \
  -H "Authorization: BEARER access_token" \
  -H "Content-Type: application/json" \
  -d '{"enabled":true}'

The above command returns JSON structure like this:

{
  "muteState": "QUARANTINED",
  "success": true
}

This endpoint can be used to toggle the mute state of a check on and off.

HTTP Request

PUT https://api.gomorpheus.com/api/monitoring/checks/:id/mute

JSON Parameters

Parameter Description
enabled Set to true or false

Delete a Check

curl -XDELETE "https://api.gomorpheus.com/api/monitoring/checks/1" \
  -H "Authorization: BEARER access_token"

The above command returns JSON structure like this:

{
  "success": true
}

A deleted check can be fetched from the API using the GET method to synchronize client side views, but can not be executed or updated.

Monitor Incidents

These entities are incidents that result from Checks. The API provides a means to list all of an account’s incidents and also update, mute, close, and reopen them.

Get All Incidents

curl "https://api.gomorpheus.com/api/monitoring/incidents"
  -H "Authorization: BEARER access_token"

The above command returns JSON structured like this:

{
  "incidents": [
    {
      "id": 12,
      "account": {
        "id": 1
      },
      "app": null,
      "autoClose": true,
      "channelId": "cdff5f78-19df-41e0-b6dc-2ab87cedeae5",
      "checkGroups": [

      ],
      "checks": [

      ],
      "comment": "",
      "displayName": "test-mysql",
      "duration": null,
      "endDate": null,
      "inUptime": true,
      "lastCheckTime": "2017-02-22T00:04:56+0000",
      "lastError": "unheard from beyond check interval limit.",
      "lastMessage": null,
      "name": "test-mysql",
      "resolution": "A network outage was resolved.",
      "severity": "critical",
      "severityId": 20,
      "startDate": "2017-02-22T00:04:56+0000",
      "status": "open",
      "visibility": "private"
    }
  ],
  "meta": {
    "offset": 0,
    "max": 25,
    "size": 25,
    "total": 63
  }
}

This endpoint retrieves all incidents.

HTTP Request

GET https://api.gomorpheus.com/api/monitoring/incidents

Query Parameters

Parameter Default Description
max 25 Max number of results to return
offset 0 Offset of records you want to load
status null Filter by status
severity null Filter by severity

Get a Specific Incident

curl "https://api.gomorpheus.com/api/monitoring/incidents/1" \
  -H "Authorization: BEARER access_token"

The above command returns JSON structured like this:

{
  "incident": {
    "id": 1,
    "account": {
      "id": 1
    },
    "app": null,
    "autoClose": true,
    "channelId": "3f2fb251-9f87-4e28-88f7-7e0df24f4d50",
    "checkGroups": [
      {
        "id": 129,
        "name": "test-nginx"
      }
    ],
    "checks": [

    ],
    "comment": null,
    "displayName": "test-nginx",
    "duration": null,
    "endDate": "2018-03-26T11:00:34+0000",
    "inUptime": true,
    "lastCheckTime": "2018-03-23T23:06:03+0000",
    "lastError": "unheard from beyond check interval limit.",
    "lastMessage": null,
    "name": "test-nginx",
    "resolution": null,
    "severity": "critical",
    "severityId": 20,
    "startDate": "2018-03-23T23:06:03+0000",
    "status": "closed",
    "visibility": "private"
  },
  "issues": [
    {
      "id": 178,
      "attachmentType": "Group",
      "app": null,
      "available": false,
      "check": null,
      "checkGroup": {
        "id": 129,
        "name": "test-nginx"
      },
      "checkStatus": null,
      "endDate": "2018-03-26T11:00:33+0000",
      "health": 0,
      "inUptime": true,
      "incident": {
        "id": 41
      },
      "lastCheckTime": null,
      "lastError": null,
      "lastMessage": null,
      "name": "test-nginx",
      "severity": "critical",
      "severityId": 10,
      "startDate": "2018-03-23T23:06:03+0000",
      "status": "closed"
    }
  ]
}

This endpoint retrieves a specific incident.

HTTP Request

GET https://api.gomorpheus.com/api/monitoring/incidents/:id

URL Parameters

Parameter Description
ID ID of the incident to retrieve

Updating an Incident

curl -XPUT "https://api.gomorpheus.com/api/monitoring/incidents/1" \
  -H "Authorization: BEARER access_token" \
  -H "Content-Type: application/json" \
  -d '{"incident":{
    "resolution": "We fixed the problem",
  }}'

The above command returns JSON structure like this:

{
  "success": true
}

This endpoint can be used to update certain properties of an incident.

HTTP Request

PUT https://api.gomorpheus.com/api/monitoring/incidents/:id

JSON Parameters

Parameter Default Description
resolution null Description of the resolution to this incident
comment null Comment on this incident
status null Set status (open or closed)
severity null Set severity (critical, warning or info)
name null Set display name(subject)
startDate null Set start time
endDate null Set end time

Mute an Incident

curl -XPUT "https://api.gomorpheus.com/api/monitoring/incidents/1/mute" \
  -H "Authorization: BEARER access_token" \
  -H "Content-Type: application/json" \
  -d '{"enabled":true}'

The above command returns JSON structure like this:

{
  "muteState": "QUARANTINED",
  "success": true
}

This endpoint can be used to toggle the mute state (inUptime) of an incident on and off.

HTTP Request

PUT https://api.gomorpheus.com/api/monitoring/incidents/:id/mute

JSON Parameters

Parameter Description
enabled Set to true or false

Close an Incident

curl -XDELETE "https://api.gomorpheus.com/api/monitoring/incidents/1" \
  -H "Authorization: BEARER access_token"

The above command returns JSON structure like this:

{
  "success": true,
  "msg": "Incident 1 is closed"
}

HTTP Request

DELETE https://api.gomorpheus.com/api/monitoring/incidents/:id

Reopen an Incident

curl -XPUT "https://api.gomorpheus.com/api/monitoring/incidents/1/reopen" \
  -H "Authorization: BEARER access_token" \
  -H "Content-Type: application/json" \
  -d '{}'

The above command returns JSON structure like this:

{
  "success": true,
  "msg": "Incident 1 is now open again"
}

This endpoint can be used to toggle the mute state (inUptime) of an incident on and off.

HTTP Request

PUT https://api.gomorpheus.com/api/monitoring/incidents/:id/reopen

Check Types

A set of APIs for fetching a list of available check types is also provided. This API can make it useful for associating a check type code to an ID for check GET and POST requests.

Get All Check Types

curl "https://api.gomorpheus.command/api/monitoring/check-types"
  -H "Authorization: BEARER access_token"

The above command returns JSON structured like this

{
  "checkTypes": [
    {
      "id": 1,
      "code": "webGetCheck",
      "createIncident": true,
      "defaultInterval": 60000,
      "iconPath": null,
      "iconType": "upload",
      "inUptime": true,
      "metricName": "response",
      "name": "Web Check",
      "tunnelSupported": true
    },
    {
      "id": 2,
      "code": "mysqlCheck",
      "createIncident": true,
      "defaultInterval": 60000,
      "iconPath": null,
      "iconType": "upload",
      "inUptime": true,
      "metricName": "result",
      "name": "MySQL Check",
      "tunnelSupported": true
    },
    {
      "id": 3,
      "code": "mongoCheck",
      "createIncident": true,
      "defaultInterval": 300000,
      "iconPath": null,
      "iconType": "upload",
      "inUptime": true,
      "metricName": "result",
      "name": "Mongo Check",
      "tunnelSupported": true
    },
    {
      "id": 4,
      "code": "elasticSearchCheck",
      "createIncident": true,
      "defaultInterval": 60000,
      "iconPath": null,
      "iconType": "upload",
      "inUptime": true,
      "metricName": "cluster status",
      "name": "Elastic Search Check",
      "tunnelSupported": true
    },
    {
      "id": 5,
      "code": "riakCheck",
      "createIncident": true,
      "defaultInterval": 300000,
      "iconPath": null,
      "iconType": "upload",
      "inUptime": true,
      "metricName": "write time",
      "name": "Riak Check",
      "tunnelSupported": true
    },
    {
      "id": 6,
      "code": "redisCheck",
      "createIncident": true,
      "defaultInterval": 300000,
      "iconPath": null,
      "iconType": "upload",
      "inUptime": true,
      "metricName": "key count",
      "name": "Redis Check",
      "tunnelSupported": true
    },
    {
      "id": 7,
      "code": "rabbitCheck",
      "createIncident": true,
      "defaultInterval": 60000,
      "iconPath": null,
      "iconType": "upload",
      "inUptime": true,
      "metricName": "queue count",
      "name": "Rabbit MQ Check",
      "tunnelSupported": true
    },
    {
      "id": 9,
      "code": "postgresCheck",
      "createIncident": true,
      "defaultInterval": 300000,
      "iconPath": null,
      "iconType": "upload",
      "inUptime": true,
      "metricName": "result",
      "name": "Postgres Check",
      "tunnelSupported": true
    },
    {
      "id": 10,
      "code": "sqlCheck",
      "createIncident": true,
      "defaultInterval": 300000,
      "iconPath": null,
      "iconType": "upload",
      "inUptime": true,
      "metricName": "result",
      "name": "Microsoft SQL Server",
      "tunnelSupported": true
    },
    {
      "id": 11,
      "code": "socketCheck",
      "createIncident": true,
      "defaultInterval": 60000,
      "iconPath": null,
      "iconType": "upload",
      "inUptime": true,
      "metricName": "response",
      "name": "Socket Check",
      "tunnelSupported": true
    },
    {
      "id": 12,
      "code": "pushCheck",
      "createIncident": true,
      "defaultInterval": 300000,
      "iconPath": null,
      "iconType": "upload",
      "inUptime": true,
      "metricName": "result",
      "name": "Push API Check",
      "tunnelSupported": false
    },
    {
      "id": 13,
      "code": "pingCheck",
      "createIncident": true,
      "defaultInterval": 300000,
      "iconPath": null,
      "iconType": "upload",
      "inUptime": true,
      "metricName": "result",
      "name": "Ping Check",
      "tunnelSupported": true
    }
  ]
}

HTTP Request

GET https://api.gomorpheus.com/api/monitoring/check-types

Get Specific Check Type

curl "https://api.gomorpheus.com/api/monitoring/check-types/10"
  -H "Authorization: BEARER access_token"

The above command returns JSON structured like this

{
  "success": true,
  "checkType": {
    "id": 10,
    "code": "sqlCheck",
    "createIncident": true,
    "defaultInterval": 300000,
    "iconPath": null,
    "iconType": "upload",
    "inUptime": true,
    "metricName": "result",
    "name": "Microsoft SQL Server",
    "tunnelSupported": true
  }
}

HTTP Request

GET https://api.gomorpheus.com/api/monitoring/check-types/1

Server Groups

Server 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.

Get All Groups

curl "https://api.gomorpheus.com/api/groups"
  -H "Authorization: BEARER access_token"

The above command returns JSON structured like this:

{
  "groups": [
    {
      "id": 1,
      "accountId": 1,
      "name": "Amazon East",
      "code": "amazon",
      "active": true,
      "location": null,
      "visibility": "public",
      "zones": [
        {
          "id": 1,
          "accountId": 1,
          "groupId": 1,
          "name": "VPC 1a",
          "description": "1a VPC Subnet",
          "location": null,
          "visibility": "public",
          "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 null A date filter, restricts query to only load groups updated more recent or equal to the date specified
name null If specified will return an exact match group

Get a Specific Group

curl "https://api.gomorpheus.com/api/groups/1" \
  -H "Authorization: BEARER access_token"

The above command returns JSON structured like this:

{
  "success": true,
  "group": {
    "id": 1,
    "accountId": 1,
    "name": "Vagrant",
    "code": null,
    "active": true,
    "location": null,
    "visibility": "public",
    "zones": [
      {
        "id": 1,
        "accountId": 1,
        "groupId": 1,
        "name": "Davids Laptop",
        "description": "My Laptop Vagrant",
        "location": null,
        "visibility": "public",
        "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 "https://api.gomorpheus.com/api/groups" \
  -H "Authorization: BEARER access_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 Parameters

Parameter Default Description
name null A unique name scoped to your account for the group
description null Optional description field if you want to put more info there
code null Optional code for use with policies
location null Optional location argument for your group

Updating a Group

curl -XPUT "https://api.gomorpheus.com/api/groups/1" \
  -H "Authorization: BEARER access_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

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

JSON Check Parameters

Parameter Default Description
name null A unique name scoped to your account for the group
description null Optional description field if you want to put more info there
code null Optional code for use with policies
location null Optional location for your group

Updating Group Zones

curl -XPUT "https://api.gomorpheus.com/api/groups/1/update-zones" \
  -H "Authorization: BEARER access_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 Check Parameters

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

Delete a Group

curl -XDELETE "https://api.gomorpheus.com/api/groups/1" \
  -H "Authorization: BEARER access_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

Compute Zones

Zones are a means of zoning various servers based on provisioning type or subnets. Typically a Zone belongs to a zone and a zone can have many zones. There are several supported zone types that can be used for hardware/vm procurement such as the OpenStack zone type. The zone holds the credentials necessary to provision virtual machines on the open stack api. Amazon is another openstack zone type currently in the works. Of course, we also have the Standard zone type which allows for manual vm procurement.

Get All Zones

curl "https://api.gomorpheus.com/api/zones"
  -H "Authorization: BEARER access_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 null A date filter, restricts query to only load zones updated more recent or equal to the date specified
name null If specified will return an exact match zone
type null If specified will return all zones by type code (standard,openstack,amazon)
groupId null If specified will return all zones assigned to a server group by id.

Get a Specific Zone

curl "https://api.gomorpheus.com/api/zones/1" \
  -H "Authorization: BEARER access_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 Zone

curl -XPOST "https://api.gomorpheus.com/api/zones" \
  -H "Authorization: BEARER access_token" \
  -H "Content-Type: application/json" \
  -d '{"zone":{
    "name": "My Zone",
    "code": "myzone",
    "description": "My description",
    "location": "US EAST",
    "zoneType": {"code": "standard"},
    "groupId": 1
  }}'

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

HTTP Request

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

JSON Check Parameters

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

Additional properties are dynamic for the most part depending on teh zone/cloud type. To determine what these are please look at the optionTypes list on the ZoneType record.

Updating a Zone

curl -XPUT "https://api.gomorpheus.com/api/zones/1" \
  -H "Authorization: BEARER access_token" \
  -H "Content-Type: application/json" \
  -d '{"zone":{
    "name": "My Zone",
    "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 Check Parameters

Parameter Default Description
name null A unique name scoped to your account for the zone
description null Optional description field if you want to put more info there
code null Optional code for use with policies
location null Optional location for your zone
visibility private private or public
groupId null Specifies which Server group this zone should be assigned to
config null 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 properties are dynamic for the most part depending on the zone/cloud type. To determine what these are please look at the optionTypes list on the ZoneType record.

Delete a Zone

curl -XDELETE "https://api.gomorpheus.com/api/zones/1" \
  -H "Authorization: BEARER access_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

Get Security Groups

curl -XGET "https://api.gomorpheus.com/api/zones/1/security-groups" \
  -H "Authorization: BEARER access_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 "https://api.gomorpheus.com/api/zones/1/security-groups" \
  -H "Authorization: BEARER access_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

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

JSON Parameters

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

Disable the firewall

curl -XPUT "https://api.gomorpheus.com/api/zones/1/security-groups/disable" \
  -H "Authorization: BEARER access_token"

The above command returns JSON structure like this:

{
  "success": true
}

This will disable the firewall. Any configured security groups will not be applied.

HTTP Request

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

Enable the firewall

curl -XPUT "https://api.gomorpheus.com/api/zones/1/security-groups/enable" \
  -H "Authorization: BEARER access_token"

The above command returns JSON structure like this:

{
  "success": true
}

This will enable the firewall. Any configured security groups will be applied.

HTTP Request

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

Zone Types

Provides a means to find out which zone types are available for zone provisioning and in the future what config properties are required. NOTE: A Zone Type in the API Is equivalent to a Cloud Type within the morpheus UI. .

Get All Zone Types

curl "https://api.gomorpheus.com/api/zone-types"
  -H "Authorization: BEARER access_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

Get Specific Zone Type

curl "https://api.gomorpheus.com/api/zone-types/1"
  -H "Authorization: BEARER access_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.

Get All Data Stores for Cloud

curl "https://api.gomorpheus.com/api/zones/5/data-stores"
  -H "Authorization: BEARER access_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 null Filter on partial match of name
name null Filter on exact match of name

Get a Specific Data Store

curl "https://api.gomorpheus.com/api/zones/5/data-stores/50" \
  -H "Authorization: BEARER access_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 "https://api.gomorpheus.com/api/zones/5/data-stores/50" \
  -H "Authorization: BEARER access_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 null Activate (true) or disable (false) the datastore
visibility private private or public
tenantPermissions.accounts null Array of tenant account ids that are allowed access
resourcePermissions.all null Pass true to allow access all groups
resourcePermissions.sites null Array of groups that are allowed access

Storage Buckets

Provides API interfaces for managing Storage Buckets (Object Stores and File Shares).

Get All Storage Buckets

curl "https://api.gomorpheus.com/api/storage/buckets"
  -H "Authorization: BEARER access_token"

The above command returns JSON structured like this:

{
  "storageBuckets": [
    {
      "id": 1,
      "name": "s3 test",
      "accountId": 1,
      "providerType": "s3",
      "config": {
        "accessKey": "G429AED2C4L5YZB7Q",
        "secretKey": "************",
        "endpoint": ""
      },
      "bucketName": "morpheus-s3-test",
      "readOnly": false,
      "defaultBackupTarget": false,
      "defaultDeploymentTarget": false,
      "defaultVirtualImageTarget": false,
      "copyToStore": true
    },
    {
      "id": 2,
      "name": "testdrive",
      "accountId": 1,
      "providerType": "local",
      "config": {
        "basePath": "/tmp/testdrive"
      },
      "bucketName": ".",
      "readOnly": false,
      "defaultBackupTarget": false,
      "defaultDeploymentTarget": false,
      "defaultVirtualImageTarget": false,
      "copyToStore": false
    }
  ],
  "meta": {
    "offset": 0,
    "max": 25,
    "size": 2,
    "total": 2
  }
}

This endpoint retrieves all storage buckets associated with the account.

HTTP Request

GET https://api.gomorpheus.com/api/storage/buckets

Query Parameters

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

Get a Specific Storage Bucket

curl "https://api.gomorpheus.com/api/storage/buckets/1" \
  -H "Authorization: BEARER access_token"

The above command returns JSON structured like this:

{
  "storageBucket": {
    "id": 1,
    "name": "s3 test",
    "accountId": 1,
    "providerType": "s3",
    "config": {
      "accessKey": "G429AED2C4L5YZB7Q",
      "secretKey": "************",
      "endpoint": ""
    },
    "bucketName": "morpheus-s3-test",
    "readOnly": false,
    "defaultBackupTarget": false,
    "defaultDeploymentTarget": false,
    "defaultVirtualImageTarget": false,
    "copyToStore": true,
    "retentionPolicyType": null,
    "retentionPolicyDays": null,
    "retentionProvider": null
  }
}

This endpoint retrieves a specific storage bucket.

HTTP Request

GET https://api.gomorpheus.com/api/storage/buckets/:id

URL Parameters

Parameter Description
ID The ID of the storage bucket to retrieve

Create a Storage Bucket

curl -XPOST "https://api.gomorpheus.com/api/storage/buckets" \
  -H "Authorization: BEARER access_token" \
  -H "Content-Type: application/json" \
  -d '{
  "storageBucket": {
    "name": "test-storage",
    "providerType": "local",
    "config": {
      "basePath": "/tmp/test-storage"
    },
    "defaultBackupTarget": false,
    "copyToStore": true,
    "defaultDeploymentTarget": false,
    "defaultVirtualImageTarget": false,
    "retentionPolicyType": null,
    "retentionPolicyDays": null,
    "retentionProvider": null
  }
}'

The above command returns JSON structured like getting a single storage bucket:

HTTP Request

POST https://api.gomorpheus.com/api/storage/buckets

JSON Parameters

Parameter Default Description
name null A unique name scoped to your account for the storage bucket
providerType null The type of storage bucket. [s3, azure, cifs, local, nfs, openstack, rackspace]
config null A map of config values. The expected values vary by providerType.
bucketName null The name of the bucket. Only applies to certain types eg. s3
createBucket false Create the bucket if it does not exist. Only applies to certain types eg. s3
defaultBackupTarget null Default Backup Target
copyToStore null Archive Snapshots
defaultDeploymentTarget null Default Deployment Target
defaultVirtualImageTarget null Default Virtual Image Store
retentionPolicyType null Cleanup mode. backup - Move old files to a backup provider. delete - Delete old files. none (default) - Keep all files.
retentionPolicyDays null The number of days old a file must be before it is deleted.
retentionProvider null The backup Storage Bucket where old files are moved to.

Amazon S3 (s3)

Parameter Default Description
config.accessKey null Access Key
config.secretKey null Secret Key
bucketName null Bucket Name
createBucket false Create the bucket if it does not exist
config.region null Optional Amazon region if creating a new bucket
config.endpoint null Optional endpoint URL if pointing to an object store other than amazon that mimics the Amazon S3 APIs.

Azure (azure) Parameters

Parameter Default Description
config.storageAccount null Storage Account
config.storageKey null Storage Key
bucketName null Bucket Name
createBucket false Create the bucket if it does not exist

CIFS (cifs) Parameters

Parameter Default Description
config.host null Host
config.username null Username
config.password null Password
bucketName null Bucket Name

Local Storage (local) Parameters

Parameter Default Description
config.basePath null Storage Path

NFSv3 (nfs) Parameters

Parameter Default Description
config.host null Host
config.exportFolder null Export Folder
bucketName null Bucket Name

Openstack Swift (openstack) Parameters

Parameter Default Description
config.username null Username
config.apiKey null API Key
config.region null Region
bucketName null Bucket Name
createBucket false Create the bucket if it does not exist
config.identityUrl null Identity URL

Rackspace CDN (rackspace) Parameters

Parameter Default Description
config.username null Username
config.apiKey null API Key
config.region null Region
bucketName null Bucket Name
createBucket false Create the bucket if it does not exist

Update a Storage Bucket

curl -XPUT "https://api.gomorpheus.com/api/storage/buckets/1" \
  -H "Authorization: BEARER access_token" \
  -H "Content-Type: application/json" \
  -d '{
  "storageBucket": {
    "name": "my-storage",
    "copyToStore": true
  }
}'

The above command returns JSON structured like getting a single storage bucket:

HTTP Request

PUT https://api.gomorpheus.com/api/storage/buckets/1

JSON Parameters

See Create.

Delete a Storage Bucket

curl -XDELETE "https://api.gomorpheus.com/api/storage/buckets/1" \
  -H "Authorization: BEARER access_token"

The above command returns JSON Structured like this:

{
  "success": true
}

Will delete a storage bucket from the system and make it no longer usable.

HTTP Request

DELETE https://api.gomorpheus.com/api/storage/buckets/:id

URL Parameters

Parameter Description
ID The ID of the storage bucket

Compute Servers

A Compute 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 server statistics and logs back to the morpheus stack.

Get All Servers

curl "https://api.gomorpheus.com/api/servers"
  -H "Authorization: BEARER access_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 all servers and their JSON encoded configuration attributes based on check type. Server data is encrypted in the database.

HTTP Request

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

Query Parameters

Parameter Default Description
max 25 Max number of results to return
offset 0 Offset of records you want to load
lastUpdated null Date filter, restricts query to only load servers updated timestamp is more recent or equal to the date specified

Get a Specific Server

curl "https://api.gomorpheus.com/api/servers/1" \
  -H "Authorization: BEARER access_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 server.

HTTP Request

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

URL Parameters

Parameter Description
ID ID of the check to retrieve

Provision a Server

curl -XPOST "https://api.gomorpheus.com/api/servers" \
  -H "Authorization: BEARER access_token" \
  -H "Content-Type: application/json" \
  -d '{ "server": {
  "name": "dre-matrix-3",
  "description": "dre-matrix-3",
  "zone": {"id":1},
  "sshHost": "10.100.54.4",
  "sshUsername": "vagrant",
  "sshPassword": "vagrant",
  "dataDevice": "/dev/sdb"
  },
  "network": {
    "name": "eth1"
  }}'

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/servers

JSON Server Parameters

Parameter Default Description
name null Unique name scoped to your account for the server
description null Optional description field
zone null The zone id we want to assign the server to.
sshHost null reachable ip address for the server to remote in and provision the server
sshUsername null ssh username to use when provisioning
sshPassword null optional ssh password to use, if not specified the account public key can be used
dataDevice null the mount point for the lvm volume that needs to be created

Updating a Server

curl -XPUT "https://api.gomorpheus.com/api/servers/1" \
  -H "Authorization: BEARER access_token" \
  -H "Content-Type: application/json" \
  -d '{ "server": {
  "name": "dre-matrix-3",
  "description": "dre-matrix-3"
  }}'

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/servers/:id

JSON Server Parameters

Parameter Default Description
name null Unique name scoped to your account for the server
description null Optional description field

Install Agent

curl -XPUT "https://api.gomorpheus.com/api/servers/1/install-agent" \
  -H "Authorization: BEARER access_token" \
  -H "Content-Type: application/json" \
  -d '{ "server": {
  "sshUsername": "admin",
  "sshPassword": "asafepassword",
  "serverOs": {"id": 1}
  }}'

The above command returns JSON structure like this:

{
  "success": true
}

This will make the server a managed server, and install the agent.

JSON Server Parameters

Parameter Default Description
sshUsername null ssh username to use when provisioning
sshPassword null ssh password to use, if not specified the account public key can be used
serverOs.id null The ID os the OS Type for this server. See GET /api/options/osTypes

Upgrade Agent

curl -XPUT "https://api.gomorpheus.com/api/servers/1/upgrade" \
  -H "Authorization: BEARER access_token"

The above command returns JSON structure like this:

{
  "success": true
}

This will upgrade the version of the install installed on the server.

HTTP Request

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

Resize a Server

curl -XPUT "https://api.gomorpheus.com/api/servers/1/resize" \
  -H "Authorization: BEARER access_token"
  -H "Content-Type: application/json" \
  -d '{
    "server": {
      "id": 82,
      "plan": {
        "id": 76
      }
    },
    "volumes": [
      {
        "id": 419,
        "rootVolume": true,
        "name": "root",
        "size": 10,
        "sizeId": null,
        "storageType": 1,
        "datastoreId": "auto"
      }
    ],
    "deleteOriginalVolumes": true
  }'

The above command returns JSON structure like this:

{
  "success": true
}

Will resize a server asynchronously.

HTTP Request

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

JSON Server Parameters

Parameter Default Description
server.plan.id null The ID of the new plan (optional).
volumes null List of volumes with their new sizes.
deleteOriginalVolumes false Delete the original volumes after resizing. (Amazon only)

Delete a Server

curl -XDELETE "https://api.gomorpheus.com/api/servers/1" \
  -H "Authorization: BEARER access_token"

The above command returns JSON structure like this:

{
  "success": true
}

Will delete a server asynchronously and remove from the hosted chef system.

HTTP Request

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

Query Parameters

Parameter Default Description
removeResources on if server is managed. Remove Infrastructure.
removeInstances off Remove Associated Instances
preserveVolumes off Preserve Volumes
releaseEIPs on Release EIPs
force off Force Delete

Compute Server Types

A Compute Server Type is the description of the technology (bare metal or virtual) being deployed onto.

Get All Server Types

curl "https://api.gomorpheus.com/api/server-types"
  -H "Authorization: BEARER access_token"

The above command returns JSON structured like this:

{
  "serverTypes":[
    {
      "id":19,
      "code":"softlayerVm",
      "name":"Softlayer Instance",
      "description":"",
      "platform":"linux",
      "nodeType":"morpheus-vm-node",
      "managed":true,
      "enabled":true,
      "vmHypervisor":false,
      "containerHypervisor":false,
      "displayOrder":0,
      "selectable":false,
      "controlPower":true,
      "controlSuspend":true,
      "hasAgent":true,
      "creatable":false,
      "optionTypes":[

      ]
    },
    {
      "id":23,
      "code":"amazonVm",
      "name":"Amazon Instance",
      "description":"",
      "platform":"linux",
      "nodeType":"morpheus-vm-node",
      "managed":true,
      "enabled":true,
      "vmHypervisor":false,
      "containerHypervisor":false,
      "displayOrder":0,
      "selectable":false,
      "controlPower":true,
      "controlSuspend":true,
      "hasAgent":true,
      "creatable":false,
      "optionTypes":[

      ]
    },
    {
      "id":31,
      "code":"vmwareVm",
      "name":"Vmware Instance",
      "description":"",
      "platform":"linux",
      "nodeType":"morpheus-vm-node",
      "managed":true,
      "enabled":true,
      "vmHypervisor":false,
      "containerHypervisor":false,
      "displayOrder":0,
      "selectable":false,
      "controlPower":true,
      "controlSuspend":true,
      "hasAgent":true,
      "creatable":false,
      "optionTypes":[

      ]
    },
    {
      "id":39,
      "code":"nutanixVm",
      "name":"Nutanix Instance",
      "description":"",
      "platform":"linux",
      "nodeType":"morpheus-vm-node",
      "managed":true,
      "enabled":true,
      "vmHypervisor":false,
      "containerHypervisor":false,
      "displayOrder":0,
      "selectable":false,
      "controlPower":true,
      "controlSuspend":true,
      "hasAgent":true,
      "creatable":false,
      "optionTypes":[

      ]
    },
    {
      "id":43,
      "code":"xenserverVm",
      "name":"Xen Instance",
      "description":"",
      "platform":"linux",
      "nodeType":"morpheus-vm-node",
      "managed":true,
      "enabled":true,
      "vmHypervisor":false,
      "containerHypervisor":false,
      "displayOrder":0,
      "selectable":false,
      "controlPower":true,
      "controlSuspend":true,
      "hasAgent":true,
      "creatable":false,
      "optionTypes":[

      ]
    },
    {
      "id":14,
      "code":"metapodLinux",
      "name":"Metapod Linux Node",
      "description":"",
      "platform":"linux",
      "nodeType":"morpheus-node",
      "managed":true,
      "enabled":true,
      "vmHypervisor":false,
      "containerHypervisor":false,
      "displayOrder":2,
      "selectable":false,
      "controlPower":true,
      "controlSuspend":true,
      "hasAgent":true,
      "creatable":true,
      "optionTypes":[

      ]
    },
    {
      "id":8,
      "code":"openstackLinux",
      "name":"Openstack Linux Node",
      "description":"",
      "platform":"linux",
      "nodeType":"morpheus-node",
      "managed":true,
      "enabled":true,
      "vmHypervisor":false,
      "containerHypervisor":false,
      "displayOrder":4,
      "selectable":false,
      "controlPower":true,
      "controlSuspend":true,
      "hasAgent":true,
      "creatable":true,
      "optionTypes":[
        {
          "name":"osUsr",
          "type":"text",
          "defaultValue":null,
          "placeHolder":null,
          "required":true,
          "fieldName":"osUsr",
          "fieldContext":"config"
        },
        {
          "name":"flavorId",
          "type":"selectOsFlavor",
          "defaultValue":null,
          "placeHolder":null,
          "required":true,
          "fieldName":"flavorId",
          "fieldContext":"config"
        },
        {
          "name":"imageId",
          "type":"selectOsImage",
          "defaultValue":null,
          "placeHolder":null,
          "required":true,
          "fieldName":"imageId",
          "fieldContext":"config"
        },
        {
          "name":"osNetworkId",
          "type":"selectOsNetwork",
          "defaultValue":null,
          "placeHolder":null,
          "required":true,
          "fieldName":"osNetworkId",
          "fieldContext":"config"
        },
        {
          "name":"diskSize",
          "type":"text",
          "defaultValue":null,
          "placeHolder":null,
          "required":true,
          "fieldName":"diskSize",
          "fieldContext":"config"
        },
        {
          "name":"templateTypeSelect",
          "type":"radio",
          "defaultValue":null,
          "placeHolder":null,
          "required":true,
          "fieldName":"templateTypeSelect",
          "fieldContext":"config"
        },
        {
          "name":"floatingIp",
          "type":"checkbox",
          "defaultValue":null,
          "placeHolder":null,
          "required":true,
          "fieldName":"floatingIp",
          "fieldContext":"config"
        },
        {
          "name":"osPwd",
          "type":"password",
          "defaultValue":null,
          "placeHolder":null,
          "required":true,
          "fieldName":"osPwd",
          "fieldContext":"config"
        },
        {
          "name":"diskMode",
          "type":"selectDiskMode",
          "defaultValue":null,
          "placeHolder":null,
          "required":true,
          "fieldName":"diskMode",
          "fieldContext":"config"
        },
        {
          "name":"securityGroup",
          "type":"selectOpenstackSecurityGroup",
          "defaultValue":null,
          "placeHolder":null,
          "required":true,
          "fieldName":"securityGroup",
          "fieldContext":"config"
        },
        {
          "name":"publicKeyId",
          "type":"keyPairSelect",
          "defaultValue":null,
          "placeHolder":null,
          "required":true,
          "fieldName":"publicKeyId",
          "fieldContext":"config"
        },
        {
          "name":"serverGroup",
          "type":"selectOpenstackServerGroup",
          "defaultValue":null,
          "placeHolder":null,
          "required":true,
          "fieldName":"serverGroup",
          "fieldContext":"config"
        }
      ]
    }
  ]
}

HTTP Request

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

Query Parameters

Parameter Default Description
max 25 Max number of results to return
offset 0 Offset of records you want to load

Get a Specific Server Type

curl "https://api.gomorpheus.com/api/server-types/1" \
  -H "Authorization: BEARER access_token"

The above command returns JSON structured like this:

{
  "success": true,
  "serverType": {
    "id": 19,
    "code": "softlayerVm",
    "name": "Softlayer Instance",
    "description": "",
    "platform": "linux",
    "nodeType": "morpheus-vm-node",
    "managed": true,
    "enabled": true,
    "vmHypervisor": false,
    "containerHypervisor": false,
    "displayOrder": 0,
    "selectable": false,
    "controlPower": true,
    "controlSuspend": true,
    "hasAgent": true,
    "creatable": false,
    "optionTypes": []
  }
}

This endpoint will retrieve a specific server type by id

HTTP Request

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

URL Parameters

Parameter Description
ID The ID of the server type

Virtual Images

Virtual Images can be managed via the API.

Get List of Virtual Images

curl "https://api.gomorpheus.com/api/virtual-images"
  -H "Authorization: BEARER access_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 null Filter by name
phrase null Filter by wildcard search of name
lastUpdated null 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 null Filter by image type code, “vmware”, “ami”, etc

Get a Specific Virtual Image

curl "https://api.gomorpheus.com/api/virtual-images/764" \
  -H "Authorization: BEARER access_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": "morpheus-virtual-images/764/testimage.vmdk",
      "size": 1034592
    },
    {
      "name": "morpheus-virtual-images/764/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 "https://api.gomorpheus.com/api/virtual-images" \
  -H "Authorization: BEARER access_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 null A name for the virtual image
imageType null Code of image type. eg. vmware, ami, etc.
storageProvider null A Map containing the id of the Storage Provider
isCloudInit false Cloud Init Enabled? true or false
userData null Cloud-Init User Data, a bash script
installAgent false Install Agent? true or false
sshUsername null SSH Username
sshPassword null SSH Password
sshKey null SSK Key
osType null 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 null 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 "https://api.gomorpheus.com/api/virtual-images/765/upload" \
  -H "Authorization: BEARER access_token" \
  -F 'file=@filename'

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

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 destination file. The base filename of the uploaded file is the default.

Remove Virtual Image File

curl -XDELETE "https://api.gomorpheus.com/api/virtual-images/765/files?filename=testimage.ovf" \
  -H "Authorization: BEARER access_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

Parameters

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

Delete a Virtual Image

curl -XDELETE "https://api.gomorpheus.com/api/virtual-images/765" \
  -H "Authorization: BEARER access_token"

The above command returns JSON structure like this:

{
  "success": true
}

Will delete a virtual image and any associated files.

SSL Certificates

Morpheus provides a database for keeping track of SSL Certificates in the system. These can be applied to various load balancers within the system and instances that use them.

Get All SSL Certificates

curl "https://api.gomorpheus.com/api/certificates"
  -H "Authorization: BEARER access_token"

The above command returns JSON structured like this:

{
  "certificateCount": 1,
  "certificates": [
    {
      "accountId": 1,
      "certFile": "certFileContent",
      "domainName": "test.local",
      "generated": false,
      "id": 1,
      "keyFile": "keyFileContent",
      "name": "Test Cert",
      "wildcard": true
    }
  ]
}

This endpoint retrieves all key pairs associated with the account.

HTTP Request

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

Query Parameters

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

Get a Specific Certificate

curl "https://api.gomorpheus.com/api/certificates/1" \
  -H "Authorization: BEARER access_token"

The above command returns JSON structured like this:

{
  "certificate": {
    "accountId": 1,
    "certFile": "certFileContent",
    "domainName": "test.local",
    "generated": false,
    "id": 1,
    "keyFile": "keyFileContent",
    "name": "Test Cert",
    "wildcard": true
  },
  "succcess": true
}

This endpoint retrieves a specific key.

HTTP Request

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

URL Parameters

Parameter Description
ID The ID of the key pair to retrieve

Create a Certificate

curl -XPOST "https://api.gomorpheus.com/api/certificates" \
  -H "Authorization: BEARER access_token" \
  -H "Content-Type: application/json" \
  -d '{"certificate":{
    "name": "My Cert",
    "certFile": "my cert file contents",
    "keyFile": "My keyfile",
    "domainName": "Domain name of cert",
    "wildcard": false
  }}'

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

HTTP Request

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

JSON Check Parameters

Parameter Default Description
name null A unique name scoped to your account for the key
certFile null The contents of the certificate file
keyFile null The contents of the key file
wildcard false Wether or not this certificate is a wildcard cert
domainName null The domain name this certificate is tied to

Updating a Certificate

curl -XPUT "https://api.gomorpheus.com/api/certificates/1" \
  -H "Authorization: BEARER access_token" \
  -H "Content-Type: application/json" \
  -d '{"certificate":{
    "name": "My Cert",
    "certFile": "my cert file contents",
    "keyFile": "My keyfile",
    "domainName": "Domain name of cert",
    "wildcard": false
  }}'

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

HTTP Request

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

JSON Check Parameters

Parameter Default Description
name null A unique name scoped to your account for the key
certFile null The contents of the certificate file
keyFile null The contents of the key file
wildcard false Wether or not this certificate is a wildcard cert
domainName null The domain name this certificate is tied to

Delete a Certificate

curl -XDELETE "https://api.gomorpheus.com/api/certificates/1" \
  -H "Authorization: BEARER access_token"

The above command returns JSON Structured like this:

{
  "success": true
}

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

Key Pairs

Morpheus provides a database for keeping track of Key Pairs in the system. These can be used for provisioning servers and auto assigning added keypairs.

Get All Key Pairs

curl "https://api.gomorpheus.com/api/key-pairs"
  -H "Authorization: BEARER access_token"

The above command returns JSON structured like this:

{
  "keyPairCount": 1,
  "keyPairs": [
    {
      "accountId": 1,
      "id": 2,
      "name": "Test",
      "privateKey": null,
      "publicKey": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDXhVj5Oe88bXPmNA32iZ0ijlgbTkeCgnTkLwDyGfOTBH56QR9gwU66B1mh+ceU/lm1jS0zNuHtGFiMabbL+7a+MgJ7HVuaV4CR2/a/cp1yEzvvuJE6IvoGzDiXIdafasdfxcvdfadfVcEyOn+TW16rbS6GR/IwuvS81GqSJ6Z5/IJh4R5IW5yzK6z6BTHtX+vQQN9xv60JmwBC1NO5UVps2KVDBSCildlNlPR4AFrtVYDPSjRmjvj3DjGnJ6YlgjFIgc23bk1t0pknocgkB+7QZrkt1ed6AWVojGTUo2B9Cd/MphCKfZ davydotcom@Davids-MacBook-Pro-2.local"
    }
  ],
  "success": true
}

This endpoint retrieves all key pairs associated with the account.

HTTP Request

GET https://api.gomorpheus.com/api/key-pairs

Query Parameters

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

Get a Specific Key Pair

curl "https://api.gomorpheus.com/api/key-pairs/2" \
  -H "Authorization: BEARER access_token"

The above command returns JSON structured like this:

{
  "keyPair": {
    "accountId": 1,
    "id": 2,
    "name": "Test",
    "privateKey": null,
    "publicKey": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDXhVj5Oe88bXPmNA32iZ0ijlgbTkeCgnTkLwDyGfOTBH56QR9gwU66B1mh+ceU/lm1jS0zNuHtGFiMabbL+7a+MgJ7HVuaV4CR2/a/cp1yEzvvuJE6IvoGzDiXIdafasdfxcvdfadfVcEyOn+TW16rbS6GR/IwuvS81GqSJ6Z5/IJh4R5IW5yzK6z6BTHtX+vQQN9xv60JmwBC1NO5UVps2KVDBSCildlNlPR4AFrtVYDPSjRmjvj3DjGnJ6YlgjFIgc23bk1t0pknocgkB+7QZrkt1ed6AWVojGTUo2B9Cd/MphCKfZ davydotcom@Davids-MacBook-Pro-2.local"
  },
  "success": true
}

This endpoint retrieves a specific key.

HTTP Request

GET https://api.gomorpheus.com/api/key-pairs/:id

URL Parameters

Parameter Description
ID The ID of the key pair to retrieve

Create a KeyPair

curl -XPOST "https://api.gomorpheus.com/api/key-pairs" \
  -H "Authorization: BEARER access_token" \
  -H "Content-Type: application/json" \
  -d '{"keyPair":{
    "name": "My Key",
    "publicKey": "ssh-rsa",
    "privateKey": "privateKey Optional for most cases"
  }}'

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

HTTP Request

POST https://api.gomorpheus.com/api/key-pairs

JSON Check Parameters

Parameter Default Description
name null A unique name scoped to your account for the key
publicKey null The public key pair value
privateKey null The private key pair value (optional)

NOTE The Public and Private key are stored in encrypted form in the database.

Delete a Key Pair

curl -XDELETE "https://api.gomorpheus.com/api/key-pairs/1" \
  -H "Authorization: BEARER access_token"

The above command returns JSON Structured like this:

{
  "success": true
}

Will delete a key pair from the system and make it no longer usable.

Accounts

Provides API interfaces for managing the creation and modification of accounts within Morpheus (Typically only accessible by the Master Account)

Get All Accounts

curl "https://api.gomorpheus.com/api/accounts"
  -H "Authorization: BEARER access_token"

The above command returns JSON structured like this:

{
  "accounts": [
    {
      "id": 1,
      "name": "Root Account",
      "description": "The master account",
      "currency": "USD",
      "instanceLimits": null,
      "lastUpdated": "2015-11-10T18:58:55+0000",
      "dateCreated": "2015-11-10T18:58:55+0000",
      "role": {
        "id": 1,
        "authority": "System Admin",
        "description": "Super User"
      },
      "active": true
    }
  ],
  "meta": {
    "offset": 0,
    "max": 25,
    "size": 1,
    "total": 1
  }
}

This endpoint retrieves all accounts.

HTTP Request

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

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 null Filter by matching name or description
name null Filter by name
lastUpdated null Date filter, restricts query to only load accounts updated timestamp is more recent or equal to the date specified

Get a Specific Account

curl "https://api.gomorpheus.com/api/accounts/1" \
  -H "Authorization: BEARER access_token"

The above command returns JSON structured like this:

{
  "account": {
    "id": 1,
    "name": "Root Account",
    "description": "The master account",
    "currency": "USD",
    "instanceLimits": null,
    "externalId": null,
    "lastUpdated": "2015-11-10T18:58:55+0000",
    "dateCreated": "2015-11-10T18:58:55+0000",
    "role": {
      "id": 1,
      "authority": "System Admin",
      "description": "Super User"
    },
    "active": true
  }
}

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/accounts/:id

Create an Account

curl -XPOST "https://api.gomorpheus.com/api/accounts" \
  -H "Authorization: BEARER access_token" \
  -H "Content-Type: application/json" \
  -d '{"account":{
    "name": "My New Account",
    "description": "My description",
    "instanceLimits": {
      "maxCpu": 0,
      "maxMemory": 0,
      "maxStorage": 0
    },
    role: {
      id: 2
    }
  }}'

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

HTTP Request

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

JSON Account Parameters

Parameter Default Description
name null A unique name for the account
description null Optional description field if you want to put more info there
role Account Admin A nested id of the default role for the account
instanceLimits null Optional JSON Map of maxCpu, maxMemory (bytes) and maxStorage (bytes) restrictions (0 means unlimited). The parameters maxMemoryMiB, maxMemoryGiB, maxStorageMiB and maxStorageGiB can be used to pass values in larger units.

Updating an Account

curl -XPUT "https://api.gomorpheus.com/api/accounts/2" \
  -H "Authorization: BEARER access_token" \
  -H "Content-Type: application/json" \
  -d '{"account":{
    "name": "My New Account",
    "description": "My new description",
    "instanceLimits": {
      "maxCpu": 0,
      "maxMemory": 0,
      "maxStorage": 0
    },
    "role": {
      id: 3
    }
  }}'

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

HTTP Request

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

JSON Account Parameters

Parameter Default Description
name null A unique name for the account
description null Optional description field if you want to put more info there
role null A nested id of the default role for the account
instanceLimits null Optional JSON Map of maxCpu, maxMemory (bytes) and maxStorage (bytes) restrictions (0 means unlimited). The parameters maxMemoryMiB, maxMemoryGiB, maxStorageMiB and maxStorageGiB can be used to pass values in larger units.

Delete an Account

curl -XDELETE "https://api.gomorpheus.com/api/accounts/1" \
  -H "Authorization: BEARER access_token"

The above command returns JSON Structured like this:

{
  "success": true
}

If an account still has users or instances tied to it, The delete will fail.

Subtenant Groups

Groups belonging to a subtenant can be managed by the master account.

Get All Groups for Subtenant

curl "https://api.gomorpheus.com/api/accounts/20/groups"
  -H "Authorization: BEARER access_token"

The above command returns JSON structured like this:

{
  "groups": [
    {
      "id": 365,
      "name": "testgroup",
      "code": "testgroup",
      "location": "West",
      "accountId": 20,
      "visibility": "public",
      "active": true,
      "dateCreated": "2018-03-20T20:34:22+0000",
      "lastUpdated": "2018-03-31T18:32:56+0000",
      "zones": [
        {
          "id": 32,
          "name": "test-google"
        },
        {
          "id": 33,
          "name": "test-vmware"
        }
      ]
    }
  ],
  "meta": {
    "offset": 0,
    "max": 25,
    "size": 1,
    "total": 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/accounts/:accountId/groups

URL Parameters

Parameter Description
accountId The ID of the subtenant account

Query Parameters

Parameter Default Description
phrase null Filter on partial match of name or location
name null Filter on exact match of name
lastUpdated null A date filter, restricts query to only load groups updated more recent or equal to the date specified

Get a Specific Group for Subtenant

curl "https://api.gomorpheus.com/api/accounts/20/groups/365" \
  -H "Authorization: BEARER access_token"

The above command returns JSON structured like this:

{
  "group": {
      "id": 365,
      "name": "testgroup",
      "code": "testgroup",
      "location": "West",
      "accountId": 20,
      "visibility": "public",
      "active": true,
      "dateCreated": "2018-03-20T20:34:22+0000",
      "lastUpdated": "2018-03-31T18:32:56+0000",
      "zones": [
        {
          "id": 32,
          "name": "test-google"
        },
        {
          "id": 33,
          "name": "test-vmware"
        }
      ]
    }
}

This endpoint retrieves a specific group.

HTTP Request

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

URL Parameters

Parameter Description
accountId The ID of the subtenant account
id The ID of the group to retrieve

Create a Group for Subtenant

curl -XPOST "https://api.gomorpheus.com/api/accounts/20/groups" \
  -H "Authorization: BEARER access_token" \
  -H "Content-Type: application/json" \
  -d '{"group":{
    "name": "My Group",
    "description": "My description",
    "location": "West"
  }}'

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

HTTP Request

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

URL Parameters

Parameter Description
accountId The ID of the subtenant account

JSON Parameters

Parameter Default Description
name null A unique name scoped to the subtenant for the group
description null Optional description field if you want to put more info there
code null Optional code for use with policies
location null Optional location argument for the group

Updating a Group for Subtenant

curl -XPUT "https://api.gomorpheus.com/api/accounts/20/groups/365" \
  -H "Authorization: BEARER access_token" \
  -H "Content-Type: application/json" \
  -d '{"group":{
    "name": "My Group",
    "description": "My description",
    "location": "West"
  }}'

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

HTTP Request

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

URL Parameters

Parameter Description
accountId The ID of the subtenant account
id The ID of the group

JSON Parameters

Parameter Default Description
name null A unique name scoped to the subtenant for the group
description null Optional description field if you want to put more info there
code null Optional code for use with policies
location null Optional location for the group

Updating Group Zones for Subtenant

curl -XPUT "https://api.gomorpheus.com/api/accounts/20/groups/365/update-zones" \
  -H "Authorization: BEARER access_token" \
  -H "Content-Type: application/json" \
  -d '{"group":{
    "zones": [
      {"id": 32}, {"id": 33}, {"id": 34}
    ]
  }}'

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 Parameters

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

Delete a Group for Subtenant

curl -XDELETE "https://api.gomorpheus.com/api/accounts/20/groups/365" \
  -H "Authorization: BEARER access_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

User Sources

User Sources can be configured for each Tenant. Supported types include LDAP, JumpCloud, Active Directory, and others.

Get All User Sources

curl "https://api.gomorpheus.com/api/user-sources"
  -H "Authorization: BEARER access_token"

The above command returns JSON structured like this:

{
  "userSources": [
    {
      "id": 17,
      "name": "jump cloud",
      "description": "our jump cloud users",
      "code": "KsUGxwhTU",
      "type": "jumpCloud",
      "active": true,
      "deleted": false,
      "autoSyncOnLogin": true,
      "account": {
        "id": 59,
        "name": "acme"
      },
      "defaultAccountRole": {
        "id": 19,
        "authority": "Basic User"
      },
      "roleMappings": [

      ],
      "subdomain": "acme",
      "dateCreated": "2018-03-22T01:57:12+0000",
      "lastUpdated": "2018-03-22T01:57:12+0000"
    }
  ],
  "meta": {
    "size": 1,
    "total": 1,
    "max": 25,
    "offset": 0
  }
}

This endpoint retrieves all user sources.

HTTP Request

GET https://api.gomorpheus.com/api/user-sources

Query Parameters

Parameter Default Description
phrase null Filter on wildcard match of name or description
name null Filter on exact match of name
type null Filter on exact match of type code

Get a Specific User Source

curl "https://api.gomorpheus.com/api/user-sources/2" \
  -H "Authorization: BEARER access_token"

The above command returns JSON structured like this:

{
  "userSource": {
    "id": 17,
    "name": "jump cloud",
    "description": "our jump cloud users",
    "code": "KsUGxwhTU",
    "type": "jumpCloud",
    "active": true,
    "deleted": false,
    "autoSyncOnLogin": true,
    "account": {
      "id": 59,
      "name": "acme"
    },
    "defaultAccountRole": {
      "id": 19,
      "authority": "Basic User"
    },
    "config": {
      "organizationId": "34a927g43e21be3786b2343b",
      "bindingPassword": "************",
      "bindingUsername": "jumpadmin",
      "requiredRole": "MorpheusTag"
    },
    "roleMappings": [

    ],
    "subdomain": "acme",
    "loginURL": "https://app.gomorpheusdata.com/login/account/acme",
    "dateCreated": "2018-03-22T01:57:12+0000",
    "lastUpdated": "2018-03-22T01:57:12+0000"
  }
}

This endpoint retrieves a specific user source.

HTTP Request

GET https://api.gomorpheus.com/api/user-sources/:id

URL Parameters

Parameter Description
ID The ID of the user source

Create a User Source

curl -XPOST "https://api.gomorpheus.com/api/accounts/60/user-sources" \
  -H "Authorization: BEARER access_token" \
  -H "Content-Type: application/json" \
  -d '{"userSource": {
    "type": "activeDirectory",
    "name": "Ninja AD",
    "config": {
      "url": "10.30.10.155",
      "domain": "ad.morpheusdata.ninja",
      "useSSL": "on",
      "bindingUsername": "adadmin",
      "bindingPassword": "goodadpassword",
      "requiredGroup": "MorpheusUsers",
      "searchMemberGroups": "off"
    },
    "defaultAccountRole": {
      "id": 19
    }
  }
}'

The above command returns JSON structured like getting a single user source:

HTTP Request

POST https://api.gomorpheus.com/api/accounts/:accountId/user-sources

URL Parameters

Parameter Description
accountId The ID of the subtenant account to associate the user source with

JSON Parameters

Parameter Default Description
name null Name
type null Type code (ldap, jumpCloud, activeDirectory, okta, oneLogin, saml, customExternal, customApi)
description null Description (optional)
defaultAccountRole.id null Default Role ID
roleMappings {} Map of Morpheus Role ID : Fully Qualified Role Name
roleMappingNames {} Map of Morpheus Role ID : Role Name
config {} Map of configuration options which vary by type.

JSON Parameters for LDAP

Parameter Default Description
config.url null URL
config.bindingUsername null Binding Username
config.bindingPassword null Binding Password
config.requiredGroup null Required group name (a.k.a. tag)

JSON Parameters for jumpCloud

Parameter Default Description
config.organizationId false Organization ID
config.bindingUsername null Binding Username
config.bindingPassword null Binding Password
config.requiredRole null Required group name (a.k.a. tag)

JSON Parameters for activeDirectory

Parameter Default Description
config.url null AD Server
config.domain null Domain
config.useSSL false Use SSL
config.bindingUsername null Binding Username
config.bindingPassword null Binding Password
config.requiredGroup null Required Group
config.searchMemberGroups null Include Member Groups

JSON Parameters for okta

Parameter Default Description
config.url null OKTA URL
config.administratorAPIToken null Adminstrator API Token
config.requiredGroup null Required Group

JSON Parameters for oneLogin

Parameter Default Description
config.subdomain null OneLogin Subdomain
config.region null OneLogin Region
config.clientSecret null API Client Secret
config.clientId null API Client ID
config.requiredRole null Required Role

JSON Parameters for saml

Parameter Default Description
config.url null Login Redirect URL
config.doNotIncludeSAMLRequest false Exclude SAMLRequest Parameter
config.logoutUrl null Logout Post URL
config.publicKey null Signing Public Key

JSON Parameters for customExternal

Parameter Default Description
config.loginUrl null External Login URL
config.doNotIncludeSAMLRequest false Do not include SAMLRequest
config.logout null External Logout URL
config.encryptionAlgo null Encryption Algorithm (‘NONE’,'AES’,'DES’,'DESede’,'HmacSHA1’, 'HmacSHA256’)
config.encryptionKey null Encryption Key

JSON Parameters for customApi

Parameter Default Description
config.endpoint null API Endpoint
config.apiStyle null API Style ('Form URL Encoded [GET]’,'Form URL Encoded [POST]’,'JSON [POST]’,'XML [POST]’,'HTTP Basic [GET]’)
config.encryptionAlgo null Encryption Algorithm ('NONE’,'AES’,'DES’,'DESede’,'HmacSHA1’, 'HmacSHA256’)
config.encryptionKey null Encryption Key

Updating a User Source

curl -XPUT "https://api.gomorpheus.com/api/user-sources/3" \
  -H "Authorization: BEARER access_token" \
  -H "Content-Type: application/json" \
  -d '{"userSource": {
    "type": "activeDirectory",
    "name": "Ninja AD",
    "config": {
      "url": "10.30.10.155",
      "domain": "ad.morpheusdata.ninja",
      "useSSL": "on",
      "bindingUsername": "adadmin",
      "bindingPassword": "goodadpassword",
      "requiredGroup": "MorpheusUsers",
      "searchMemberGroups": "off"
    },
    "defaultAccountRole": {
      "id": 19
    }
  }
}'

The above command returns JSON structured like getting a single user source:

HTTP Request

PUT https://api.gomorpheus.com/api/user-sources/:id

URL Parameters

Parameter Description
ID The ID of the user source

JSON Parameters

Parameter Default Description
name null Name
description null Description (optional)
active null Activate (true) or disable (false) the user source
defaultAccountRole.id null Default Role ID
roleMappings {} Map of Morpheus Role ID : Fully Qualified Role Name
roleMappingNames {} Map of Morpheus Role ID : Role Name
config {} Map of configuration options which vary by type.

Updating Subdomain for a User Source

curl -XPUT "https://api.gomorpheus.com/api/user-sources/3/subdomain" \
  -H "Authorization: BEARER access_token" \
  -H "Content-Type: application/json" \
  -d '{"subdomain": "ninjas"}'

The above command returns JSON Structured like this:

{
  "success": true
}

HTTP Request

PUT https://api.gomorpheus.com/api/user-sources/:id/subdomain

URL Parameters

Parameter Description
ID The ID of the user source

JSON Parameters

Parameter Default Description
subdomain null New Subdomain for account

This endpoint updates the subdomain for the account associated with the user source.

Delete a User Source

curl -XDELETE "https://api.gomorpheus.com/api/user-sources/3" \
  -H "Authorization: BEARER access_token"

The above command returns JSON Structured like this:

{
  "success": true
}

HTTP Request

DELETE https://api.gomorpheus.com/api/user-sources/:id

URL Parameters

Parameter Description
ID The ID of the user source

Will delete a user source from the system and make it no longer usable.

Users

Managing users via the API is always scoped to a specific account. Most of the API’s regarding user management require that the account Id of the user also be known

Get All Users for an Account

curl "https://api.gomorpheus.com/api/accounts/1/users"
  -H "Authorization: BEARER access_token"

The above command returns JSON structured like this:

{
  "users": [
    {
      "id": 1,
      "accountId": 1,
      "username": "davydotcom",
      "displayName": "David Estes",
      "email": "destes@bcap.com",
      "firstName": "David",
      "lastName": "Estes",
      "dateCreated": "2015-11-10T18:58:55+0000",
      "lastUpdated": "2015-11-10T18:58:55+0000",
      "enabled": true,
      "accountExpired": false,
      "accountLocked": false,
      "passwordExpired": false,
      "role": {
        "id": 1,
        "authority": "System Admin",
        "description": "Super User"
      },
      "account": {
        "id": 1,
        "name": "Root Account"
      },
      "instanceLimits": null
    }
  ],
  "meta": {
    "offset": 0,
    "max": 25,
    "size": 1,
    "total": 1
  }
}

This endpoint retrieves all accounts.

HTTP Request

GET https://api.gomorpheus.com/api/accounts/:accountId/users

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 order
phrase null Filter by matching firstName, lastName, username, or email
username null Filter by username
lastUpdated null Date filter, restricts query to only load users updated timestamp is more recent or equal to the date specified

Get a Specific User

curl "https://api.gomorpheus.com/api/accounts/1/users/1" \
  -H "Authorization: BEARER access_token"

The above command returns JSON structured like this:

{
  "user": {
    "id": 1,
    "accountId": 1,
    "username": "davydotcom",
    "displayName": "David Estes",
    "email": "destes@bcap.com",
    "firstName": "David",
    "lastName": "Estes",
    "dateCreated": "2015-11-10T18:58:55+0000",
    "lastUpdated": "2015-11-10T18:58:55+0000",
    "enabled": true,
    "accountExpired": false,
    "accountLocked": false,
    "passwordExpired": false,
    "role": {
      "id": 1,
      "authority": "System Admin",
      "description": "Super User"
    },
    "account": {
      "id": 1,
      "name": "Root Account"
    },
    "instanceLimits": null
  }
}

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

HTTP Request

GET https://api.gomorpheus.com/api/accounts/:accountId/users/:id

Create a User

curl -XPOST "https://api.gomorpheus.com/api/accounts/1/users" \
  -H "Authorization: BEARER access_token" \
  -H "Content-Type: application/json" \
  -d '{"user":{
    "username": "testuser",
    "email": "testuser@yourcompany.com",
    "firstName": "Test",
    "lastName": "User",
    "password": "aStrongpassword123!",
    "role": {"id": 1}
  }}'

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

HTTP Request

POST https://api.gomorpheus.com/api/accounts/:accountId/users

JSON User Parameters

Parameter Default Description
username null A unique username
email null The user’s email
firstName null The user’s first name (optional)
lastName null The user’s last name (optional)
password null The password to apply to the user
role null A nested id of the role to assign to the user
instanceLimits null Optional JSON Map of maxCpu, maxMemory (bytes) and maxStorage (bytes) restrictions (0 means unlimited). The parameters maxMemoryMiB, maxMemoryGiB, maxStorageMiB and maxStorageGiB can be used to pass values in larger units.

Updating a User

curl -XPUT "https://api.gomorpheus.com/api/accounts/1/users/2" \
  -H "Authorization: BEARER access_token" \
  -H "Content-Type: application/json" \
  -d '{"user":{
    "username": "testUser",
    "firstName": "Jane",
    "lastName": "Doe",
    "password": "abc123",
    "role": {"id": 1},
    "instanceLimits": {
      "maxCpu": 0,
      "maxMemory": 0,
      "maxStorage": 0
    }
  }}'

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

HTTP Request

PUT https://api.gomorpheus.com/api/accounts/:accountId/users/:id

JSON User Parameters

Parameter Default Description
username null A unique username
email null The user’s email
firstName null The user’s first name (optional)
lastName null The user’s last name (optional)
password null The password to apply to the user
role null A nested id of the role to assign to the user
instanceLimits null Optional JSON Map of maxCpu, maxMemory (bytes) and maxStorage (bytes) restrictions (0 means unlimited). The parameters maxMemoryMiB, maxMemoryGiB, maxStorageMiB and maxStorageGiB can be used to pass values in larger units.

Delete a User

curl -XDELETE "https://api.gomorpheus.com/api/accounts/1/users/2" \
  -H "Authorization: BEARER access_token"

The above command returns JSON Structured like this:

{
  "success": true
}

This will disassociate the user from any instances they have previously provisioned.

Roles

Provides API interfaces for managing the creation and modification of roles within Morpheus. This API is scoped to the roles owned by the current user’s account. System Admin users will also be able to access the system roles: System Admin and Account Admin.

Get All Roles

curl "https://api.gomorpheus.com/api/roles"
  -H "Authorization: BEARER access_token"

The above command returns JSON structured like this:

{
  "roles": [
        {
      "id": 2,
      "authority": "Account Admin",
      "description": "Service account holder",
      "dateCreated": "2016-08-27T23:26:19+0000",
      "lastUpdated": "2016-08-27T23:26:19+0000",
      "scope": "Account",
      "instanceLimits": null,
      "ownerId": null,
      "owner": null
    },
    {
      "id": 1,
      "authority": "System Admin",
      "description": "Super User",
      "dateCreated": "2015-11-10T18:58:55+0000",
      "lastUpdated": "2015-11-10T18:58:55+0000",
      "scope": "Admin",
      "instanceLimits": null,
      "ownerId": null,
      "owner": null
    },
    {
      "id": 3,
      "authority": "Another Role",
      "description": "A custom role",
      "dateCreated": "2015-11-10T19:01:45+0000",
      "lastUpdated": "2015-11-10T19:02:01+0000",
      "scope": "Account",
      "instanceLimits": null,
      "ownerId": 1,
      "owner": {
        "id": 1,
        "name": "Root Account"
      }
    },
  ],
  "meta": {
    "offset": 0,
    "max": 25,
    "size": 3,
    "total": 3
  }
}

This endpoint retrieves all roles.

HTTP Request

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

Query Parameters

Parameter Default Description
max 25 Max number of results to return
offset 0 Offset of records you want to load
phrase null Filter by matching authority
authority null Filter by authority

Get a Specific Role

curl "https://api.gomorpheus.com/api/roles/3" \
  -H "Authorization: BEARER access_token"

The above command returns JSON structured like this:

{
    "role": {
    "id": 3,
    "authority": "Another Role",
    "description": "A custom role",
    "dateCreated": "2015-11-10T19:01:45+0000",
    "lastUpdated": "2015-11-10T19:02:01+0000",
    "scope": "Account",
    "instanceLimits": null,
    "ownerId": 1,
    "owner": {
      "id": 1,
      "name": "Root Account"
    }
  },
  "featurePermissions": [
    {
      "id": 8,
      "code": "admin-users",
      "name": "Admin: Users",
      "access": "full"
    },
    {
      "id": 18,
      "code": "backups",
      "name": "Backups",
      "access": "full"
    },
    {
      "id": 19,
      "code": "dashboard",
      "name": "Dashboard",
      "access": "read"
    },
  ],
  "globalSiteAccess": "custom",
  "sites": [
    {
      "id": 1,
      "name": "group1",
      "access": "full"
    },
    {
      "id": 2,
      "name": "group2",
      "access": "none"
    }
  ],
  "globalZoneAccess": "full",
  "zones": [
    {
      "id": 1,
      "name": "zone1",
      "access": "full"
    },
    {
      "id": 2,
      "name": "zone2",
      "access": "full"
    },
  ],
  "globalInstanceTypeAccess": "custom",
  "instanceTypePermissions": [
    {
      "id": 1,
      "code": "activemq",
      "name": "ActiveMQ",
      "access": "full"
    },
    {
      "id": 2,
      "code": "amazon",
      "name": "Amazon",
      "access": "full"
    },
    {
      "id": 5,
      "code": "ansible",
      "name": "Ansible",
      "access": "full"
    },
  ]
}

The sample JSON above shows only a small subset of the featurePermissions and instanceTypePermissions that exist.

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

HTTP Request

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

Create a Role

curl -XPOST "https://api.gomorpheus.com/api/roles" \
  -H "Authorization: BEARER access_token" \
  -H "Content-Type: application/json" \
  -d '{"role":{
    "authority": "Test Role",
    "description": "A test role",
    "baseRoleId": {"id": 2},
    "instanceLimits": {
      "maxCpu": 0,
      "maxMemory": 0,
      "maxStorage": 0
    }
  }}'

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

HTTP Request

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

JSON Role Parameters

Parameter Default Description
authority null A name for the role
description null Optional description field if you want to put more info there
baseRoleId null A role to copy feature permissions and access from (optional)
instanceLimits null Optional JSON Map of maxCpu, maxMemory (bytes) and maxStorage (bytes) restrictions (0 means unlimited). The parameters maxMemoryMiB, maxMemoryGiB, maxStorageMiB and maxStorageGiB can be used to pass values in larger units.

Updating Basic Role Settings

curl -XPUT "https://api.gomorpheus.com/api/roles/4" \
  -H "Authorization: BEARER access_token" \
  -H "Content-Type: application/json" \
  -d '{"role":{
    "authority": "Test Role",
    "description": "A new description of test role",
    "instanceLimits": {
      "maxCpu": 0,
      "maxMemory": 0,
      "maxStorage": 0
    }
  }}'

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

HTTP Request

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

JSON Role Parameters

Parameter Default Description
authority null A name for the role
description null Optional description field if you want to put more info there
instanceLimits null Optional JSON Map of maxCpu, maxMemory (bytes) and maxStorage (bytes) restrictions (0 means unlimited). The parameters maxMemoryMiB, maxMemoryGiB, maxStorageMiB and maxStorageGiB can be used to pass values in larger units.

Updating Role Feature Permissions

curl -XPUT "https://api.gomorpheus.com/api/roles/4/update-permission" \
  -H "Authorization: BEARER access_token" \
  -H "Content-Type: application/json" \
  -d '{
    "permissionCode": "admin-users",
    "access": "read"
  }'

The above command returns JSON Structured like this:

{
  "success": true,
  "access": "read"
}

HTTP Request

PUT https://api.gomorpheus.com/api/roles/:id/update-permission

JSON Parameters

Parameter Default Description
permissionCode The code of the permission being changed
access The new access level. full, read, none

Global Group Access

Global Group Access is controlled via the update-permission API

curl -XPUT "https://api.gomorpheus.com/api/roles/4/update-permission" \
  -H "Authorization: BEARER access_token" \
  -H "Content-Type: application/json" \
  -d '{
    "permissionCode": "ComputeSite",
    "access": "custom"
  }'

JSON Parameters

Parameter Default Description
permissionCode ComputeSite is the code for Global Group Access
access full, custom, read, or none

Customizing Group Access

Global Group Access must first be changed to custom as seen above.

curl -XPUT "https://api.gomorpheus.com/api/roles/4/update-group" \
  -H "Authorization: BEARER access_token" \
  -H "Content-Type: application/json" \
  -d '{
    "groupId": 2,
    "access": "full"
  }'

The above command returns JSON Structured like this:

{
  "success": true,
  "access": "full"
}

HTTP Request

PUT https://api.gomorpheus.com/api/roles/:id/update-group

JSON Parameters

Parameter Default Description
groupId id of the group (site)
access full, read, or none

Global Cloud Access

Global Cloud Access is controlled via the update-permission API

curl -XPUT "https://api.gomorpheus.com/api/roles/4/update-permission" \
  -H "Authorization: BEARER access_token" \
  -H "Content-Type: application/json" \
  -d '{
    "permissionCode": "ComputeZone",
    "access": "custom"
  }'

JSON Parameters

Parameter Default Description
permissionCode ComputeZone is the code for Global Cloud Access
access full, custom, or none

Customizing Cloud Access

Global Cloud Access must first be changed to custom as seen above.

curl -XPUT "https://api.gomorpheus.com/api/roles/4/update-cloud" \
  -H "Authorization: BEARER access_token" \
  -H "Content-Type: application/json" \
  -d '{
    "cloudId": 2,
    "access": "full"
  }'

The above command returns JSON Structured like this:

{
  "success": true,
  "access": "full"
}

HTTP Request

PUT https://api.gomorpheus.com/api/roles/:id/update-group

JSON Parameters

Parameter Default Description
cloudId id of the cloud (zone)
access full, read, or none

Global Instance Type Access

Global Instance Type Access is controlled via the update-permission API

curl -XPUT "https://api.gomorpheus.com/api/roles/4/update-permission" \
  -H "Authorization: BEARER access_token" \
  -H "Content-Type: application/json" \
  -d '{
    "permissionCode": "InstanceType",
    "access": "custom"
  }'

JSON Parameters

Parameter Default Description
permissionCode InstanceType is the code for Global Instance Type Access
access full, custom, or none

Customizing Instance Type Access

Global Instance Type Access must first be changed to custom as seen above.

curl -XPUT "https://api.gomorpheus.com/api/roles/4/update-instance-type" \
  -H "Authorization: BEARER access_token" \
  -H "Content-Type: application/json" \
  -d '{
    "instanceTypeId": 1,
    "access": "full"
  }'

The above command returns JSON Structured like this:

{
  "success": true,
  "access": "full"
}

HTTP Request

PUT https://api.gomorpheus.com/api/roles/:id/update-instance-type

JSON Parameters

Parameter Default Description
instanceTypeId id of the instance type
access full or none

Delete a Role

curl -XDELETE "https://api.gomorpheus.com/api/roles/4" \
  -H "Authorization: BEARER access_token"

The above command returns JSON Structured like this:

{
  "success": true
}

If a role still has accounts or users tied to it, The delete will fail.

Policies

Provides API interfaces for managing Policies.

Get All Policies

curl "https://api.gomorpheus.com/api/policies"
  -H "Authorization: BEARER access_token"

The above command returns JSON structured like this:

{
  "policies": [
    {
      "id": 1,
      "name": null,
      "description": "global max containers",
      "policyType": {
        "id": 5,
        "code": "maxContainers",
        "name": "Max Containers"
      },
      "zone": null,
      "site": null,
      "user": null,
      "refType": null,
      "refId": null,
      "config": {
        "maxContainers": 999
      },
      "enabled": true,
      "owner": {
        "id": 1,
        "name": "root"
      },
      "accounts": [

      ]
    },
    {
      "id": 2,
      "name": null,
      "description": "dev budget",
      "policyType": {
        "id": 16,
        "code": "maxPrice",
        "name": "Budget"
      },
      "zone": null,
      "site": null,
      "user": null,
      "refType": null,
      "refId": null,
      "config": {
        "maxPrice": 1500,
        "maxPriceCurrency": "USD",
        "maxPriceUnit": "month"
      },
      "enabled": true,
      "owner": {
        "id": 1,
        "name": "root"
      },
      "accounts": [
        {
          "id": 2,
          "name": "dev"
        }
      ]
    },
    {
      "id": 3,
      "name": "test group maxcores",
      "description": null,
      "policyType": {
        "id": 3,
        "code": "maxCores",
        "name": "Max Cores"
      },
      "zone": null,
      "site": {
        "id": 2,
        "name": "test group"
      },
      "user": null,
      "refType": "ComputeSite",
      "refId": 1,
      "config": {
        "maxCores": 20
      },
      "enabled": true,
      "owner": {
        "id": 1,
        "name": "root"
      },
      "accounts": [

      ]
    },
    {
      "id": 4,
      "name": null,
      "description": "hulk max storage",
      "policyType": {
        "id": 2,
        "code": "maxStorage",
        "name": "Max Storage"
      },
      "zone": null,
      "site": null,
      "user": {
        "id": 26,
        "username": "hulk"
      },
      "refType": "User",
      "refId": 26,
      "config": {
        "maxStorage": 10000
      },
      "enabled": true,
      "owner": {
        "id": 1,
        "name": "root"
      },
      "accounts": [

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

This endpoint retrieves all policies associated with the account.

HTTP Request

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

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 Policy

curl "https://api.gomorpheus.com/api/policies/4" \
  -H "Authorization: BEARER access_token"

The above command returns JSON structured like this:

{
  "policy": {
    "id": 4,
    "name": "hulk max storage",
    "description": "Limit the hulkster",
    "policyType": {
      "id": 2,
      "code": "maxStorage",
      "name": "Max Storage"
    },
    "zone": null,
    "site": null,
    "user": {
      "id": 26,
      "username": "hulk"
    },
    "refType": "User",
    "refId": 26,
    "config": {
      "maxStorage": "10000"
    },
    "enabled": true,
    "owner": {
      "id": 1,
      "name": "root"
    },
    "accounts": [
    ]
  }
}

This endpoint retrieves a specific policy.

HTTP Request

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

URL Parameters

Parameter Description
ID The ID of the policy to retrieve

Policy Types

curl "https://api.gomorpheus.com/api/policy-types" \
  -H "Authorization: BEARER access_token"

The above command returns JSON structured like this:

{
  "policyTypes": [
    {
      "id": 15,
      "code": "createBackup",
      "name": "Backup Creation",
      "description": "",
      "category": "provision",
      "loadMethod": "loadBackupCreation",
      "enforceMethod": "enforceBackupCreation",
      "prepareMethod": "prepareBackupCreation",
      "validateMethod": "validateBackupCreation",
      "enforceOnProvision": true,
      "enforceOnManaged": false,
      "optionTypes": [
        {
          "code": "policyType.createBackupType",
          "name": "Enforcement Type",
          "description": null,
          "type": "select",
          "displayOrder": 1,
          "optionSource": "policyGenericType",
          "defaultValue": "",
          "placeHolder": null,
          "helpBlock": "",
          "required": true,
          "fieldLabel": "Enforcement Type",
          "fieldName": "createBackupType",
          "fieldContext": "config"
        },
        {
          "code": "policyType.createBackup",
          "name": "Create Backup",
          "description": null,
          "type": "checkbox",
          "displayOrder": 2,
          "optionSource": null,
          "defaultValue": "",
          "placeHolder": null,
          "helpBlock": "",
          "required": true,
          "fieldLabel": "Create Backup",
          "fieldName": "createBackup",
          "fieldContext": "config"
        }
      ]
    }
  ],
  "meta": {
    "size": 16,
    "total": 16,
    "offset": 0,
    "max": 1000
  }
}

This endpoint returns a list of all policy types.

HTTP Request

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

Policy Type Options

Backup Creation (createBackup)
Parameter Default Description
config.createBackupType Enforcement Type - [user, fixed]
config.createBackup false Create Backup [true, false]
Budget (maxPrice)
Parameter Default Description
config.maxPrice Max Price: Maximum total price for all instances
config.maxPriceCurrency USD Currency code
config.maxPriceUnit month Unit of time [month, hour]
Expiration (lifecycle)
Parameter Default Description
config.lifecycleType user Expiration Type - [user, fixed]
config.lifecycleAge 30 Expiration Days - Configures the number of days the instance is allowed to exist before being removed.
config.lifecycleRenewal 7 Renewal Days - If the instance is renewed, this is the number of day increments the expiration date is increased by.
config.lifecycleNotify 1 Notification Days - This allows an email notice to be sent out x days before the instance is going to expire.
config.lifecycleMessage Instance ${instance?.name} is set to expire on ${instance?.expireDate} Notification Message
config.lifecycleAutoRenew on Allow Auto Extensions
config.lifecycleExtensionsBeforeApproval 0 Configures the number of extensions allowed before approval is required.
config.accountIntegrationId Approval Integration ID
config.lifecycleWorkflowId Approval Workflow ID
Host Name (serverNaming)
Parameter Default Description
config.serverNamingType Naming Type - [user, fixed]
config.serverNamingPattern Name pattern - uses ${variable} string interpolation. Available variables are:
groupName, groupCode, cloudName, cloudCode, type, accountId, account, accountType, platform, username, userId, userInitials, provisionType
config.serverNamingConflict false Resolve Conflicts
Hostname (hostNaming)
Parameter Default Description
config.hostNamingType Naming Type - [user, fixed]
config.hostNamingPattern Name Pattern - uses ${variable} string interpolation. Available variables are:
groupName, groupCode, cloudName, cloudCode, type, accountId, account, accountType, platform, username, userId, userInitials, provisionType
Instance Name(naming)
Parameter Default Description
config.namingType Naming Type - [user, fixed]
config.namingPattern Name pattern - uses ${variable} string interpolation. Available variables are:
groupName, groupCode, cloudName, cloudCode, type, accountId, account, accountType, platform, username, userId, userInitials, provisionType
config.namingConflict false Resolve Conflicts
Max Containers (maxContainers)
Parameter Default Description
config.maxContainers The max number of containers
Max Cores (maxCores)
Parameter Default Description
config.maxCores The max number of cores
Max Hosts (maxHosts)
Parameter Default Description
config.maxHosts The max number of hosts
Max Memory (maxMemory)
Parameter Default Description
config.maxMemory The max number of memory (GB)
Max Storage (maxStorage)
Parameter Default Description
config.maxStorage The max number of memory (GB)
Max VMs (maxVms)
Parameter Default Description
config.maxVms The max number of virtual machines
Power Schedule (powerSchedule)
Parameter Default Description
config.powerScheduleType Enforcement Type - [user, fixed]
config.powerSchedule Power Schedule ID
Provision Approval (provisionApproval)
Parameter Default Description
config.accountIntegrationId Account Integration ID
config.workflowId Workflow ID
Shutdown (shutdown)
Parameter Default Description
config.shutdownType user Shutdown Type - [user, fixed]
config.shutdownAge 30 Shutdown Days - Configures the number of days the instance is allowed to exist before being removed.
config.shutdownRenewal 7 Renewal Days - If the instance is renewed, this is the number of day increments the expiration date is increased by.
config.shutdownNotify 1 Notification Days - This allows an email notice to be sent out x days before the instance is going to expire.
config.shutdownMessage Instance ${instance?.name} is set to shutdown on ${instance?.shutdownDate} Notification Message
config.shutdownAutoRenew on Allow Auto Extensions
config.shutdownExtensionsBeforeApproval 0 Configures the number of extensions allowed before approval is required.
config.accountIntegrationId Approval Integration ID
config.lifecycleWorkflowId Approval Workflow ID
User Creation (createUser)
Parameter Default Description
config.createUserType Enforcement Type - [user, fixed]
config.createUser false Create User [true, false]

Create a Policy

curl -XPOST "https://api.gomorpheus.com/api/policies" \
  -H "Authorization: BEARER access_token" \
  -H "Content-Type: application/json" \
  -d '{
  "policy": {
    "name": "max hosts",
    "description": null,
    "policyType": {
      "code": "maxHosts"
    },
    "config": {
      "maxHosts": 99
    },
    "enabled": true,
    "accounts": []
  }
}'

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

HTTP Request

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

JSON Parameters

Parameter Default Description
name A name for the policy
description A description for the policy
policyType.code The policy type. [maxMemory, maxStorage, maxCores, maxContainers, etc.]
config A map of config values. The expected values vary by policyType. See Policy Types.
enabled true Enabled. Set to false to disable.
refType Scope object type. [ComputeSite, ComputeZone, User]
refId Scope object ID, of group, cloud, user, etc.
accounts Array of tenants to scope the policy to.

Create a Policy For a Group

Policies can be scoped to a group by passing the following:

Parameter Value
refType ComputeSite
refId The ID of the group

Alternatively, the Group Policies endpoint can be used.

Create a Policy For a Cloud

Policies can be scoped to a cloud by passing the following:

Parameter Value
refType ComputeZone
refId The ID of the cloud

Alternatively, the Cloud Policies endpoint can be used.

Create a Policy For a User

Policies can be scoped to a cloud by passing the following:

Parameter Value
refType User
refId The ID of the user

Update a Policy

curl -XPUT "https://api.gomorpheus.com/api/policies/1" \
  -H "Authorization: BEARER access_token" \
  -H "Content-Type: application/json" \
  -d '{
  "policy": {
    "name": "max containers 1000",
    "config": {
      "maxContainers": 1000
    },
  }
}'

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

HTTP Request

PUT https://api.gomorpheus.com/api/policies/1

URL Parameters

Parameter Description
ID The ID of the policy

JSON Parameters

Parameter Default Description
name A name for the policy
description A description for the policy
config A map of config values. The expected values vary by policyType.
enabled true Enabled. Set to false to disable.
accounts Array of tenants to scope the policy to.

Delete a Policy

curl -XDELETE "https://api.gomorpheus.com/api/policies/1" \
  -H "Authorization: BEARER access_token"

The above command returns JSON Structured like this:

{
  "success": true
}

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

HTTP Request

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

URL Parameters

Parameter Description
ID The ID of the policy

Group Policies

Policies scoped to a specific group can also be managed at another endpoint.

curl "https://api.gomorpheus.com/api/groups/1/policies"
  -H "Authorization: BEARER access_token"

The above command returns JSON structured like this:

{
  "policies": [
    {
      "id": 19,
      "name": "smallgroup max cores",
      "description": null,
      "policyType": {
        "id": 3,
        "code": "maxCores",
        "name": "Max Cores"
      },
      "zone": null,
      "site": {
        "id": 1,
        "name": "smallgroup"
      },
      "user": null,
      "refType": "ComputeSite",
      "refId": 1,
      "config": {
        "maxCores": 20
      },
      "enabled": true,
      "owner": {
        "id": 1,
        "name": "root"
      },
      "accounts": [

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

HTTP Request

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

URL Parameters

Parameter Description
groupId The ID of the group

Cloud Policies

Policies scoped to a specific cloud can also be managed at another endpoint.

curl "https://api.gomorpheus.com/api/clouds/1/policies"
  -H "Authorization: BEARER access_token"

The above command returns JSON structured like this:

{
  "policies": [
    {
      "id": 19,
      "name": "bigcloud max cores",
      "description": null,
      "policyType": {
        "id": 3,
        "code": "maxCores",
        "name": "Max Cores"
      },
      "zone": {
        "id": 1,
        "name": "bigcloud"
      },
      "site": null,
      "user": null,
      "refType": "ComputeZone",
      "refId": 1,
      "config": {
        "maxCores": 1500
      },
      "enabled": true,
      "owner": {
        "id": 1,
        "name": "root"
      },
      "accounts": [

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

HTTP Request

GET https://api.gomorpheus.com/api/clouds/:cloudId/policies

URL Parameters

Parameter Description
cloudId The ID of the cloud

Power Schedules

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

Get All Power Schedules

curl "https://api.gomorpheus.com/api/power-schedules" \
  -H "Authorization: BEARER access_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 null If specified will return an exact match on name
phrase null If specified will return a partial match on name

Get a Specific Power Schedule

curl "https://api.gomorpheus.com/api/power-schedules/2" \
  -H "Authorization: BEARER access_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 "https://api.gomorpheus.com/api/power-schedules" \
  -H "Authorization: BEARER access_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 "https://api.gomorpheus.com/api/power-schedules/2" \
  -H "Authorization: BEARER access_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 "https://api.gomorpheus.com/api/power-schedules/1" \
  -H "Authorization: BEARER access_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 "https://api.gomorpheus.com/api/power-schedules/2/add-instances" \
  -H "Authorization: BEARER access_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 "https://api.gomorpheus.com/api/power-schedules/2/remove-instances" \
  -H "Authorization: BEARER access_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 "https://api.gomorpheus.com/api/power-schedules/2/add-servers" \
  -H "Authorization: BEARER access_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 "https://api.gomorpheus.com/api/power-schedules/2/remove-servers" \
  -H "Authorization: BEARER access_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.

Get All Execute Schedules

curl "https://api.gomorpheus.com/api/execute-schedules" \
  -H "Authorization: BEARER access_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 null If specified will return an exact match on name
phrase null If specified will return a partial match on name

Get a Specific Execute Schedule

curl "https://api.gomorpheus.com/api/execute-schedules/1" \
  -H "Authorization: BEARER access_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 "https://api.gomorpheus.com/api/execute-schedules" \
  -H "Authorization: BEARER access_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 "https://api.gomorpheus.com/api/execute-schedules/2" \
  -H "Authorization: BEARER access_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 "https://api.gomorpheus.com/api/execute-schedules/1" \
  -H "Authorization: BEARER access_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

Errors

The Morpheus API uses the following error codes:

Error Code Meaning
400 Bad Request – Your request sucks
401 Unauthorized – Your API key is wrong
403 Forbidden – The kitten requested is hidden for administrators only
404 Not Found – The specified kitten could not be found
405 Method Not Allowed – You tried to access a kitten 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 requesting too many kittens! 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.

Security Groups

A Security Group is a grouping of rules. Each rule is a whitelist entry for a particular IP address to either a port range or a particular Morpheus instance type. A Security Group may be applied to multiple Clouds, Apps, and Instances.

Get All Security Groups

curl "https://api.gomorpheus.com/api/security-groups"
  -H "Authorization: BEARER access_token"

The above command returns JSON structured like this:

{
  "success": true,
  "securityGroups": [
    {
      "id": 19,
      "accountId": 1,
      "name": "All Access to Tomcat",
      "description": ""
    },
    {
      "id": 18,
      "accountId": 1,
      "name": "Colorado office",
      "description": "All the Colorado office to access anywhere"
    }
  ],
  "securityGroupCount": 2
}

This endpoint retrieves all security groups and their JSON encoded configuration attributes.

HTTP Request

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

Query Parameters

Parameter Default Description
max 25 Max number of results to return
offset 0 Offset of records you want to load
phrase null Name or description filter, restricts query to only load security groups which contain the phrase specified

Get a Specific Security Group

curl "https://api.gomorpheus.com/api/security-group/18" \
  -H "Authorization: BEARER access_token"

The above command returns JSON structured like this:

{
  "success": true,
  "securityGroup": {
    "id": 18,
    "accountId": 1,
    "name": "Colorado office",
    "description": "All the Colorado office to access anywhere"
  }
}

This endpoint retrieves a specific security group.

Create a Security Group

curl -XPOST "https://api.gomorpheus.com/api/security-group" \
  -H "Authorization: BEARER access_token" \
  -H "Content-Type: application/json" \
  -d '{ "securityGroup": {
  "name": "My New Security Group",
  "description": "My Description"
  }}'

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

HTTP Request

POST https://api.gomorpheus.com/api/security-group

JSON Security Group Parameters

Parameter Default Description
name null Name for your security group
description null Optional description field

Updating a Security Group

curl -XPUT "https://api.gomorpheus.com/api/security-group/18" \
  -H "Authorization: BEARER access_token" \
  -H "Content-Type: application/json" \
  -d '{ "securityGroup": {
  "name": "My New Security Group",
  "description": "My Description"
  }}'

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

HTTP Request

PUT https://api.gomorpheus.com/api/security-group/:id

JSON Security Group Parameters

Parameter Default Description
name null Name for your security group
description null Optional description field

Delete a Security Group

curl -XDELETE "https://api.gomorpheus.com/api/security-group/1" \
  -H "Authorization: BEARER access_token"

The above command returns JSON structure like this:

{
  "success": true
}

Will delete a security group and update all clouds, apps, and instances which are currently using the security group.

HTTP Request

DELETE https://api.gomorpheus.com/api/security-group/:id

Security Group Rules

A Security Group Rule specifies that a certain CIDR is able to access a particular port (or port range) for a particular protocol. Or, that a particular CIDR is able to access all instances of a particular type (like MySql, Redis, etc). A Security Group Rule belongs to a Security Group and a Security Group is applied to either a Cloud, App, or Instance.

Get All Security Group Rules for a Security Group

curl "https://api.gomorpheus.com/api/security-groups/19/rules"
  -H "Authorization: BEARER access_token"

The above command returns JSON structured like this:

{
  "success": true,
  "rules": [
    {
      "id": 31,
      "securityGroupId": 19,
      "source": "50.22.10.10/32",
      "portRange": null,
      "protocol": null,
      "customRule": false,
      "instanceTypeId": 3
    },
    {
      "id": 30,
      "securityGroupId": 19,
      "source": "50.22.10.10/32",
      "portRange": "99",
      "protocol": "tcp",
      "customRule": true,
      "instanceTypeId": null
    }
  ]
}

This endpoint retrieves all security group rules for a Security Gorup.

HTTP Request

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

Get a Specific Security Group Rule

curl "https://api.gomorpheus.com/api/security-group/19/rules/30" \
  -H "Authorization: BEARER access_token"

The above command returns JSON structured like this:

{
  "success": true,
  "rule": {
    "id": 30,
    "securityGroupId": 19,
    "source": "50.22.10.10/32",
    "portRange": "99",
    "protocol": "tcp",
    "customRule": true,
    "instanceTypeId": null
  }
}

This endpoint retrieves a specific security group rule.

HTTP Request

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

Create a Security Group Rule

curl -XPOST "https://api.gomorpheus.com/api/security-group/19/rules" \
  -H "Authorization: BEARER access_token" \
  -H "Content-Type: application/json" \
  -d '{ "rule": {
    "source": "50.22.10.10/32",
    "portRange": "55",
    "protocol": "tcp",
    "customRule": true,
    "instanceTypeId": 3
    }}'

The above command returns a similar JSON structure when submitting a GET request for a single security group rule

Will create a security group rule and update all clouds, apps, and instances which are currently using the security group in which this rule belongs.

HTTP Request

POST https://api.gomorpheus.com/api/security-group/:id/rules

JSON Security Group Rule Parameters

Parameter Default Description
source null CIDR representing the source IP(s) which should receive access
portRange null Either a single value (i.e. 55) or a port range (i.e. 1-65535) for which to open access to the source. Required if customRule is true, otherwise, ignored.
protocol null Either tcp, udp, icmp. Required if customRule is true, otherwise, ignored.
customRule null Either true or false. Specifies if this rule a custom rule (where source, portRange, and protocol are all required) or if it is tied to an Instance Type.
instanceTypeId null The id of an Instance Type. If specified, the source CIDR will have access to all ports exposed by the particular instance in the cloud, app, or instance. Required if customRule is false, otherwise, ignored.

Updating a Security Group Rule

curl -XPUT "https://api.gomorpheus.com/api/security-group/19/rules/30" \
  -H "Authorization: BEARER access_token" \
  -H "Content-Type: application/json" \
  -d '{ "rule": {
    "source": "50.22.10.10/32",
    "portRange": "55",
    "protocol": "tcp",
    "customRule": true,
    "instanceTypeId": 3
    }}'

The above command returns a similar JSON structure when submitting a GET request for a single security group rule

Will update a security group rule and update all clouds, apps, and instances which are currently using the security group in which this rule belongs.

HTTP Request

PUT https://api.gomorpheus.com/api/security-group/:id/rules/:id

JSON Security Group Rule Parameters

Same parameters as specified in the creation of a Security Group Rule

Delete a Security Group Rule

curl -XDELETE "https://api.gomorpheus.com/api/security-group/19/rules/30" \
  -H "Authorization: BEARER access_token"

The above command returns JSON structure like this:

{
  "success": true
}

Will delete a security group rule and update all clouds, apps, and instances which are currently using the security group in which this rule belongs.

HTTP Request

DELETE https://api.gomorpheus.com/api/security-group/:id/rules/:id

Tasks

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

Get All Tasks

curl "https://api.gomorpheus.com/api/tasks"
  -H "Authorization: BEARER access_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 null Filter by matching name
name null Filter by name

Get a Specific Task

curl "https://api.gomorpheus.com/api/tasks/1" \
  -H "Authorization: BEARER access_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 "https://api.gomorpheus.com/api/tasks" \
  -H "Authorization: BEARER access_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 null A unique name for the task
taskType.code null The type of task
taskOptions {} Map of options specific to each type. eg. script

Updating a Task

curl -XPUT "https://api.gomorpheus.com/api/tasks/5" \
  -H "Authorization: BEARER access_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

Parameter Default Description
name null A unique name for the task
taskOptions {} Map of options taht vary by task type. eg. script

Delete a Task

curl -XDELETE "https://api.gomorpheus.com/api/tasks/1" \
  -H "Authorization: BEARER access_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.

Get All Task Types

curl "https://api.gomorpheus.com/api/task-types"
  -H "Authorization: BEARER access_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
max 25 Max number of results to return
offset 0 Offset of records you want to load

Get a Specific Task Type

curl "https://api.gomorpheus.com/api/task-types/1" \
  -H "Authorization: BEARER access_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.

Get All Workflows

curl "https://api.gomorpheus.com/api/task-sets"
  -H "Authorization: BEARER access_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 null Filter by matching name
name null Filter by name

Get a Specific Workflow

curl "https://api.gomorpheus.com/api/task-sets/1" \
  -H "Authorization: BEARER access_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 "https://api.gomorpheus.com/api/task-sets" \
  -H "Authorization: BEARER access_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 null A unique name for the workflow
description null A description of the workflow
tasks [] List of task objects in order
tasks.taskId null Task ID
tasks.taskPhase provision Task Phase.

Updating a Workflow

curl -XPUT "https://api.gomorpheus.com/api/task-sets/5" \
  -H "Authorization: BEARER access_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 null A unique name for the workflow
description null A description of the workflow
tasks [] List of task objects in order
tasks.taskId null Task ID
tasks.taskPhase provision Task Phase.

Delete a Workflow

curl -XDELETE "https://api.gomorpheus.com/api/task-sets/1" \
  -H "Authorization: BEARER access_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

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.

By Account

curl "https://api.gomorpheus.com/api/billing/account"
  -H "Authorization: BEARER access_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

For a Sub Account

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 "https://api.gomorpheus.com/api/billing/account/1" \
  -H "Authorization: BEARER access_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

For All Zones

curl "https://api.gomorpheus.com/api/billing/zones"
  -H "Authorization: BEARER access_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

For a Specific Zone

curl "https://api.gomorpheus.com/api/billing/zones/1"
  -H "Authorization: BEARER access_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

For All Servers

curl "https://api.gomorpheus.com/api/billing/servers"
  -H "Authorization: BEARER access_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 zones 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

For a Specific Server

curl "https://api.gomorpheus.com/api/billing/servers/1"
  -H "Authorization: BEARER access_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 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

For All Instances

curl "https://api.gomorpheus.com/api/billing/instances"
  -H "Authorization: BEARER access_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 zones 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

For a Specific Instance

curl "https://api.gomorpheus.com/api/billing/instances/1"
  -H "Authorization: BEARER access_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

Cypher

Cypher at its core is a secure Key/Value store. But what makes cypher useful is the ability to securely store or generate credentials to connect to your instances. Not only are these credentials encrypted but by using a cypher you don’t have to burn in connection credentials between instances into your apps.

Cypher keys can be revoked, either through lease timeouts or manually. So even if somebody were to gain access to your keys you could revoke access to the keys and generate new ones for your applications.

Get All Cyphers

curl "https://api.gomorpheus.com/api/cypher"
  -H "Authorization: BEARER access_token"

The above command returns JSON structured like this:

{
  "cyphers": [
    {
      "id": 4,
      "itemKey": "key/mykey",
      "leaseTimeout": 2764800000,
      "expireDate": "2018-10-20T15:35:05+0000",
      "dateCreated": "2018-09-18T15:35:05+0000",
      "lastUpdated": "2018-09-18T15:35:05+0000",
      "lastAccessed": "2018-09-18T15:35:05+0000"
    },
    {
      "id": 2,
      "itemKey": "secret/myClientId",
      "leaseTimeout": 2764800000,
      "expireDate": "2018-10-20T18:38:21+0000",
      "dateCreated": "2018-09-18T18:38:21+0000",
      "lastUpdated": "2018-09-18T18:38:21+0000",
      "lastAccessed": "2018-09-18T18:38:21+0000"
    },
    {
      "id": 3,
      "itemKey": "uuid/myid",
      "leaseTimeout": 2764800000,
      "expireDate": "2018-10-20T15:34:50+0000",
      "dateCreated": "2018-09-18T15:34:50+0000",
      "lastUpdated": "2018-09-18T15:34:50+0000",
      "lastAccessed": "2018-09-18T15:34:50+0000"
    }
  ],
  "meta": {
    "size": 3,
    "total": 3,
    "max": 25,
    "offset": 0
  }
}

This endpoint retrieves all cypher keys associated with the account, or user.

HTTP Request

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

Query Parameters

Parameter Default Description
name null If specified will return an exact match of key
phrase null If specified will match any part of key

Get a Specific Cypher

curl "https://api.gomorpheus.com/api/cypher/2" \
  -H "Authorization: BEARER access_token"

The above command returns JSON structured like this:

{
  "cypher": {
    "id": 2,
    "itemKey": "secret/myClientId",
    "leaseTimeout": 2764800000,
    "expireDate": "2018-10-20T18:38:21+0000",
    "dateCreated": "2018-09-18T18:38:21+0000",
    "lastUpdated": "2018-09-18T18:38:21+0000",
    "lastAccessed": "2018-09-18T18:38:21+0000"
  }
}

This endpoint retrieves a specific cypher key.

HTTP Request

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

URL Parameters

Parameter Description
ID The ID of the cypher key

Decrypt a Cypher

curl "https://api.gomorpheus.com/api/cypher/2" \
  -H "Authorization: BEARER access_token"

The above command returns JSON structured like this:

{
  "cypher": {
    "id": 2,
    "itemKey": "secret/myClientId",
    "itemValue": "a secret value"
  },
  "success": true
}

This endpoint returns the decrypted value of the cypher key. The last accessed timestamp is updated.

HTTP Request

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

URL Parameters

Parameter Description
ID The ID of the cypher

Create a Cypher

curl -XPOST "https://api.gomorpheus.com/api/cypher" \
  -H "Authorization: BEARER access_token" \
  -H "Content-Type: application/json" \
  -d '{"cypher":{
    "itemKey": "secret/mysecret",
    "itemValue": "My Secret Value"
  }}'

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

HTTP Request

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

JSON Parameters

The following parameters are available under the context cypher.

Parameter Default Description
itemKey null A unique key in the format mount/key
itemValue null The value to be stored securely. Some types will generate their own value.
leaseTimeout null The Lease time in MS (default is 32 days)

Item Key

The itemKey contains two parts: the mount and the key, separated by a /.

Available Mountpoints

Keys can have different behaviors depending on the specified mountpoint.

Mount Description Example
password Generates a secure password of specified character length in the key pattern (or 15) with symbols, numbers, upper case, and lower case letters (i.e. password/15/mypass generates a 15 character password). password/15/mypass
tfvars This is a module to store a tfvars file for terraform. tfvars/mytfvar
secret This is the standard secret module that stores a key/value in encrypted form. secret/mysecret
uuid Returns a new UUID by key name when requested and stores the generated UUID by key name for a given lease timeout period. uuid/autoMac1
key Generates a Base 64 encoded AES Key of specified bit length in the key pattern (i.e. key/128/mykey generates a 128-bit key) key/128/mykey

Lease Time

Quick MS Time Reference:

Time MS
Day 86400000
Week 604800000
Month (30 days) 2592000000
Year 31536000000

Delete a Cypher

curl -XDELETE "https://api.gomorpheus.com/api/cypher/1" \
  -H "Authorization: BEARER access_token"

The above command returns JSON Structured like this:

{
  "success": true
}

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

HTTP Request

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

URL Parameters

Parameter Description
ID The ID of the cypher key

Archives

Archives provides a way to store your files and make them available for download by your Scripts and Users.

Archives are organized by buckets. Each bucket has a unique name that is used to identify it in URLs and Scripts.

Get All Archive Buckets

curl "https://api.gomorpheus.com/api/archives/buckets" \
  -H "Authorization: BEARER access_token"

The above command returns JSON structured like this:

{
  "archiveBuckets": [

    {
      "id": 1,
      "name": "testbucket",
      "description": "a test archive with local storage",
      "storageProvider": {
        "id": 2,
        "name": "testdrive2"
      },
      "owner": {
        "id": 1,
        "name": "root"
      },
      "createdBy": null,
      "isPublic": true,
      "visibility": "private",
      "code": "454ed1af504f",
      "filePath": "morpheus-archives/454ed1af504f/",
      "rawSize": 65154,
      "fileCount": 16,
      "accounts": [

      ],
      "dateCreated": "2017-06-14T14:09:01Z",
      "lastUpdated": "2017-06-14T14:09:01Z"
    },
    {
      "id": 2,
      "name": "s3bucket",
      "description": "an test archive using s3",
      "storageProvider": {
        "id": 3,
        "name": "morph-test-bucket"
      },
      "owner": {
        "id": 1,
        "name": "root"
      },
      "createdBy": null,
      "isPublic": false,
      "visibility": "private",
      "code": "4fdcad04901b",
      "filePath": "morpheus-archives/4fdcad04901b/",
      "rawSize": 70389,
      "fileCount": 18,
      "accounts": [

      ],
      "dateCreated": "2017-06-14T16:31:19Z",
      "lastUpdated": "2017-06-14T16:31:19Z"
    }
  ],
  "meta": {
    "size": 2,
    "total": 2,
    "offset": 0,
    "max": 50
  }
}

This endpoint retrieves all archive buckets associated with the account.

HTTP Request

GET https://api.gomorpheus.com/api/archives/buckets

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 Archive Bucket

curl "https://api.gomorpheus.com/api/archives/buckets/1" \
  -H "Authorization: BEARER access_token"

The above command returns JSON structured like this:

{
  "archiveBucket": {
    "id": 1,
    "name": "mybucket",
    "description": "a test bucket with local storage",
    "storageProvider": {
      "id": 10,
      "name": "testdrive3"
    },
    "owner": {
      "id": 1,
      "name": "root"
    },
    "createdBy": null,
    "isPublic": false,
    "visibility": "private",
    "code": "9dab5b3f4ada",
    "filePath": "morpheus-archives/9dab5b3f4ada/",
    "rawSize": 73909,
    "fileCount": 15,
    "accounts": [

    ],
    "dateCreated": "2018-07-20T04:07:09Z",
    "lastUpdated": "2018-07-26T19:38:17Z",
    "isOwner": true
  }
}

This endpoint retrieves a specific archive bucket.

HTTP Request

GET https://api.gomorpheus.com/api/archives/buckets/:id

URL Parameters

Parameter Description
ID The ID of the archive bucket to retrieve

Create an Archive Bucket

curl -XPOST "https://api.gomorpheus.com/api/archives/buckets" \
  -H "Authorization: BEARER access_token" \
  -H "Content-Type: application/json" \
  -d '{
  "archiveBucket": {
    "name": "mybucket",
    "description": "my archive bucket",
    "storageProvider": {
      "id": 2
    },
    "visibility": "private",
    "isPublic": false
  }
}'

The above command returns JSON structured like getting a single archive bucket:

HTTP Request

POST https://api.gomorpheus.com/api/archives/buckets

JSON Parameters

Parameter Default Description
name A name for the archive bucket. Must be globally unique.
description A description for the archive bucket
storageProvider Storage Provider
isPublic false Public URL - Set to true to allow anonymous access
visibility private Visibility - Set to public to allow all tenants
accounts Tenants - Grant read only access to certain tenants

Update an Archive Bucket

curl -XPUT "https://api.gomorpheus.com/api/archives/buckets/1" \
  -H "Authorization: BEARER access_token" \
  -H "Content-Type: application/json" \
  -d '{
  "archiveBucket": {
    "description": "our secure file store",
    "isPublic": false
  }
}'

The above command returns JSON structured like getting a single archive bucket.

HTTP Request

PUT https://api.gomorpheus.com/api/archives/buckets/1

URL Parameters

Parameter Description
ID The ID of the archive bucket

JSON Parameters

Parameter Default Description
name A name for the archive bucket. Must be globally unique
description A description for the archive bucket
isPublic false Public URL - Set to true to allow anonymous access
visibility private Visibility - Set to public to allow all tenants access.
accounts Tenants - Grant read only access to certain tenants

Delete an Archive Bucket

curl -XDELETE "https://api.gomorpheus.com/api/archives/buckets/1" \
  -H "Authorization: BEARER access_token"

The above command returns JSON Structured like this:

{
  "success": true
}

Will delete an archive bucket from the system and make it no longer usable.

HTTP Request

DELETE https://api.gomorpheus.com/api/archives/buckets/:id

URL Parameters

Parameter Description
ID The ID of the archive bucket

Get All Archive Files

curl "https://api.gomorpheus.com/api/archives/buckets/mybucket/files/"
  -H "Authorization: BEARER access_token"

The above command returns JSON structured like this:

{
  "parentDirectory": null,
  "archiveFiles": [
    {
      "id": 951,
      "name": "myapp",
      "filePath": "myapp",
      "archiveBucket": {
        "id": 38,
        "name": "mybucket",
        "isPublic": false
      },
      "createdBy": {
        "username": "admin"
      },
      "isDirectory": true,
      "status": "Active",
      "rawSize": 26719,
      "contentType": null,
      "dateCreated": "2018-07-26T19:38:17Z",
      "lastUpdated": "2018-07-26T19:38:17Z"
    },
    {
      "id": 933,
      "name": "readme.txt",
      "filePath": "readme.txt",
      "archiveBucket": {
        "id": 38,
        "name": "mybucket",
        "isPublic": false
      },
      "createdBy": {
        "username": "admin"
      },
      "isDirectory": false,
      "status": "Active",
      "rawSize": 47104,
      "contentType": "text/plain",
      "dateCreated": "2018-07-20T04:07:33Z",
      "lastUpdated": "2018-07-20T04:07:33Z"
    }
  ],
  "archiveBucket": {
    "id": 38,
    "name": "mybucket",
    "description": "a test bucket with local storage",
    "storageProvider": {
      "id": 10,
      "name": "testdrive3"
    },
    "owner": {
      "id": 1,
      "name": "root"
    },
    "createdBy": null,
    "isPublic": false,
    "visibility": "private",
    "code": "9dab5b3f4ada",
    "filePath": "morpheus-archives/9dab5b3f4ada/",
    "rawSize": 73823,
    "fileCount": 3,
    "accounts": [

    ],
    "dateCreated": "2018-07-20T04:07:09Z",
    "lastUpdated": "2018-07-26T19:38:17Z"
  },
  "isOwner": true,
  "meta": {
    "size": 2,
    "total": 2,
    "offset": 0,
    "max": 50
  }
}

This endpoint retrieves all files in an archive bucket under the specified filePath.

HTTP Request

GET https://api.gomorpheus.com/api/archives/buckets/:bucket/files/:filePath

URL Parameters

Parameter Description
bucket The Name or ID of the archive bucket
filePath The directory to search under. The root directory / is the default.

Query Parameters

Parameter Default Description
name If specified will return an exact match on name
phrase If specified will return a partial match on filePath
fullTree false Include files under sub directories too. This is always true when searching with phrase.
curl "https://api.gomorpheus.com/api/archives/files/954"
  -H "Authorization: BEARER access_token"

The above command returns JSON structured like this:

{
  "archiveFile": {
    "id": 954,
    "name": "articles_controller.rb",
    "filePath": "future/app/controllers/agents_controller.rb",
    "archiveBucket": {
      "id": 38,
      "name": "b10",
      "isPublic": false
    },
    "createdBy": {
      "username": "tom"
    },
    "isDirectory": false,
    "status": "Active",
    "rawSize": 8534,
    "contentType": "application/octet-stream",
    "downloadCount": 0,
    "dateCreated": "2017-07-26T19:38:17Z",
    "lastUpdated": "2017-07-27T02:03:49Z"
  },
  "isOwner": true
}

Get details about a specific archive file.

HTTP Request

GET https://api.gomorpheus.com/api/archives/files/:fileId

URL Parameters

Parameter Description
fileId The ID of the archive file

Upload Archive File

curl -XPOST "https://api.gomorpheus.com/api/archives/buckets/mybucket/files/myapp/config/?filename=application.rb" \
  -H "Authorization: BEARER access_token" \
  -F 'file=@filename'

The above command returns JSON structure like this:

{
  "success": true
}

Upload a file to the specified archive bucket and file path.

HTTP Request

POST https://api.gomorpheus.com/api/archives/buckets/:bucket/files/:filePath

URL Parameters

Parameter Description
bucket The Name or ID of the archive bucket
filePath The directory for the file being uploaded. The root directory / is the default.

Query Parameters

Parameter Description
filename Specify a filename for archive file. The base filename of the uploaded file is the default.

Download an Archive File

curl -XGET "https://api.gomorpheus.com/api/archives/download/mybucket/myapp/config/application.rb" \
  -H "Authorization: BEARER access_token"

The above command returns the contents of the specified file as an attachment with Content-Type dicated by the file

Download the file as an authorized user with access to the bucket.

HTTP Request

POST https://api.gomorpheus.com/api/archives/download/:bucket/:filePath

URL Parameters

Parameter Description
bucket The Name or ID of the archive bucket
filePath The full path of the file being downloaded

Download a Public Archive File

curl -XGET "https://api.gomorpheus.com/public-archives/download/mybucket/pubdemo/GREETINGS.md"

The above command returns the contents of the file as an attachment with Content-Type dicated by the file

Files in an archive bucket that has Public URL enabled can be downloaded via this endpoint without any authentication, anonymously.

HTTP Request

POST https://api.gomorpheus.com/public-archives/download/:bucket/:filePath

URL Parameters

Parameter Description
bucket The Name or ID of the archive bucket
filePath The full path of the file being downloaded

Delete Archive File

curl -XDELETE "https://api.gomorpheus.com/api/archives/files/99" \
  -H "Authorization: BEARER access_token"

The above command returns JSON structure like this:

{
  "success": true
}

Permanently delete a file or directory.

HTTP Request

DELETE https://api.gomorpheus.com/api/archives/files/:fileId

URL Parameters

Parameter Description
fileId The ID of the archive file

HTTP Request

curl "https://api.gomorpheus.com/api/archives/files/1/links"
  -H "Authorization: BEARER access_token"
{
  "archiveFileLinks": [
    {
      "id": 2,
      "secretAccessKey": "6e37727235041746",
      "archiveFile": {
        "id": 1,
        "name": "config.ini",
        "filePath": "config.ini"
      },
      "createdBy": {
        "username": "admin"
      },
      "dateCreated": "2018-09-20T21:15:38Z",
      "lastUpdated": "2018-09-20T21:15:38Z",
      "lastAccessDate": null,
      "expirationDate": null,
      "downloadCount": 0
    },
    {
      "id": 1,
      "secretAccessKey": "6562129e9e546b9",
      "archiveFile": {
        "id": 1,
        "name": "config.ini",
        "filePath": "config.ini"
      },
      "createdBy": {
        "username": "admin"
      },
      "dateCreated": "2018-09-20T21:06:04Z",
      "lastUpdated": "2018-09-20T21:09:26Z",
      "lastAccessDate": null,
      "expirationDate": "2018-09-20T21:26:04Z",
      "downloadCount": 1
    }
  ],
  "meta": {
    "size": 2,
    "total": 2,
    "offset": 0,
    "max": 50
  }
}

This endpoint retrieves the links that have been created for the specified file.

HTTP Request

GET https://api.gomorpheus.com/api/archives/files/:fileId/links

URL Parameters

Parameter Description
fileId The ID of the archive file
curl -XPOST "https://api.gomorpheus.com/api/archives/files/:fileId/links" \
  -H "Authorization: BEARER access_token" \
  -H "Content-Type: application/json" \

The above command returns JSON structured like this:

{
  "success": true,
  "secretAccessKey": "45a214fce9a546b9"
}

This returns a secret token that can be used to download the file via a public url, without any other authentication or authorization. File links can be set to expire after a certain amount of time.

See Download an Archive File Link

HTTP Request

POST https://api.gomorpheus.com/api/archives/files/:fileId/links

URL Parameters

Parameter Description
fileId The ID of the archive file

Query Parameters

Parameter Default Description
expireSeconds 0 Time to live in seconds. 0 means do not expire.
curl -XDELETE "https://api.gomorpheus.com/api/archives/files/1/links/1" \
  -H "Authorization: BEARER access_token" \
  -H "Content-Type: application/json" \

The above command returns JSON structured like this:

{
  "success": true
}

This will delete the link from the system, so it can no longer be used.

HTTP Request

DELETE https://api.gomorpheus.com/api/archives/files/:fileId/links/:linkId

URL Parameters

Parameter Description
fileId The ID of the archive file
linkId The ID of the archive file link
curl -XGET "https://api.gomorpheus.com/public-archives/link?s=45a214fce9a546b9"

The above command returns the contents of the file as an attachment with Content-Type dicated by the file

Download an archive file lin

HTTP Request

POST https://api.gomorpheus.com/public-archives/link?s=:secretAccessToken

URL Parameters

Parameter Description
s The secret access token for the archive file being downloaded. See Create An Archive File Link

Image Builds

Image Builds are used to generate Virtual Images for your Morpheus Library.

Get All Image Builds

curl "https://api.gomorpheus.com/api/image-builds" \
  -H "Authorization: BEARER access_token"

The above command returns JSON structured like this:

{
  "imageBuilds": [
    {
      "id": 1,
      "account": {
        "id": 1,
        "name": "root"
      },
      "type": {
        "id": 1,
        "code": "vmware",
        "name": "VMware"
      },
      "site": {
        "id": 1,
        "name": "my-group"
      },
      "zone": {
        "id": 1,
        "name": "my-vmware"
      },
      "name": "testbuild",
      "description": "a test build",
      "bootScript": {
        "id": 2,
        "fileName": "debian standard"
      },
      "bootCommand": null,
      "preseedScript": {
        "id": 2,
        "fileName": "debian 8"
      },
      "scripts": [
        {
          "id": 114,
          "name": "blah.txt",
          "type": "bash",
          "phase": "postProvision"
        }
      ],
      "sshUsername": "builderbot",
      "sshPassword": "************",
      "storageProvider": null,
      "buildOutputName": "mytestbuild",
      "conversionFormats": null,
      "isCloudInit": false,
      "vmToolsInstalled": true,
      "keepResults": 2,
      "config": {
      },
      "lastResult": {
        "id": 70,
        "imageBuild": {
          "id": 21,
          "name": "testbuild"
        },
        "buildNumber": 6,
        "startDate": "2017-09-28T05:48:03Z",
        "endDate": null,
        "statusMessage": "Initializing",
        "statusPercent": 0.0,
        "statusEta": null,
        "status": "running",
        "errorMessage": null,
        "createdBy": {
          "username": "admin"
        },
        "tempInstance": null,
        "virtualImages": [

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

This endpoint retrieves all image builds associated with the account.

HTTP Request

GET https://api.gomorpheus.com/api/image-builds

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 Image Build

curl "https://api.gomorpheus.com/api/image-builds/4" \
  -H "Authorization: BEARER access_token"

The above command returns JSON structured like this (config omited) :

{
  "imageBuild": {
    "id": 1,
    "account": {
      "id": 1,
      "name": "root"
    },
    "type": {
      "id": 1,
      "code": "vmware",
      "name": "VMware"
    },
    "site": {
      "id": 1,
      "name": "my-group"
    },
    "zone": {
      "id": 1,
      "name": "my-vmware"
    },
    "name": "testbuild",
    "description": "a test build",
    "bootScript": {
      "id": 2,
      "fileName": "debian standard"
    },
    "bootCommand": null,
    "preseedScript": {
      "id": 2,
      "fileName": "debian 8"
    },
    "scripts": [
      {
        "id": 114,
        "name": "cleanup.sh",
        "type": "bash",
        "phase": "postProvision"
      }
    ],
    "sshUsername": "builderbot",
    "sshPassword": "************",
    "storageProvider": null,
    "buildOutputName": null,
    "conversionFormats": null,
    "isCloudInit": false,
    "vmToolsInstalled": true,
    "keepResults": 2,
    "config": {
      "instance": {
        "layout": {
          "code": "vmware-1.0-single",
          "id": 142
        },
        "type": "vmware",
        "userGroup": {
          "id": ""
        }
      },
      "networkInterfaces": [
        {
          "primaryInterface": true,
          "network": {
            "id": "network-147"
          }
        }
      ],
      "volumes": [
        {
          "vId": 1752,
          "size": 10,
          "maxIOPS": null,
          "name": "root",
          "rootVolume": true,
          "storageType": 1,
          "datastoreId": "auto"
        }
      ],
      "storageControllers": [

      ],
      "zoneId": 1,
      "config": {
        "template": 1752,
        "vmwareResourcePoolId": "resgroup-123",
        "expose": 8080
      },
      "plan": {
        "code": "vm-512",
        "id": 75
      }
    },
    "lastResult": {
      "id": 70,
      "imageBuild": {
        "id": 21,
        "name": "testbuild"
      },
      "buildNumber": 6,
      "startDate": "2017-09-28T05:48:03Z",
      "endDate": null,
      "statusMessage": "Booting",
      "statusPercent": 20.0,
      "statusEta": null,
      "status": "running",
      "errorMessage": null,
      "createdBy": {
        "username": "admin"
      },
      "tempInstance": null,
      "virtualImages": [

      ]
    },
    "executionCount": 4
  },
  "imageBuildExecutions": [
    {
      "id": 70,
      "imageBuild": {
        "id": 21,
        "name": "testbuild"
      },
      "buildNumber": 6,
      "startDate": "2017-09-28T05:48:03Z",
      "endDate": null,
      "statusMessage": "Booting",
      "statusPercent": 20.0,
      "statusEta": null,
      "status": "running",
      "errorMessage": null,
      "createdBy": {
        "username": "admin"
      },
      "tempInstance": null,
      "virtualImages": [

      ]
    },
    {
      "id": 57,
      "imageBuild": {
        "id": 21,
        "name": "testbuild"
      },
      "buildNumber": 3,
      "startDate": "2017-09-27T02:41:26Z",
      "endDate": "2017-09-27T03:08:30Z",
      "statusMessage": null,
      "statusPercent": 100.0,
      "statusEta": null,
      "status": "success",
      "errorMessage": null,
      "createdBy": {
        "username": "admin"
      },
      "tempInstance": null,
      "virtualImages": [
        {
          "id": 1812,
          "name": "testbuild-1-156-1506480866464"
        }
      ]
    }
  ]
}

This endpoint retrieves a specific image build.

HTTP Request

GET https://api.gomorpheus.com/api/image-builds/:id

URL Parameters

Parameter Description
ID The ID of the image build to retrieve

Create an Image Build

curl -XPOST "https://api.gomorpheus.com/api/image-builds" \
  -H "Authorization: BEARER access_token" \
  -H "Content-Type: application/json" \
  -d '{
  "imageBuild": {
    "type": "vmware",
    "name": "builder test",
    "description": null,
    "site": {
      "id": 1
    },
    "zone": {
      "id": 1
    },
    "config": {
      "zoneId": 1,
      "instance": {
        "name": "builder test",
        "site": {
          "id": 1
        },
        "type": "vmware",
        "instanceType": {
          "code": "vmware"
        },
        "layout": {
          "id": 142
        },
        "plan": {
          "id": 76
        },
        "networkDomain": {
        }
      },
      "config": {
        "resourcePoolId": "resgroup-123",
        "template": 1232,
        "nestedVirtualization": "off",
        "expose": "8080"
      },
      "volumes": [
        {
          "id": -1,
          "rootVolume": true,
          "name": "root",
          "size": 10,
          "storageType": 1,
          "datastoreId": "autoCluster"
        }
      ],
      "networkInterfaces": [
        {
          "network": {
            "id": "network-147"
          },
          "networkInterfaceTypeId": 4
        }
      ]
    },
    "bootScript": {
      "id": 2
    },
    "preseedScript": {
      "id": 2
    },
    "scripts": [

    ],
    "sshUsername": "builderbot",
    "sshPassword": "password",
    "storageProvider": null,
    "isCloudInit": "off",
    "buildOutputName": null,
    "conversionFormats": null,
    "keepResults": 0
  }
}'

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

HTTP Request

POST https://api.gomorpheus.com/api/image-builds

JSON Parameters

Parameter Default Description
name A name for the image build
description A description for the image build
type The image builder type. [vmware]
site Group
zone Cloud
config A map of config values. This is the instance config that is used for provisioning. See Provisioning Types.
bootScript Boot Script
preseedScript Preseed Script
sshUsername SSH Username
sshPassword SSH Password
storageProvider Storage Provider
isCloudInit Cloud Init
buildOutputName Build Output Name
conversionFormats Conversion Formats - ie. ovf, qcow2, vhd
keepResults 0 Keep Results - Keep only the most recent builds. Older executions will be deleted along with their associated Virtual Images. The value 0 disables this functionality.

Update an Image Build

curl -XPUT "https://api.gomorpheus.com/api/image-builds/1" \
  -H "Authorization: BEARER access_token" \
  -H "Content-Type: application/json" \
  -d '{
  "imageBuild": {
    "description": "a good build",
    "keepResults": 5,
  }
}'

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

HTTP Request

PUT https://api.gomorpheus.com/api/image-builds/1

URL Parameters

Parameter Description
ID The ID of the image build

JSON Parameters

See Create.

Delete an Image Build

curl -XDELETE "https://api.gomorpheus.com/api/image-builds/1" \
  -H "Authorization: BEARER access_token"

The above command returns JSON Structured like this:

{
  "success": true
}

Will delete an image build from the system and make it no longer usable.

HTTP Request

DELETE https://api.gomorpheus.com/api/image-builds/:id

URL Parameters

Parameter Description
ID The ID of the image build

Run an Image Build

curl -XPOST "https://api.gomorpheus.com/api/image-builds/1/run" \
  -H "Authorization: BEARER access_token"

The above command returns JSON structured like this:

{
  "success": true
}

Running an image build is done asynchronously. This api will kick off the new execution and update the image build status.

HTTP Request

POST https://api.gomorpheus.com/api/image-builds/1/run

URL Parameters

Parameter Description
ID The ID of the image build

List Image Build Executions

curl "https://api.gomorpheus.com/api/image-builds/1/list-executions" \
  -H "Authorization: BEARER access_token"

The above command returns JSON structured like this:

{
  "imageBuildExecutions": [
    {
      "id": 82,
      "imageBuild": {
        "id": 20,
        "name": "my-testbuild"
      },
      "buildNumber": 2,
      "startDate": "2017-09-29T15:30:07Z",
      "endDate": null,
      "statusMessage": "Installing",
      "statusPercent": 25.0,
      "statusEta": null,
      "status": "running",
      "errorMessage": null,
      "createdBy": {
        "username": "admin"
      },
      "tempInstance": null,
      "virtualImages": [

      ]
    },
    {
      "id": 81,
      "imageBuild": {
        "id": 20,
        "name": "my-testbuild"
      },
      "buildNumber": 1,
      "startDate": "2017-09-29T14:57:33Z",
      "endDate": "2017-09-29T15:26:41Z",
      "statusMessage": null,
      "statusPercent": 100.0,
      "statusEta": null,
      "status": "success",
      "errorMessage": null,
      "createdBy": {
        "username": "admin"
      },
      "tempInstance": null,
      "virtualImages": [
        {
          "id": 1850,
          "name": "my-testbuild-4-176-1506697891084"
        }
      ]
    }
  ],
  "imageBuildExecutionCount": 2,
  "meta": {
    "offset": 0,
    "max": 25,
    "size": 2,
    "total": 2
  }
}

List all executions for an image build. This same info is also returned by the image build GET api, which returns the 100 most recent executions.

HTTP Request

GET https://api.gomorpheus.com/api/image-builds/1/list-executions

URL Parameters

Parameter Description
ID The ID of the image build

Query Parameters

Parameter Default Description
buildNumber If specified will return an exact match on buildNumber
status Filter by status [running, success, failed]

Boot Scripts

Boot Scripts are used in the Image Builder service. See Image Builds

Get All Boot Scripts

curl "https://api.gomorpheus.com/api/boot-scripts"
  -H "Authorization: BEARER access_token"

The above command returns JSON structured like this:

{
  "bootScripts": [
    {
      "id": 1,
      "account": {
        "id": 1,
        "name": "root"
      },
      "fileName": "debian standard",
      "description": null,
      "content": "...",
      "createdBy": {
        "username": "admin"
      },
      "visibility": "private"
    }
  ],
  "meta": {
    "offset": 0,
    "max": 25,
    "size": 1,
    "total": 1
  }
}

This endpoint retrieves all boot scripts associated with the account.

HTTP Request

GET https://api.gomorpheus.com/api/boot-scripts

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 Boot Script

curl "https://api.gomorpheus.com/api/boot-scripts/1" \
  -H "Authorization: BEARER access_token"

The above command returns JSON structured like this:

{
  "bootScript": {
    "id": 1,
    "account": {
      "id": 1,
      "name": "root"
    },
    "fileName": "debian standard",
    "description": null,
    "content": "...",
    "createdBy": {
      "username": "admin"
    },
    "visibility": "private"
  }
}

This endpoint retrieves a specific boot script.

HTTP Request

GET https://api.gomorpheus.com/api/boot-scripts/:id

URL Parameters

Parameter Description
ID The ID of the boot script to retrieve

Create a Boot Script

curl -XPOST "https://api.gomorpheus.com/api/boot-scripts" \
  -H "Authorization: BEARER access_token" \
  -H "Content-Type: application/json" \
  -d '{
  "bootScript": {
    "fileName": "debian standard",
    "content": "<esc><wait>install <wait> preseed/url=<%=preseedUrl%> <wait>debian-installer=en_US.UTF-8 <wait>auto <wait>locale=en_US.UTF-8 <wait>kbd-chooser/method=us <wait>keyboard-configuration/xkb-keymap=us <wait>netcfg/get_hostname=<%=container.hostname%> <wait>netcfg/get_domain=morpheusdata.com <wait>fb=false <wait>debconf/frontend=noninteractive <wait>console-setup/ask_detect=false <wait>console-keymaps-at/keymap=us <wait>grub-installer/bootdev=/dev/sda <wait><enter><wait>"
  }
}'

The above command returns JSON structured like getting a single boot script:

HTTP Request

POST https://api.gomorpheus.com/api/boot-scripts

JSON Parameters

Parameter Default Description
fileName A name for the boot script
content The script content

Update a Boot Script

curl -XPUT "https://api.gomorpheus.com/api/boot-scripts/1" \
  -H "Authorization: BEARER access_token" \
  -H "Content-Type: application/json" \
  -d '{
  "bootScript": {
    "name": "debian default"
  }
}'

The above command returns JSON structured like getting a single boot script:

HTTP Request

PUT https://api.gomorpheus.com/api/boot-scripts/1

URL Parameters

Parameter Description
ID The ID of the boot script

JSON Parameters

Same as Create.

Delete an Boot Script

curl -XDELETE "https://api.gomorpheus.com/api/boot-scripts/1" \
  -H "Authorization: BEARER access_token"

The above command returns JSON Structured like this:

{
  "success": true
}

Will delete a boot script from the system and make it no longer usable.

HTTP Request

DELETE https://api.gomorpheus.com/api/boot-scripts/:id

URL Parameters

Parameter Description
ID The ID of the boot script

Preseed Scripts

Preseed Scripts are used in the Image Builder service. See Image Builds

Get All Preseed Scripts

curl "https://api.gomorpheus.com/api/preseed-scripts"
  -H "Authorization: BEARER access_token"

The above command returns JSON structured like this:

{
  "preseedScripts": [
    {
      "id": 1,
      "account": {
        "id": 1,
        "name": "root"
      },
      "fileName": "debian 8",
      "description": null,
      "content": "...",
      "createdBy": {
        "username": "admin"
      }
    }
  ],
  "meta": {
    "offset": 0,
    "max": 25,
    "size": 1,
    "total": 1
  }
}

This endpoint retrieves all preseed scripts associated with the account.

HTTP Request

GET https://api.gomorpheus.com/api/preseed-scripts

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 Preseed Script

curl "https://api.gomorpheus.com/api/preseed-scripts/1" \
  -H "Authorization: BEARER access_token"

The above command returns JSON structured like this:

{
  "preseedScript": {
    "id": 1,
    "account": {
      "id": 1,
      "name": "root"
    },
    "fileName": "debian 8",
    "description": null,
    "content": "...",
    "createdBy": {
      "username": "admin"
    }
  }
}

This endpoint retrieves a specific preseed script.

HTTP Request

GET https://api.gomorpheus.com/api/preseed-scripts/:id

URL Parameters

Parameter Description
ID The ID of the preseed script to retrieve

Create a Preseed Script

curl -XPOST "https://api.gomorpheus.com/api/preseed-scripts" \
  -H "Authorization: BEARER access_token" \
  -H "Content-Type: application/json" \
  -d '{
  "preseedScript": {
    "fileName": "ubuntu build",
    "content": "choose-mirror-bin mirror/http/proxy string\nd-i apt-setup/use_mirror boolean true\nd-i base-installer/kernel/override-image string linux-server\nd-i debian-installer/add-kernel-opts string net.ifnames=0 biosdevname=0\nd-i clock-setup/utc boolean true\nd-i clock-setup/utc-auto boolean true\nd-i finish-install/reboot_in_progress note\nd-i grub-installer/only_debian boolean true\nd-i grub-installer/with_other_os boolean true\nd-i keymap select us\nd-i mirror/country string manual\nd-i mirror/http/directory string /debian\nd-i mirror/http/hostname string httpredir.debian.org\nd-i mirror/http/proxy string\n# Alternatively, you may specify a disk to partition. If the system has only\n# one disk the installer will default to using that, but otherwise the device\n# name must be given in traditional, non-devfs format (so e.g. /dev/sda\n# and not e.g. /dev/discs/disc0/disc).\n# For example, to use the first SCSI/SATA hard disk:\n#d-i partman-auto/disk string /dev/sda\n# In addition, you'll need to specify the method to use.\n# The presently available methods are:\n# - regular: use the usual partition types for your architecture\n# - lvm:     use LVM to partition the disk\n# - crypto:  use LVM within an encrypted partition\nd-i partman-auto/method string regular\n\n# If one of the disks that are going to be automatically partitioned\n# contains an old LVM configuration, the user will normally receive a\n# warning. This can be preseeded away...\nd-i partman-lvm/device_remove_lvm boolean true\n# The same applies to pre-existing software RAID array:\nd-i partman-md/device_remove_md boolean true\n# And the same goes for the confirmation to write the lvm partitions.\nd-i partman-lvm/confirm boolean true\nd-i partman-lvm/confirm_nooverwrite boolean true\n\n# For LVM partitioning, you can select how much of the volume group to use\n# for logical volumes.\n#d-i partman-auto-lvm/guided_size string max\n#d-i partman-auto-lvm/guided_size string 10GB\n#d-i partman-auto-lvm/guided_size string 50%\n\n# You can choose one of the three predefined partitioning recipes:\n# - atomic: all files in one partition\n# - home:   separate /home partition\n# - multi:  separate /home, /var, and /tmp partitions\nd-i partman-auto/choose_recipe select atomic\nd-i partman-basicfilesystems/no_swap boolean false\nd-i partman-auto/expert_recipe string \\\n    single-root :: \\\n\t\t  1000 50 -1 ext4 \\\n      $primary{ } \\\n\t\t\t$bootable{ } \\\n\t\t\tmethod{ format } \\\n      format{ } \\\n\t\t\tuse_filesystem{ } \\\n\t\t\tfilesystem{ ext4 } \\\n      mountpoint{ / } .\nd-i partman-auto/choose_recipe select single-root\nd-i partman/mount_style select uuid\nd-i partman/choose_partition select finish\nd-i partman/confirm boolean true\nd-i partman/confirm_nooverwrite boolean true\nd-i partman/confirm_write_new_label boolean true\nd-i passwd/root-login boolean false\nd-i passwd/root-password-again password password\nd-i passwd/root-password password password\nd-i passwd/user-fullname string builderbot\nd-i passwd/user-uid string 1000\nd-i passwd/user-password password password\nd-i passwd/user-password-again password password\nd-i passwd/username string builderbot\nd-i pkgsel/include string openssh-server cryptsetup build-essential libssl-dev libreadline-dev zlib1g-dev linux-source dkms nfs-common open-vm-tools\nd-i pkgsel/install-language-support boolean false\nd-i pkgsel/update-policy select none\nd-i pkgsel/upgrade select full-upgrade\n# Prevent packaged version of VirtualBox Guest Additions being installed:\nd-i preseed/early_command string sed -i \\\n  '/in-target/idiscover(){/sbin/discover|grep -v VirtualBox;}' \\\n  /usr/lib/pre-pkgsel.d/20install-hwpackages\nd-i time/zone string UTC\nd-i user-setup/allow-password-weak boolean true\nd-i user-setup/encrypt-home boolean false\nd-i preseed/late_command string sed -i '/^deb cdrom:/s/^/#/' /target/etc/apt/sources.list\napt-cdrom-setup apt-setup/cdrom/set-first boolean false\napt-mirror-setup apt-setup/use_mirror boolean true\npopularity-contest popularity-contest/participate boolean false\ntasksel tasksel/first multiselect standard, ssh-server"
  }
}'

The above command returns JSON structured like getting a single preseed script:

HTTP Request

POST https://api.gomorpheus.com/api/preseed-scripts

JSON Parameters

Parameter Default Description
fileName A name for the preseed script
content The script content

Update a Preseed Script

curl -XPUT "https://api.gomorpheus.com/api/preseed-scripts/1" \
  -H "Authorization: BEARER access_token" \
  -H "Content-Type: application/json" \
  -d '{
  "preseedScript": {
    "name": "good ubuntu"
  }
}'

The above command returns JSON structured like getting a single preseed script:

HTTP Request

PUT https://api.gomorpheus.com/api/preseed-scripts/1

URL Parameters

Parameter Description
ID The ID of the preseed script

JSON Parameters

See Create.

Delete a Preseed Script

curl -XDELETE "https://api.gomorpheus.com/api/preseed-scripts/1" \
  -H "Authorization: BEARER access_token"

The above command returns JSON Structured like this:

{
  "success": true
}

Will delete a preseed script from the system and make it no longer usable.

HTTP Request

DELETE https://api.gomorpheus.com/api/preseed-scripts/:id

URL Parameters

Parameter Description
ID The ID of the preseed script