Skip to main content

Set Up Your First Service

This guide walks you through creating a product in the catalog, configuring pricing, and deploying it as a customer-facing cloud service.

Before starting, make sure you have admin access to PLATFORMA and have completed the Quickstart guide.

1

Define a product in the catalog

Create a new product that defines the cloud service you want to offer:

const product = await client.products.create({
  name: "Web Hosting — Standard",
  sku: "web-hosting-std",
  description: "Standard web hosting with 4 vCPU, 16GB RAM, 100GB SSD",
  category: "compute",
  specs: {
    cpu_cores: 4,
    memory_gb: 16,
    disk_gb: 100,
    disk_type: "ssd",
  },
  regions: ["eu-west-1", "us-east-1"],
  status: "active",
});
2

Configure pricing

Set up pricing rules for the product:

await client.pricing.create({
  product_id: product.id,
  model: "recurring",
  billing_cycle: "monthly",
  tiers: [
    { up_to: 1, unit_price: 79.99 },
    { up_to: 10, unit_price: 69.99 },
    { up_to: null, unit_price: 59.99 }, // 10+ units
  ],
  currency: "EUR",
});
3

Create a provisioning template

Define the infrastructure template that will be applied when customers order this product:

await client.templates.create({
  product_id: product.id,
  provider: "openstack",
  steps: [
    { action: "create_instance", params: { flavor: "m1.medium", image: "ubuntu-22.04" } },
    { action: "attach_volume", params: { size_gb: 100, type: "ssd" } },
    { action: "assign_floating_ip" },
    { action: "configure_monitoring", params: { alerts: ["cpu", "memory", "disk"] } },
  ],
});
4

Test with a trial order

Place a test order to verify the end-to-end flow:

const order = await client.orders.create({
  customer_id: "cust_internal_test",
  items: [{ product_id: product.id, quantity: 1 }],
  metadata: { environment: "test" },
});
 
// Wait for provisioning
const result = await client.orders.waitForCompletion(order.id, {
  timeout: 300_000, // 5 minutes
});
 
console.log(result.status); // "provisioned"
5

Publish to the portal

Make the service available to customers through the self-service portal:

await client.portal.catalog.publish({
  product_id: product.id,
  featured: true,
  description_html: "<p>High-performance web hosting...</p>",
});

Next Steps