Configuring Swift Usage Billing Estimated Reading Time: 3 Minutes The Swift Usage Billing service module bills clients for their use of OpenStack Swift object storage. When a service renews, Ubersmith gets the usage of the client for the period from the Swift usage API. Ubersmith then calculates the amount due and bills it. Ubersmith bills these four types of usage: Usage Unit Storage GB stored Transfer Out GB of public outbound transfer Accesses 1,000 public requests Updates 1,000 updates Each type of usage can have two tiers with different rates. Do these tasks in this order: Prepare the service plan. Add the service module to the service plan. Set the tenant ID. Set the usage rates of the service. Prepare the service plan Use a service plan for the Swift usage services. For more information, refer to the article "Adding Service Plans". The services of the plan must bill in arrears, because Ubersmith bills the usage at the end of each period. In the service plan: Select a billing period, for example Monthly. Do not use One Time Fee. Set Post Renew to YES. If a service is not set to Post Renew, Ubersmith does not renew it and shows the message "Swift Usage Billing services must be set to post renew." Add the service module to the service plan Click Settings. In the Services section, click Service Plans. Click details in the row of the service plan. In the Service Modules section, click add module. The Add Service Module window opens. In the Module field, select Swift Usage Billing. Make sure that Enabled is set to YES. In the Client Access field, select whether clients can see the module in the Client Portal: No Access, View, or Edit. Click the Config tab. In the Swift API Type field, select the type of your Swift usage API: swift_usage API or SwiftStats API. In the Swift Usage API URL field, type the URL of your Swift usage API. If you selected swift_usage API, type the API Key and the Secret Key of the API. The SwiftStats API does not use these fields. In the Block renewal when Tenant ID is not specified field, select one of these options: Yes: if a service has no tenant ID, Ubersmith does not renew it. This is the default. No: if a service has no tenant ID, Ubersmith renews it with no usage. Click Save. When you save the module, Ubersmith adds the Swift Usage Billing group of service custom fields. These fields contain the tenant ID and the usage rates of each service. Set the tenant ID The tenant ID identifies the Swift account of the client. Ubersmith uses the first tenant ID that it finds, in this order: The Tenant ID custom field of the service. A client custom field with the variable name swift_tenant_id. A client custom field with the variable name keystone_tenant_id. Use the client custom field if all Swift services of a client use the same tenant ID. Set the usage rates of the service Set the rates on each service of the plan, in the Swift Usage Billing section of the service. For each type of usage, set these fields: Tier 1 Rate: the price for each unit from zero. Tier 2 Minimum: the quantity where tier 2 starts. Leave it empty to use one tier. Tier 2 Rate: the price for each unit above the tier 2 minimum. For example, set the Storage Tier 1 Rate to 0.10, the Storage Tier 2 Minimum to 1000, and the Storage Tier 2 Rate to 0.08. Ubersmith bills $0.10 for each GB up to 1,000 GB, and $0.08 for each GB above 1,000 GB. For more information about services, refer to the article "Adding Services". How Ubersmith bills the usage At each renewal, Ubersmith: Gets the usage of the tenant for the period from the Swift usage API. Calculates the amount of each tier. Ubersmith rounds the total up to the nearest cent. Sets the price of the service to the total amount due for the period. Adds a note to the service with the usage and the rate of each tier. When you cancel a service, Ubersmith bills the usage up to the end date of the service.