CloudKitty REST API (v1)

CloudKitty REST API (v1)

Collector

GET /v1/collector

Unused function, hack to let pecan route requests to subcontrollers.

GET /v1/collector/mappings

Return the list of every services mapped to a collector.

Parameters:
  • collector (unicode) – Filter on the collector name.
Return:

Service to collector mappings collection.

Return type:

ServiceToCollectorMappingCollection

GET /v1/collector/mappings/(service)

Return a service to collector mapping.

Parameters:
  • service (unicode) – Name of the service to filter on.
Return type:

ServiceToCollectorMapping

POST /v1/collector/mappings

Create a service to collector mapping.

Parameters:
  • collector (unicode) – Name of the collector to apply mapping on.
  • service (unicode) – Name of the service to apply mapping on.
Return type:

ServiceToCollectorMapping

DELETE /v1/collector/mappings

Delete a service to collector mapping.

Parameters:
  • service (unicode) – Name of the service to filter on.
GET /v1/collector/states

Query the enable state of a collector.

Parameters:
  • name (unicode) – Name of the collector.
Return:

State of the collector.

Return type:

CollectorInfos

PUT /v1/collector/states

Set the enable state of a collector.

Parameters:
  • name (unicode) – Name of the collector.
  • infos (CollectorInfos) – New state informations of the collector.
Return:

State of the collector.

Return type:

CollectorInfos

type CollectorInfos

Type describing a collector module.

Data samples:

Json
{
    "enabled": true,
    "name": "ceilometer"
}
XML
<value>
  <name>ceilometer</name>
  <enabled>true</enabled>
</value>
enabled
Type:bool

State of the collector.

name
Type:unicode

Name of the collector.

type ServiceToCollectorMapping

Type describing a service to collector mapping.

Data samples:

Json
{
    "collector": "ceilometer",
    "service": "compute"
}
XML
<value>
  <service>compute</service>
  <collector>ceilometer</collector>
</value>
collector
Type:unicode

Name of the collector.

service
Type:unicode

Name of the service.

type ServiceToCollectorMappingCollection

Type describing a service to collector mapping collection.

Data samples:

Json
{
    "mappings": [
        {
            "collector": "ceilometer",
            "service": "compute"
        }
    ]
}
XML
<value>
  <mappings>
    <item>
      <service>compute</service>
      <collector>ceilometer</collector>
    </item>
  </mappings>
</value>
mappings
Type:list(ServiceToCollectorMapping)

List of service to collector mappings.

Info

GET /v1/info/config

Return current configuration.

Return type:dict(str: None)
GET /v1/info/services

Get the service list.

Return:List of every services.
Return type:CloudkittyServiceInfoCollection
GET /v1/info/services/(service_name)

Return a service.

Parameters:
  • service_name (unicode) – name of the service.
Return type:

CloudkittyServiceInfo

type CloudkittyServiceInfo

Type describing a service info in CloudKitty.

Data samples:

Json
{
    "metadata": [
        "resource_id",
        "flavor",
        "availability_zone"
    ],
    "service_id": "compute",
    "unit": "instance"
}
XML
<value>
  <service_id>compute</service_id>
  <metadata>
    <item>resource_id</item>
    <item>flavor</item>
    <item>availability_zone</item>
  </metadata>
  <unit>instance</unit>
</value>
metadata
Type:list(unicode)

List of service metadata

service_id
Type:Enum(compute, volume, network.bw.in, network.bw.out, network.floating, image)

Name of the service.

unit
Type:unicode

service unit

type CloudkittyServiceInfoCollection

A list of CloudKittyServiceInfo.

Data samples:

Json
{
    "services": [
        {
            "metadata": [
                "resource_id",
                "flavor",
                "availability_zone"
            ],
            "service_id": "compute",
            "unit": "instance"
        }
    ]
}
XML
<value>
  <services>
    <item>
      <service_id>compute</service_id>
      <metadata>
        <item>resource_id</item>
        <item>flavor</item>
        <item>availability_zone</item>
      </metadata>
      <unit>instance</unit>
    </item>
  </services>
</value>

Rating

GET /v1/rating/modules

return the list of loaded modules.

Return:name of every loaded modules.
Return type:CloudkittyModuleCollection
GET /v1/rating/modules/(module_id)

return a module

Return:CloudKittyModule
Return type:CloudkittyModule
PUT /v1/rating/modules

Change the state and priority of a module.

Parameters:
  • module_id (unicode) – name of the module to modify
  • module (CloudkittyModule) – CloudKittyModule object describing the new desired state
Return type:

CloudkittyModule

POST /v1/rating/quote

Get an instant quote based on multiple resource descriptions.

Parameters:
Return:

Total price for these descriptions.

Return type:

float

GET /v1/rating/reload_modules

Trigger a rating module list reload.

type CloudkittyModule

A rating extension summary

Data samples:

Json
{
    "description": "Sample extension.",
    "enabled": true,
    "hot-config": false,
    "priority": 2
}
XML
<value>
  <description>Sample extension.</description>
  <enabled>true</enabled>
  <hot-config>false</hot-config>
  <priority>2</priority>
</value>
description
Type:unicode

Short description of the extension.

enabled
Type:bool

Extension status.

hot_config
Type:bool

On-the-fly configuration support.

module_id
Type:unicode

Name of the extension.

priority
Type:int

Priority of the extension.

type CloudkittyModuleCollection

A list of rating extensions.

Data samples:

Json
{}
XML
<value />
type CloudkittyResource

Type describing a resource in CloudKitty.

Data samples:

Json
{
    "desc": {
        "image_id": "a41fba37-2429-4f15-aa00-b5bc4bf557bf"
    },
    "service": "compute",
    "volume": "1"
}
XML
<value>
  <service>compute</service>
  <desc>
    <item>
      <key>image_id</key>
      <value>a41fba37-2429-4f15-aa00-b5bc4bf557bf</value>
    </item>
  </desc>
  <volume>1</volume>
</value>
desc
Type:dict(unicode: None)

Description of the resources parameters.

service
Type:Enum(compute, volume, network.bw.in, network.bw.out, network.floating, image)

Name of the service.

volume
Type:Decimal

Volume of resources.

type CloudkittyResourceCollection

A list of CloudKittyResources.

Data samples:

Json
{}
XML
<value />

Report

GET /v1/report/summary

Return the summary to pay for a given period.

Return type:SummaryCollectionModel
GET /v1/report/tenants

Return the list of rated tenants.

Return type:list(unicode)
GET /v1/report/total

Return the amount to pay for a given period.

Return type:Decimal

Storage

GET /v1/storage/dataframes

Return a list of rated resources for a time period and a tenant.

Parameters:
  • begin (datetime) – Start of the period
  • end (datetime) – End of the period
  • tenant_id (unicode) – UUID of the tenant to filter on.
  • resource_type (unicode) – Type of the resource to filter on.
Return:

Collection of DataFrame objects.

Return type:

DataFrameCollection

type RatedResource

Represents a rated CloudKitty resource.

Data samples:

Json
{
    "desc": {
        "flavor": "m1.tiny",
        "vcpus": "1"
    },
    "rating": "1.0",
    "service": "compute",
    "volume": "1.0"
}
XML
<value>
  <rating>1.0</rating>
  <service>compute</service>
  <desc>
    <item>
      <key>flavor</key>
      <value>m1.tiny</value>
    </item>
    <item>
      <key>vcpus</key>
      <value>1</value>
    </item>
  </desc>
  <volume>1.0</volume>
</value>
type DataFrame

Type describing a stored data frame.

Data samples:

Json
{
    "begin": "2015-04-22T07:00:00",
    "end": "2015-04-22T08:00:00",
    "resources": [
        {
            "desc": {
                "flavor": "m1.tiny",
                "vcpus": "1"
            },
            "rating": "1.0",
            "service": "compute",
            "volume": "1.0"
        }
    ],
    "tenant_id": "69d12143688f413cbf5c3cfe03ed0a12"
}
XML
<value>
  <begin>2015-04-22T07:00:00</begin>
  <end>2015-04-22T08:00:00</end>
  <tenant_id>69d12143688f413cbf5c3cfe03ed0a12</tenant_id>
  <resources>
    <item>
      <rating>1.0</rating>
      <service>compute</service>
      <desc>
        <item>
          <key>flavor</key>
          <value>m1.tiny</value>
        </item>
        <item>
          <key>vcpus</key>
          <value>1</value>
        </item>
      </desc>
      <volume>1.0</volume>
    </item>
  </resources>
</value>
begin
Type:datetime

Begin date for the sample.

end
Type:datetime

End date for the sample.

resources
Type:list(RatedResource)

A resource list.

tenant_id
Type:unicode

Tenant owner of the sample.

type DataFrameCollection

A list of stored data frames.

Data samples:

Json
{
    "dataframes": [
        {
            "begin": "2015-04-22T07:00:00",
            "end": "2015-04-22T08:00:00",
            "resources": [
                {
                    "desc": {
                        "flavor": "m1.tiny",
                        "vcpus": "1"
                    },
                    "rating": "1.0",
                    "service": "compute",
                    "volume": "1.0"
                }
            ],
            "tenant_id": "69d12143688f413cbf5c3cfe03ed0a12"
        }
    ]
}
XML
<value>
  <dataframes>
    <item>
      <begin>2015-04-22T07:00:00</begin>
      <end>2015-04-22T08:00:00</end>
      <tenant_id>69d12143688f413cbf5c3cfe03ed0a12</tenant_id>
      <resources>
        <item>
          <rating>1.0</rating>
          <service>compute</service>
          <desc>
            <item>
              <key>flavor</key>
              <value>m1.tiny</value>
            </item>
            <item>
              <key>vcpus</key>
              <value>1</value>
            </item>
          </desc>
          <volume>1.0</volume>
        </item>
      </resources>
    </item>
  </dataframes>
</value>
Creative Commons Attribution 3.0 License

Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.