API · v1 · stable
CODEMETA OSDeveloper Center
FR
Ouvrir la console

POST /v1/hosting-plans

POST/v1/hosting-plans

Create a hosting plan

Modèle de données

Cette opération porte sur l'entité hosting_plan (hosting_plan). Les 16 champs (type, validation, caractère obligatoire, relations) figurent dans la référence du schéma.

  • Champs obligatoires : name, diskQuotaGb, bandwidthQuotaGbMonth, maxEmailAccounts, maxDatabases, maxFtpUsers, maxSubdomains, phpVersions, defaultPhpVersion, phpMode, features, monthlyPriceCents
  • Gérés par le serveur : _id, schema, schemaVersion, tenantId, version, createdAt, updatedAt, createdBy, updatedBy, deletedAt, deletedBy. La plateforme attribue ces champs ; ils sont ignorés dans la requête.

Corps de la requête

NomTypeDescription
nameobligatoirestring
descriptionstring
diskQuotaGbobligatoireinteger
bandwidthQuotaGbMonthobligatoireinteger
maxEmailAccountsobligatoireinteger
maxDatabasesobligatoireinteger
maxFtpUsersobligatoireinteger
maxSubdomainsobligatoireinteger
phpVersionsstring[]
defaultPhpVersionstring
phpModestring
priceCentsinteger
diskOveragePerGbCentsinteger
preferredServerTypestring
isActiveboolean

Exemple

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
});

Codes de réponse

HTTP Signification
201 Default Response

Recherche