Documentation

Mistake on this page? Email us

Hierarchy

  • BillingApi

Index

Constructors

constructor

  • The API can be initalized with a .env file in the wroking directory with the following values

    MBED_CLOUD_SDK_API_KEY=

    and optionally

    MBED_CLOUD_SDK_HOST= (defaults to https://api.us-east-1.mbedcloud.com)

    OR This API is initialized with ConnectionOptions.

    To create an instance of this API in Node.js:

    var PelionDMSDK = require("mbed-cloud-sdk");
    
    var billing = new PelionDMSDK.BillingApi({
        apiKey: "<Pelion DM API Key>"
    });

    To create an instance of this API in the browser:

    <script src="<pelion-dm-sdk>/bundles/billing.min.js"></script>
    
    <script>
        var billing = new MbedCloudSDK.BillingApi({
            apiKey: "<Pelion DM API Key>"
        });
    </script>

    Parameters

    Returns BillingApi

Methods

getQuotaHistory

getQuotaRemaining

  • getQuotaRemaining(): Promise<number>
  • Get your remaining quota

    Returns Promise<number>

    Promise of number

  • getQuotaRemaining(callback: CallbackFn<number>): void
  • Get your remaining quota

    Parameters

    Returns void

getReportActiveDevices

  • getReportActiveDevices(month: Date, filepath?: string): Promise<string>
  • Get the active devices report.

    Parameters

    • month: Date

      Date object for the year and month you want a report from

    • Optional filepath: string

      Optional. If specified, the destination to write the billing report to.

    Returns Promise<string>

    Promise of string. The json string for the billing report.

  • getReportActiveDevices(month: Date, filepath?: string, callback?: CallbackFn<string>): void
  • Get the active devices report.

    Parameters

    • month: Date

      Date object for the year and month you want a report from

    • Optional filepath: string

      Optional. If specified, the destination to write the billing report to.

    • Optional callback: CallbackFn<string>

    Returns void

getReportFirmwareUpdates

  • getReportFirmwareUpdates(month: Date, filepath?: string): Promise<string>
  • Get the firmware update report.

    Parameters

    • month: Date

      Date object for the year and month you want a report from

    • Optional filepath: string

      Optional. If specified, the destination to write the billing report to.

    Returns Promise<string>

    Promise of string. The json string for the billing report.

  • getReportFirmwareUpdates(month: Date, filepath?: string, callback?: CallbackFn<string>): void
  • Get the firmware update report.

    Parameters

    • month: Date

      Date object for the year and month you want a report from

    • Optional filepath: string

      Optional. If specified, the destination to write the billing report to.

    • Optional callback: CallbackFn<string>

    Returns void

getReportOverview

  • getReportOverview(month: Date, filepath?: string): Promise<string>
  • Get the main billing report.

    Parameters

    • month: Date

      Date object for the year and month you want a report from

    • Optional filepath: string

      Optional. If specified, the destination to write the billing report to.

    Returns Promise<string>

    Promise of string. The json string for the billing report.

  • getReportOverview(month: Date, filepath?: string, callback?: CallbackFn<string>): void
  • Get the main billing report.

    Parameters

    • month: Date

      Date object for the year and month you want a report from

    • Optional filepath: string

      Optional. If specified, the destination to write the billing report to.

    • Optional callback: CallbackFn<string>

    Returns void

getServicePackages

  • Get the service packages in order: pending -> active -> all pending

    Returns Promise<Array<ServicePackage>>

    Promise with Array of ServicePackages

  • Get the service packages in order: pending -> active -> all pending

    Parameters

    Returns void