Resource

A Resource is a resource used for analysis on all microservices used in Cloudforet.

Package : spaceone.api.statistics.v1

Resource

Resource Methods:

stat

POST /statistics/v1/resources/stat

Enables data preprocessing of different services. Although limited, it is possible to create not only basic queries but also data suitable for users' needs, such as joins between two tables created by the query, handling missing values, and sorting.

{
    "aggregate": [
        {
            "query": {
                "resource_type": "inventory.CloudServiceType",
                "query": {
                    "filter": [
                        {
                            "k": "labels",
                            "v": [
                                "Server"
                            ],
                            "o": "in"
                        },
                        {
                            "k": "is_primary",
                            "v": true,
                            "o": "eq"
                        }
                    ],
                    "aggregate": [
                        {
                            "group": {
                                "keys": [
                                    {
                                        "key": "cloud_service_type_id",
                                        "name": "cloud_service_type_id"
                                    },
                                    {
                                        "key": "name",
                                        "name": "cloud_service_type"
                                    },
                                    {
                                        "key": "group",
                                        "name": "cloud_service_group"
                                    },
                                    {
                                        "key": "provider",
                                        "name": "provider"
                                    },
                                    {
                                        "key": "cloud_service_type_id",
                                        "name": "cloud_service_type_id"
                                    }
                                ],
                                "fields": [
                                    {
                                        "key": "tags",
                                        "name": "tags",
                                        "operator": "first"
                                    },
                                    {
                                        "key": "labels",
                                        "name": "labels",
                                        "operator": "first"
                                    }
                                ]
                            }
                        }
                    ]
                }
            }
        },
        {
            "join": {
                "resource_type": "inventory.CloudService",
                "query": {
                    "filter": [
                        {
                            "k": "ref_cloud_service_type.cloud_service_type_id",
                            "v": [
                                "cloud-svc-type-58c926b19aca",
                                "cloud-svc-type-c7e5bc38d911",
                                "cloud-svc-type-8dd4d7a13b95",
                                "cloud-svc-type-719e705cb529",
                                "cloud-svc-type-50bd62cf6e0e"
                            ],
                            "o": "in"
                        }
                    ],
                    "aggregate": [
                        {
                            "group": {
                                "keys": [
                                    {
                                        "key": "cloud_service_type",
                                        "name": "cloud_service_type"
                                    },
                                    {
                                        "key": "cloud_service_group",
                                        "name": "cloud_service_group"
                                    },
                                    {
                                        "key": "provider",
                                        "name": "provider"
                                    }
                                ],
                                "fields": [
                                    {
                                        "name": "count",
                                        "operator": "count"
                                    }
                                ]
                            }
                        }
                    ]
                },
                "keys": [
                    "cloud_service_type",
                    "cloud_service_group",
                    "provider"
                ]
            }
        },
        {
            "fill_na": {
                "data": {
                    "count": 0.0
                }
            }
        },
        {
            "formula": {
                "query": "count > 0"
            }
        },
        {
            "sort": {
                "key": "count",
                "desc": true
            }
        }
    ],
    "domain_id": "domain-58010aa2e451"
}

Message

ResourceStatRequest

FieldTypeRequiredDescription

aggregate

page

domain_id

string

SortKey

FieldTypeDescription

key

string

desc

bool

StatAggregate

StatAggregateConcat

FieldTypeRequiredDescription

resource_type

string

query

extend_data

StatAggregateFillNA

FieldTypeRequiredDescription

data

StatAggregateFormula

FieldTypeDescription

eval

string

query

string

StatAggregateJoin

FieldTypeRequiredDescription

resource_type

string

query

extend_data

type

  • LEFT

  • RIGHT

  • OUTER

  • INNER

keys

list of string

StatAggregateQuery

FieldTypeRequiredDescription

resource_type

string

query

extend_data

StatAggregateSort

FieldTypeRequiredDescription

key

string

desc

bool

keys

StatPage

FieldTypeRequiredDescription

start

limit

Last updated