Skip to main content

Creating a project using the API

On project placements

There are different ways to deploy a new project:

  1. When you have access to a server (which you will get for example when using the "Space Server" plan1), you can create a new project on that server. Any projects deployed on a server will utilize the same shared resource pool. Since you pay for the server, you can deploy as many projects as resource utilization allows, without additional costs.
  2. You can use the proSpace2 plan. The project is then allocated its own resources. Each project is billed individually.

Creating a project…

…on a server

To create a project on an existing server, you will require that server’s ID. You can find all servers you have access to using the GET/v2/servers/ endpoint.

To create a new project, send a request to the POST/v2/servers/{serverId}/projects/ endpoint. The request body must contain a JSON object with the following properties:

  • description (String, mandatory field) should contain a human-readable description of the project. This is a required value.

The response, when successful, will contain a JSON object with the following properties:

  • id is the ID of the newly created project.

...as a stand alone project

To be able to create a stand alone project, you must be authorised to carry out chargeable actions in an organisation. Then use the endpoint POST/v2/orders/ to order a new project for a fee.

The request body must contain a JSON object with the following properties:

  • orderType: "projectHosting" indicates that we want to create a new project
  • orderData: Object describing the order. Should contain at least the following properties:
    • customerId: (String, mandatory field) ID of the organisation that will pay for the project
    • description: (String, mandatory field) human-readable description of the project
    • diskspaceInGiB: (Number, mandatory field) storage space to be booked for the project. At least 20 GiB, the value must be a multiple of 20
    • spec:
      • machineType: (String, mandatory field) defines which resources (CPU, RAM) are to be made available to the project. You can obtain possible values via the endpoint GET/v2/articles/.

The response, when successful, will contain a JSON object with the following properties:

  • id is the ID of the newly created order.

Observing project readiness

A newly created project will not be available immediately (however, it should be available within a few seconds). To check whether a project is ready, send a request to the GET/v2/projects/{projectId}/ endpoint. Among other properties, the response will contain an isReady property. This property will be true when the project is ready, and false otherwise.

Footnotes

  1. https://www.mittwald.de/space-server

  2. https://www.mittwald.de/prospace