Skip to content

Billing Plans

Mik edited this page Sep 1, 2022 · 10 revisions

Billing Plan

is a per-resource Billing Model configuration. It defines instance billable resources, their prices, conditions and other things. Resources available to be billed are defined by drivers.

Template

You can use this to create your Billing Plan(s) from CLI. You'll find explanations per field below the template.

title: Sample
type: ione
public: true
resources:
  - key: cpu # Resource Conf
    kind: 1
    price: 0.1
    period: 3600
    except: false
    "on": # Note the quotes, many yaml parsers treat on as true
      - 3
      - 4
      - 7
  - key: ip # Resource Conf
    kind: 2
    price: 10
    period: 2592000
    except: true
    on: # Note the quotes, many yaml parsers treat on as true
      - 5
  - key: suspension_fee # Resource Conf
    kind: 1
    price: 0.01
    period: 3600
    except: false
    on: # Note the quotes, many yaml parsers treat on as true
     - 6

Template Description

To make it easier, let's describe this billing plan in words.

  1. NoCloud will postfactum hourly calculate and deduce 0.1 NCU if instance is in the state RUNNING, FAILURE or OPERATION
  2. NoCloud will deduce 10 NCU for IP address every 30 days unless state is DELETED
  3. NoCloud will postfactum hourly deduce 0.01NCU if instance is in the state SUSPENDED

Template Fields Descriptions

Title

Just a Billing Plan title, call it something understandable to customer

Type

Instance (drivers) type this Billing Plan is applicable to

Public

If set to true will be available to everyone in this NoCloud setup, if false will be available only to those, whose Namespace has a link to this Plan

Resources: ResourceConf

Key

Resource key, possible values are defined by drivers, e.g. for driver ione it is cpu, ram, ip, drive_x (may be updated)

Kind

Kind according to enum Kind.

  1. POST-PAID - use first, pay after
  2. PRE-PAID - pay first and use
Price

Resource Price per Period in NCU. Depending on a driver and on setting, maybe either always applied or be recalculated with usage history(e.g. if instance was RUNNING only 30 minutes of hour, only half-Price will be deduced)

Period

Billing Period in Seconds, driver supposed to generate Records every period seconds.

Except and On

On is a list of States. If instance is in the State listed in on, record is to be generated.

If Except is set to true, then logic would be inverted. Record is to be generated if State is NOT listed in on