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
| Nom | Type | Description |
|---|---|---|
nameobligatoire | string | |
description | string | |
diskQuotaGbobligatoire | integer | |
bandwidthQuotaGbMonthobligatoire | integer | |
maxEmailAccountsobligatoire | integer | |
maxDatabasesobligatoire | integer | |
maxFtpUsersobligatoire | integer | |
maxSubdomainsobligatoire | integer | |
phpVersions | string[] | |
defaultPhpVersion | string | |
phpMode | string | |
priceCents | integer | |
diskOveragePerGbCents | integer | |
preferredServerType | string | |
isActive | boolean |
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 |