API · v1 · stabil
CODEMETA OSDeveloper Center
Konsole öffnen

POST /v1/hosting-plans

POST/v1/hosting-plans

Create a hosting plan

Datenmodell

Diese Operation arbeitet auf der Entität hosting_plan (hosting_plan). Alle 16 Felder — Typ, Validierung, Pflichtangabe, Beziehungen — stehen in der Schema-Referenz.

  • Pflichtfelder: name, diskQuotaGb, bandwidthQuotaGbMonth, maxEmailAccounts, maxDatabases, maxFtpUsers, maxSubdomains, phpVersions, defaultPhpVersion, phpMode, features, monthlyPriceCents
  • Server-verwaltet: _id, schema, schemaVersion, tenantId, version, createdAt, updatedAt, createdBy, updatedBy, deletedAt, deletedBy — diese Felder vergibt die Plattform; im Request werden sie verworfen.

Request Body

NameTypBeschreibung
nameerforderlichstring
descriptionstring
diskQuotaGberforderlichinteger
bandwidthQuotaGbMontherforderlichinteger
maxEmailAccountserforderlichinteger
maxDatabaseserforderlichinteger
maxFtpUserserforderlichinteger
maxSubdomainserforderlichinteger
phpVersionsstring[]
defaultPhpVersionstring
phpModestring
priceCentsinteger
diskOveragePerGbCentsinteger
preferredServerTypestring
isActiveboolean

Beispiel

curl -X POST https://api.codemeta-os.de/v1/hosting-plans \
  -H "X-Tenant-Id: $TENANT" \
  -H "Content-Type: application/json" \
  -b cookies.txt \
  -d '{
  "name": "string",
  "description": "string",
  "diskQuotaGb": 0,
  "bandwidthQuotaGbMonth": 0,
  "maxEmailAccounts": 0,
  "maxDatabases": 0,
  "maxFtpUsers": 0,
  "maxSubdomains": 0,
  "phpVersions": [],
  "defaultPhpVersion": "string",
  "phpMode": "string",
  "priceCents": 0,
  "diskOveragePerGbCents": 0,
  "preferredServerType": "any",
  "isActive": true
}'
const result = await cm.hosting-plans.post({
  "name": "string",
  "description": "string",
  "diskQuotaGb": 0,
  "bandwidthQuotaGbMonth": 0,
  "maxEmailAccounts": 0,
  "maxDatabases": 0,
  "maxFtpUsers": 0,
  "maxSubdomains": 0,
  "phpVersions": [],
  "defaultPhpVersion": "string",
  "phpMode": "string",
  "priceCents": 0,
  "diskOveragePerGbCents": 0,
  "preferredServerType": "any",
  "isActive": true
});

Antwortcodes

HTTP Bedeutung
201 Default Response

Suche