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.

The current version is 3.6.3

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

This endpoint retrieves 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
createdBy null Filter by Created By (User) ID. Accepts multiple values.

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

This endpoint retrieves a specific app.

HTTP Request

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

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",
    "group": {
      "id": 1
    }
  }}'

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

HTTP Request

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

JSON App Parameters

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

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
instanceId null The ID of the instance being added
tierName null The Name of the Tier

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 removed

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 -XPOST "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

POST 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 ’[]’

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/apps/: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

Blueprints

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

Get All Blueprints

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

The above command returns JSON structured like this:

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

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

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

This endpoint retrieves all blueprints.

HTTP Request

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

Query Parameters

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

Get a Specific Blueprint

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

The above command returns JSON structured like this:

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

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

      ]
    }
  }
}

This endpoint retrieves a specific blueprint.

HTTP Request

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

Create a Blueprint

curl -XPOST "https://api.gomorpheus.com/api/blueprints" \
  -H "Authorization: BEARER access_token" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "sample",
    "description": "A sample blueprint",
    "type": "morpheus",
    "tiers": {
      "Web": {
        "linkedTiers": [

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

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

HTTP Request

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

JSON Blueprint Parameters

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

Blueprint Tiers Configuration

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

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

Updating a Blueprint

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

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

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

HTTP Request

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

JSON Blueprint Parameters

Same as Create.

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

Update Blueprint Permissions

curl -XPOST "https://api.gomorpheus.com/api/blueprints/1/update-permissions" \
  -H "Authorization: BEARER access_token" \
  -H "Content-Type: application/json" \
  -d '{ "resourcePermission": {
    "all":false,
    "sites": [
      {"id": 1}
    ]
  }}'

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

HTTP Request

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

JSON Parameters

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

Update Blueprint Image

curl -XPOST "https://api.gomorpheus.com/api/blueprints/1/image" \
  -H "Authorization: BEARER access_token"
  -F 'templateImage=@filename'

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

HTTP Request

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

Parameters

Parameter Default Description
templateImage null Image File png,jpg,svg

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

Delete a Blueprint

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

The above command returns JSON structure like this:

{
  "success": true
}

HTTP Request

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

Instances

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

Get All Instances

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

This endpoint retrieves 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
name null Filter by name
phrase null Filter by wildcard search of name and description
instanceType null Filter by instance type code
lastUpdated null Date filter, restricts query to only load instances updated timestamp is more recent or equal to the date specified
createdBy null Filter by Created By (User) ID. Accepts multiple values.

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
    ],
    "servers": [
      2
    ],
    "connectionInfo": [
      {
        "ip": "10.211.55.11",
        "port": 10000
      }
    ],
    "layout": {
      "id": 221
    },
    "plan": {
      "id": 69,
      "code": "container-512"
    },
    "name": "redistest",
    "description": null,
    "instanceVersion": null,
    "tags": [

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

This endpoint retrieves a specific instance.

HTTP Request

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

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 Instance History

curl "https://api.gomorpheus.com/api/238/history" \
  -H "Authorization: BEARER access_token"

The above command returns JSON structured like this:

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

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

This endpoint retrieves the process history for a specific instance.

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

HTTP Request

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

Query Parameters

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

Get Container Details

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

The above command returns JSON structured like this:

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

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

HTTP Request

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

Get Available Service Plans for an Instance

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

The above command returns JSON structure like this:

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

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

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

      ],
      "coreOptions": [

      ],
      "memoryOptions": [

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

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

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

HTTP Request

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

Query Parameters

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

Create an Instance

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.

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

POST 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 ’[]’

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

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

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. See Available Service Plans
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.
taskSetName N null The Workflow Name to execute.

Volumes

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

Parameter Required Default Description
id N -1 The id for the LV configuration being created
rootVolume N true If set to false then a non-root LV will be created
name Y root Name/type of the LV being created
size N [from service plan] Size of the LV to be created in GBs
sizeId N 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
resourcePoolId Y null External 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
JSON Config Parameters for Docker
Parameter Required Default Description
provisionServerId N null Specific host to deploy to if so desired
resourcePoolId Y null External ID of the resource group to use for instance

Metadata

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

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

Documentation on ALL of the provision types to come…

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

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 Deployment Verison userVersion identifier.
versionId null Deployment Version ID. This can be passed instead of userVersion.
deployType browser The type of deployment. File based is browser, git for git and fetch for fetching from a url
gitUrl 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
configMap 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": {  "webMethod": "GET",  "webUrl": "http://google.com"},
      "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": {"webMethod": "GET", "webUrl": "http://google.com"},
    "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": {
      "webMethod": "GET",
      "webUrl": "http://google.com"
    }
  }}'

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": {
      "webMethod": "GET",
      "webUrl": "http://google.com"
    }
  }}'

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 Default Description
enabled true Set to false to unmute

Mute All Checks

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

The above command returns JSON structure like this:

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

This endpoint can be used to toggle the mute state on and off for all checks.

HTTP Request

PUT https://api.gomorpheus.com/api/monitoring/checks/mute-all

JSON Parameters

Parameter Default Description
enabled true Set to false to unmute

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.

HTTP Request

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

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 Default Description
enabled true Set to false to unmute

Mute All Incidents

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

The above command returns JSON structure like this:

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

This endpoint can be used to toggle the mute state (inUptime) of all open incidents.

HTTP Request

PUT https://api.gomorpheus.com/api/monitoring/incidents/mute-all

JSON Parameters

Parameter Default Description
enabled true Set to false to unmute

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
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",
    "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
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

HTTP Request

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

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
accountId null Specifies which Tenant 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
accountId null Specifies which Tenant 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

HTTP Request

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

Get Security Groups

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

POST 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 ’[]’

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

Query Parameters

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

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

Resource Pools

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

Get All Resource Pools for Cloud

curl "https://api.gomorpheus.com/api/zones/5/resource-pools"
  -H "Authorization: BEARER access_token"

The above command returns JSON structured like this:

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

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

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

This endpoint retrieves all resource pools under a cloud.

HTTP Request

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

URL Parameters

Parameter Description
zoneId The ID of the cloud

Query Parameters

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

Get a Specific Resource Pool

curl "https://api.gomorpheus.com/api/zones/5/resource-pools/50" \
  -H "Authorization: BEARER access_token"

The above command returns JSON structured like this:

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

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

      ]
    },
    "depth": 0
  }
}

This endpoint retrieves a specific resource pool.

HTTP Request

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

URL Parameters

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

Create a Resource Pool

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

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

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

HTTP Request

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

URL Parameters

Parameter Description
zoneId The ID of the cloud

JSON Parameters

Parameter Default Description
name null Name
defaultPool false Set as the Default Pool
defaultImage false Set as the Default Image Target
active true Activate (true) or disable (false) the resource pool
visibility private private or public
tenantPermissions.accounts 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

JSON Parameters for Amazon Resource Pool

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

JSON Parameters for Cloud Foundry

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

Updating a Resource Pool

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

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

This endpoint allows updating settings for a resource pool.

HTTP Request

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

URL Parameters

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

JSON Parameters

Parameter Default Description
active null Activate (true) or disable (false) the resource pool
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

Delete a Resource Pool

curl -XDELETE "https://api.gomorpheus.com/api/zones/5/resource-pools/50" \
  -H "Authorization: BEARER access_token"

The above command returns JSON structure like this:

{
  "success": true
}

HTTP Request

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

URL Parameters

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

Resource Folders

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

Get All Resource Folders for Cloud

curl "https://api.gomorpheus.com/api/zones/5/folders"
  -H "Authorization: BEARER access_token"

The above command returns JSON structured like this:

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

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

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

This endpoint retrieves all resource folders under a cloud.

HTTP Request

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

URL Parameters

Parameter Description
zoneId The ID of the cloud

Query Parameters

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

Get a Specific Resource Folder

curl "https://api.gomorpheus.com/api/zones/5/folders/50" \
  -H "Authorization: BEARER access_token"

The above command returns JSON structured like this:

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

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

      ]
    }
  }
}

This endpoint retrieves a specific resource folder.

HTTP Request

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

URL Parameters

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

Updating a Resource Folder

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

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

This endpoint allows updating settings for a resource folder.

HTTP Request

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

URL Parameters

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

JSON Parameters

Parameter Default Description
defaultFolder false Set as the Default Folder
defaultImage false Set as the Default Image Target
active null Activate (true) or disable (false) the resource folder
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
createdBy null Filter by Created By (User) ID. Accepts multiple values.

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

Get Available Service Plans for a Server

curl -XGET "https://api.gomorpheus.com/api/servers/service-plans?zoneId=2&serverTypeId=60" \
  -H "Authorization: BEARER access_token"

The above command returns JSON structure like this:

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

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

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

      ],
      "coreOptions": [

      ],
      "memoryOptions": [

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

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

This endpoint can be used to get the list of plans available for provisioning a new server or resizing a server.

HTTP Request

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

Query Parameters

Parameter Description
zoneId The ID of the Cloud
serverTypeId The ID of the Server Type

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
sshUsername null SSH Username
sshPassword null SSH Password
powerScheduleType null Power Schedule ID

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.

HTTP Request

PUT https://api.gomorpheus.com/api/servers/:id/install-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). See Available Service Plans
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.

NOTE: A Server Type in the API Is equivalent to a Host Type within the morpheus UI.

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
sort displayOrder Sort order
direction asc Sort direction, use ‘desc’ to reverse sort
name null Filter by name or code
code null Filter by code
phrase null Filter by wildcard search of name, code and description
provisionType null Filter by Provision Type code
zoneType null Filter by Zone Type code
creatable null Filter by creatable flag. This is whether or not it can be provisioned.

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": "testimage.vmdk",
      "size": 1034592
    },
    {
      "name": "testimage.ovf",
      "size": 28038768
    }
  ]
}

This endpoint retrieves a specific virtual image and its files.

HTTP Request

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

URL Parameters

Parameter Description
id The ID of the virtual image

Create a Virtual Image

curl -XPOST "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?filename=disk-0.vmdk" \
  -H "Authorization: BEARER access_token" \
  --data-binary '@/path/to/file'

The above command returns JSON structure like this:

{
  "success": true
}

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

HTTP Request

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

URL Parameters

Parameter Description
id The ID of the virtual image

Query Parameters

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

Remove Virtual Image File

curl -XDELETE "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

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

HTTP Request

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

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.

HTTP Request

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

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.

HTTP Request

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

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
active null Set to false to deactvate the account

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.

HTTP Request

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

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

HTTP Request

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

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.

HTTP Request

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

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"
    },
  ],
  "globalAppTemplateAccess": "full",
  "appTemplatePermissions": []
}

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": 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"
  }'

HTTP Request

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

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"
  }'

HTTP Request

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

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

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"
  }'

HTTP Request

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

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

Global Blueprint Access

Global Blueprint 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": "AppTemplate",
    "access": "custom"
  }'

HTTP Request

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

JSON Parameters

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

Customizing Blueprint Access

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

curl -XPUT "https://api.gomorpheus.com/api/roles/4/update-blueprint" \
  -H "Authorization: BEARER access_token" \
  -H "Content-Type: application/json" \
  -d '{
    "appTemplateId": 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-blueprint

JSON Parameters

Parameter Default Description
appTemplateId id of the blueprint (appTemplate)
access full, read, 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
}

HTTP Request

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

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, Role]
refId Scope object ID, of group, cloud, user, etc.
accounts Array of tenants to scope the policy to.
eachUser false Apply individually to each user in role, Only for policies scoped to a Role

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/zones/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/zones/: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:

{
  "securityGroups": [
    {
      "id": 18,
      "name": "Colorado office",
      "description": "All the Colorado office to access anywhere",
      "accountId": 1,
      "groupSource": null,
      "externalId": null,
      "enabled": null,
      "syncSource": "internal",
      "zone": null,
      "locations": [
        {
          "id": 429,
          "name": "Colorado office",
          "externalId": "sg-01c120cf02de97410",
          "iacId": null,
          "zone": {
            "id": 8,
            "name": "test-aws"
          },
          "zonePool": null,
          "status": "available"
        }
      ],
      "rules": [
        {
          "id": 30,
          "name": "my app ports",
          "ruleType": "customRule",
          "customRule": true,
          "instanceTypeId": null
          "direction": "ingress",
          "policy": "accept",
          "sourceType": "cidr",
          "source": "0.0.0.0/0",
          "sourceGroup": null,
          "sourceTier": null,
          "portRange": "5565-5570",
          "protocol": "tcp",
          "destinationType": "instance",
          "destination": null,
          "destinationGroup": null,
          "destinationTier": null,
          "externalId": null,
          "enabled": null,
        }
      ]
    }
  ],
  "meta": {
    "size": 1,
    "total": 1,
    "offset": 0,
    "max": 25
  }
}

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-groups/18" \
  -H "Authorization: BEARER access_token"

The above command returns JSON structured like this:

{
  "securityGroup": {
    "id": 18,
    "name": "Colorado office",
    "description": "All the Colorado office to access anywhere",
    "accountId": 1,
    "groupSource": null,
    "externalId": null,
    "enabled": null,
    "syncSource": "internal",
    "zone": null,
    "locations": [
      {
        "id": 429,
        "name": "Colorado office",
        "externalId": "sg-01c120cf02de97410",
        "iacId": null,
        "zone": {
          "id": 8,
          "name": "bertramlabs-aws"
        },
        "zonePool": null,
        "status": "available"
      }
    ],
    "rules": []
  }
}

This endpoint retrieves a specific security group.

HTTP Request

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

URL Parameters

Parameter Description
id The ID of the security group

Create a Security Group

curl -XPOST "https://api.gomorpheus.com/api/security-groups" \
  -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-groups

JSON Security Group Parameters

Parameter Default Description
name null Name for your security group
description null Optional description field
zoneId null Scoped Cloud ID.
customOptions.vpc null External ID of Amazon VPC.
customOptions.resourceGroup null External ID of the Azure Resource Group to scope to.

Updating a Security Group

curl -XPUT "https://api.gomorpheus.com/api/security-groups/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-groups/:id

URL Parameters

Parameter Description
id The ID of the security group

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

URL Parameters

Parameter Description
id The ID of the security group

Create a Security Group Location

curl -XPOST "https://api.gomorpheus.com/api/security-groups/18/locations" \
  -H "Authorization: BEARER access_token" \
  -H "Content-Type: application/json" \
  -d '{ "securityGroupLocation": {
    "zoneId": 5,
    "customOptions": {
      "resourceGroup": 1
    },
    }}'

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

Will add a security group to the specified cloud.

HTTP Request

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

JSON Security Group Location Parameters

Parameter Default Description
zoneId null The ID of the Zone (Cloud)
customOptions.vpc null External ID of Amazon VPC.
customOptions.resourceGroup null External ID of the Azure Resource Group to scope to.

Delete a Security Group Location

curl -XDELETE "https://api.gomorpheus.com/api/security-groups/18/locations/29" \
  -H "Authorization: BEARER access_token"

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

Will remove a security group from a cloud.

HTTP Request

DELETE https://api.gomorpheus.com/api/security-groups/:id/locations/:locationId

URL Parameters

Parameter Description
id The ID of the security group
locationId The ID of the security group location

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:

{
  "rules": [
    {
      "id": 29,
      "name": "my-sg port 5555",
      "ruleType": "customRule",
      "customRule": true,
      "instanceTypeId": null
      "direction": "ingress",
      "policy": "accept",
      "sourceType": "group",
      "source": null,
      "sourceGroup": {
        "id": 2239,
        "name": "my-sg"
      },
      "sourceTier": null,
      "portRange": "5555",
      "protocol": "tcp",
      "destinationType": "instance",
      "destination": null,
      "destinationGroup": null,
      "destinationTier": null,
      "externalId": null,
      "enabled": null,
      "syncSource": "external"
    },
    {
      "id": 30,
      "name": "my app ports",
      "ruleType": "customRule",
      "customRule": true,
      "instanceTypeId": null
      "direction": "ingress",
      "policy": "accept",
      "sourceType": "cidr",
      "source": "0.0.0.0/0",
      "sourceGroup": null,
      "sourceTier": null,
      "portRange": "5565-5570",
      "protocol": "tcp",
      "destinationType": "instance",
      "destination": null,
      "destinationGroup": null,
      "destinationTier": null,
      "externalId": null,
      "enabled": 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-groups/19/rules/30" \
  -H "Authorization: BEARER access_token"

The above command returns JSON structured like this:

{
  "success": true,
  "rule": {
      "id": 30,
      "name": "my app ports",
      "ruleType": "customRule",
      "customRule": true,
      "instanceTypeId": null
      "direction": "ingress",
      "policy": "accept",
      "sourceType": "cidr",
      "source": "0.0.0.0/0",
      "sourceGroup": null,
      "sourceTier": null,
      "portRange": "5565-5570",
      "protocol": "tcp",
      "destinationType": "instance",
      "destination": null,
      "destinationGroup": null,
      "destinationTier": null,
      "externalId": null,
      "enabled": 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-groups/19/rules" \
  -H "Authorization: BEARER access_token" \
  -H "Content-Type: application/json" \
  -d '{ "rule": {
    "name": "port 55",
    "sourceType": "cidr",
    "source": "50.22.10.10/32",
    "portRange": "55",
    "protocol": "tcp",
    "destinationType": "instance",
    "customRule": true,
    "instanceTypeId": null
    }}'

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-groups/:id/rules

JSON Security Group Rule Parameters

Parameter Default Description
name null A name for the rule
direction ingress Either ingress or egress.
source null CIDR representing the source IP(s) which should receive
sourceType cidr Either cidr, group, tier, all.
source null CIDR representing the source IP(s) which should receive access. Required for sourceType=cidr.
sourceGroup.id null The source Security Group ID. Required for sourceType=group.
sourceTier.id null The source Tier ID. Required for soureType=tier.
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.
destinationType cidr Either cidr, group, tier, instance.
destination null CIDR representing the destination IP(s) which should receive access. Required for destinationType=cidr.
destinationGroup.id null The destination Security Group ID. Required for destinationType=group.
destinationTier.id null The destination Tier ID. Required for destinationType=tier.
ruleType customRule Either customRule or an instance type code.
policy accept Either accept or deny.
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-groups/19/rules/30" \
  -H "Authorization: BEARER access_token" \
  -H "Content-Type: application/json" \
  -d '{ "rule": {
    "portRange": "55-56"
    }}'

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-groups/: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-groups/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-groups/: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 Filter by matching name
name Filter by name
taskTypeCodes Filter by task type code(s).

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
code null A unique code for the task
taskType.code null The type of task
taskOptions {} Map of options specific to each type. eg. script
resultType null The result type eg. value, exitCode, keyValue, json
retryable false If the task should be retried or not.
retryCount null The number of times to retry.
retryDelaySeconds null The delay, between retries.

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
name If specified will return an exact match on name or code
code If specified will return an exact match on code

Get a Specific Task Type

curl "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 servers (container hosts) on the requestor’s account.

HTTP Request

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

Query Parameters

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

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 (container host) in the requestor’s account.

HTTP Request

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

Query Parameters

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

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 instances on the requestor’s account.

HTTP Request

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

Query Parameters

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

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.

Cypher Authentication

The cypher api endpoints allow for authentication via an special headers or the standard Authentication: bear access_token. Instead of an access token, an execution lease token can be used to authenticate. An execution lease will be issued by Morpheus for certain tasks, such as Ansible, which can then use the token to read cypher keys.

Cypher has the following headers and url parameters available for authentication:

Name Type Description
X-Cypher-Token HTTP Header An access token or an execution lease token.
X-Vault-Token HTTP Header An access token or an execution lease token.
X-Morpheus-Lease HTTP Header An execution lease token.
leaseToken URL Parameter An execution lease token.

List Cypher Keys

curl "https://api.gomorpheus.com/api/cypher/v1?list=true"
  -H "Authorization: BEARER access_token"

The above command returns JSON structured like this:

{
  "auth": null,
  "data": {
    "keys": [
      "password/15/mypassword",
      "secret/foo"
    ]
  },
  "lease_duration": null,
  "lease_id": "",
  "renewable": false,
  "cypherItems": [
    {
      "itemKey": "password/15/mypassword",
      "leaseTimeout": 2764800000,
      "expireDate": "2019-03-23T10:17:52Z",
      "dateCreated": "2019-02-19T10:17:52Z",
      "lastUpdated": "2019-02-19T10:17:52Z",
      "lastAccessed": "2019-02-19T10:17:52Z"
    },
    {
      "itemKey": "secret/foo",
      "leaseTimeout": 2764800000,
      "expireDate": "2019-03-25T17:14:33Z",
      "dateCreated": "2019-02-21T17:14:33Z",
      "lastUpdated": "2019-02-21T17:14:33Z",
      "lastAccessed": "2019-02-21T17:14:33Z"
    }
  ],
  "meta": {
    "size": 2,
    "total": 2,
    "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/v1/:key?list=true

URL Parameters

Parameter Description
key If specified will match the start of the key.

Query Parameters

Parameter Default Description
list Set to true for list behavior with HTTP GET.
phrase If specified will match any part of key
key If specified will return an exact match of key
max 25 Max number of results to return
offset 0 Offset of records you want to load
sort key Sort order
direction asc Sort direction, use ‘desc’ to reverse sort

Read a Cypher Key

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

The above command returns JSON structured like this:

{
  "success": true,
  "auth": null,
  "data": {
    "foo":"bar",
    "briefing":"top secret info"
  },
  "lease_duration": 2764800000,
  "lease_id": "",
  "renewable": false,
  "cypher": {
    "itemKey": "secret/foo",
    "leaseTimeout": 2764800000,
    "expireDate": "2019-03-18T20:15:51Z",
    "dateCreated": "2019-02-14T20:15:51Z",
    "lastUpdated": "2019-02-14T20:15:51Z",
    "lastAccessed": "2019-02-14T20:15:51Z"
  }
}

This endpoint retrieves a specific cypher key. The value of the key is decrypted and returned as data. It may be a String or an object with many {"key":"value"} pairs. The type depends on the cypher engine’s capabilities and what type of data was written to the key. For example the secret/ engine allows either a string or an object, while the password/ engine will always store and return a string.

The leaseTimeout and ttl parameters are only relevant if the cypher engine will be creating a key that does not exist. eg. password/

HTTP Request

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

URL Parameters

Parameter Description
key The full cypher key including the mount prefix.

Query Parameters

Parameter Default Description
leaseTimeout The lease duration in milliseconds.
ttl 32 days Time to Live. The lease duration in seconds, or a human readable format eg. '15m’, 8h, '7d’. This can be used instead of leaseTimeout.

Read a Cypher with Lease

curl "https://api.gomorpheus.com/api/cypher/v1/password/15/mypassword"
  -H "X-Lease-Token: 6f4d3563-22ef-404f-8b81-c13d093cd55a"

The above command returns JSON structured like reading a key with normal authentication:

{
  "auth": null,
  "data": "B[,t;ng[5[lg&th",
  "lease_duration": 432000000,
  "lease_id": "",
  "renewable": false,
  "cypher": {
    "itemKey": "password/15/mypassword",
    "leaseTimeout": 432000000,
    "expireDate": "2019-02-26T21:35:20Z",
    "dateCreated": "2019-02-21T21:35:20Z",
    "lastUpdated": "2019-02-21T21:35:20Z",
    "lastAccessed": "2019-02-21T21:35:20Z"
  }
}

HTTP Request

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

HTTP Headers

See Cypher Authentication for details on specifying a lease token.

URL Parameters

Parameter Default Description
key The cypher key including the mount prefix.

Query Parameters

Parameter Default Description
leaseTimeout The lease duration in milliseconds.
ttl 32 days Time to Live. The lease duration in seconds, or a human readable format eg. '15m’, 8h, '7d’. This can be used instead of leaseTimeout.

Write a Cypher

curl -XPOST "https://api.gomorpheus.com/api/cypher/v1/secret/mymsg" \
  -H "Authorization: BEARER access_token" \
  -H "Content-Type: application/json" \
  -d '{"msg":"hello world"}'

The above command returns JSON structured like readding a cypher key:.

HTTP Request

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

Query Parameters

Parameter Default Description
leaseTimeout The lease duration in milliseconds.
ttl 32 days Time to Live. The lease duration in seconds, or a human readable format eg. '15m’, 8h, '7d’. This can be used instead of leaseTimeout.
value The secret value to be stored. Only required for certain mountpoints.

JSON Parameters

The following parameters are available under the root context of the JSON body.

Parameter Default Description
ttl 32 days Time to Live in seconds, or a human readable format eg. '15m’, 8h, '7d’

The secret engine is capable of storing the entire JSON object as key=value pairs, or just a single string. To pass a string, use the value query parameter instead of JSON.

The ttl payload key is a special key that if present will be parsed and used as the ttl parameter (lease duration in seconds).

Key

The key includes a mount prefix separated by a /. For example, the key secret/foo uses the secret mount.

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. Capable of storing entire JSON object or a String. 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/v1/secret/foo" \
  -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/v1/:key

URL Parameters

Parameter Description
key The full cypher key including the mount prefix.

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",