POST /v1/hosting-plans
POST/v1/hosting-plans
Create a hosting plan
Modelo de datos
Esta operación trabaja sobre la entidad hosting_plan (hosting_plan). Los 16 campos (tipo, validación, obligatoriedad y relaciones) figuran en la referencia del esquema.
-
Campos obligatorios:
name,diskQuotaGb,bandwidthQuotaGbMonth,maxEmailAccounts,maxDatabases,maxFtpUsers,maxSubdomains,phpVersions,defaultPhpVersion,phpMode,features,monthlyPriceCents -
Gestionados por el servidor:
_id,schema,schemaVersion,tenantId,version,createdAt,updatedAt,createdBy,updatedBy,deletedAt,deletedBy. La plataforma asigna estos campos; si se envían en la solicitud, se descartan.
Cuerpo de la solicitud
| Nombre | Tipo | Descripción |
|---|---|---|
nameobligatorio | string | |
description | string | |
diskQuotaGbobligatorio | integer | |
bandwidthQuotaGbMonthobligatorio | integer | |
maxEmailAccountsobligatorio | integer | |
maxDatabasesobligatorio | integer | |
maxFtpUsersobligatorio | integer | |
maxSubdomainsobligatorio | integer | |
phpVersions | string[] | |
defaultPhpVersion | string | |
phpMode | string | |
priceCents | integer | |
diskOveragePerGbCents | integer | |
preferredServerType | string | |
isActive | boolean |
Ejemplo
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
});Códigos de respuesta
| HTTP | Significado |
|---|---|
201 |
Default Response |