From f32465aeafe1b70f5754cc730eaa502f145559c8 Mon Sep 17 00:00:00 2001 From: Marsell Kukuljevic Date: Tue, 27 Apr 2021 22:19:08 +0200 Subject: [PATCH] Add details to README.md about SmartOS metadata used for setting package and image rates, and fix an error regarding the HTTP paths to /images.json and /package.json --- README.md | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 732795e..0d5d3dd 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,21 @@ connected solely to the external network (aka public Internet). It should (although does not require) two JSON hash tables in the VM's internal\_metadata: sc:image\_subscription\_rates and sc:package\_rates; both map UUID strings to floats, with the image float representing a monthly subscription rate, and the -package float representing the rate per hour. +package float representing the rate per hour. A simplified example of a VM's +metadata: + + "internal_metadata_namespaces": ["sc"], + "internal_metadata": { + "sc:image_subscription_rates": + "{\"ca872441-09a3-4ceb-a843-6fa83ac6795d\": 70}", + "sc:package_rates": + "{\"64e9bcdd-1ba7-429f-9243-642891b81028\": 0.45}" + } + +Be aware that if the image and package JSON strings are malformed (not +serialized correctly), this will not affect the server startup; errors will +only show up in the client-side app when logged in, so make sure the JSON is +serialized correctly. Once the VM is running, the following steps are needed from within the VM: @@ -102,13 +116,13 @@ All calls will be passed through to cloudapi. For these calls to succeed, they MUST provide an X-Auth-Token header, containing the token returned from SSO. -## GET /rates/packages.json +## GET /packages.json Returns a JSON file mapping package UUIDs (a string) to the hourly rate (a float) that a customer will be charged for running a VM using that package. This is charged fractionally down to a minute granularity. -## GET /rates/images.json +## GET /images.json Returns a JSON file mapping image UUIDs (a string) to the monthly rate (a float) that a customer will be charged for running a VM using that image.