Resource

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

Package : spaceone.api.statistics.v1

Resource

Resource Methods:

Method
Request
Response

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.

Type
Message

Request

Response

{
    "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

Field
Type
Required
Description

aggregate

page

domain_id

string

SortKey

Field
Type
Description

key

string

desc

bool

StatAggregate

Field
Type
Description

query

join

concat

sort

formula

fill_na

StatAggregateConcat

Field
Type
Required
Description

resource_type

string

query

extend_data

StatAggregateFillNA

Field
Type
Required
Description

data

StatAggregateFormula

Field
Type
Description

eval

string

query

string

StatAggregateJoin

Field
Type
Required
Description

resource_type

string

query

extend_data

type

  • LEFT

  • RIGHT

  • OUTER

  • INNER

keys

list of string

StatAggregateQuery

Field
Type
Required
Description

resource_type

string

query

extend_data

StatAggregateSort

Field
Type
Required
Description

key

string

desc

bool

keys

StatPage

Field
Type
Required
Description

start

limit

Last updated