Schedule

A Schedule is a time schedule of when a User will use a query.

Package : spaceone.api.statistics.v1

Schedule

Schedule Methods:

Method
Request
Response

add

POST /statistics/v1/schedules

Adds a new Schedule. When creating, topic and queries to be used should be specified. The time interval of the Schedule should be also specified to run queries repeatedly. The run set by Schedule starts every hour on the hour.

Type
Message

Request

Response

{
    "topic": "daily_cloud_service_summary_test",
    "options": {
        "aggregate": [
            {
                "query": {
                    "extend_data": {
                        "label": "Server"
                    },
                    "query": {
                        "filter": [
                            {
                                "key": "ref_cloud_service_type.is_primary",
                                "value": true,
                                "operator": "eq"
                            },
                            {
                                "value": "Server",
                                "operator": "eq",
                                "key": "ref_cloud_service_type.labels"
                            }
                        ],
                        "aggregate": [
                            {
                                "group": {
                                    "fields": [
                                        {
                                            "name": "value",
                                            "operator": "count"
                                        }
                                    ],
                                    "keys": [
                                        {
                                            "name": "project_id",
                                            "key": "project_id"
                                        },
                                        {
                                            "key": "cloud_service_type",
                                            "name": "cloud_service_type"
                                        },
                                        {
                                            "key": "cloud_service_group",
                                            "name": "cloud_service_group"
                                        },
                                        {
                                            "key": "provider",
                                            "name": "provider"
                                        }
                                    ]
                                }
                            }
                        ]
                    },
                    "resource_type": "inventory.CloudService"
                }
            },
            {
                "concat": {
                    "resource_type": "inventory.CloudService",
                    "query": {
                        "aggregate": [
                            {
                                "group": {
                                    "keys": [
                                        {
                                            "key": "project_id",
                                            "name": "project_id"
                                        },
                                        {
                                            "name": "cloud_service_type",
                                            "key": "cloud_service_type"
                                        },
                                        {
                                            "key": "cloud_service_group",
                                            "name": "cloud_service_group"
                                        },
                                        {
                                            "key": "provider",
                                            "name": "provider"
                                        }
                                    ],
                                    "fields": [
                                        {
                                            "name": "value",
                                            "operator": "count"
                                        }
                                    ]
                                }
                            }
                        ],
                        "filter": [
                            {
                                "value": true,
                                "operator": "eq",
                                "key": "ref_cloud_service_type.is_primary"
                            },
                            {
                                "value": "Database",
                                "operator": "eq",
                                "key": "ref_cloud_service_type.labels"
                            }
                        ]
                    },
                    "extend_data": {
                        "label": "Database"
                    }
                }
            },
            {
                "concat": {
                    "resource_type": "inventory.CloudService",
                    "extend_data": {
                        "label": "Container"
                    },
                    "query": {
                        "filter": [
                            {
                                "value": true,
                                "key": "ref_cloud_service_type.is_primary",
                                "operator": "eq"
                            },
                            {
                                "key": "ref_cloud_service_type.labels",
                                "value": "Container",
                                "operator": "eq"
                            }
                        ],
                        "aggregate": [
                            {
                                "group": {
                                    "fields": [
                                        {
                                            "name": "value",
                                            "operator": "count"
                                        }
                                    ],
                                    "keys": [
                                        {
                                            "key": "project_id",
                                            "name": "project_id"
                                        },
                                        {
                                            "name": "cloud_service_type",
                                            "key": "cloud_service_type"
                                        },
                                        {
                                            "name": "cloud_service_group",
                                            "key": "cloud_service_group"
                                        },
                                        {
                                            "key": "provider",
                                            "name": "provider"
                                        }
                                    ]
                                }
                            }
                        ]
                    }
                }
            },
            {
                "concat": {
                    "extend_data": {
                        "label": "Networking"
                    },
                    "query": {
                        "aggregate": [
                            {
                                "group": {
                                    "keys": [
                                        {
                                            "name": "project_id",
                                            "key": "project_id"
                                        },
                                        {
                                            "key": "cloud_service_type",
                                            "name": "cloud_service_type"
                                        },
                                        {
                                            "key": "cloud_service_group",
                                            "name": "cloud_service_group"
                                        },
                                        {
                                            "key": "provider",
                                            "name": "provider"
                                        }
                                    ],
                                    "fields": [
                                        {
                                            "name": "value",
                                            "operator": "count"
                                        }
                                    ]
                                }
                            }
                        ],
                        "filter": [
                            {
                                "key": "ref_cloud_service_type.is_primary",
                                "operator": "eq",
                                "value": true
                            },
                            {
                                "key": "ref_cloud_service_type.labels",
                                "value": "Networking",
                                "operator": "eq"
                            }
                        ]
                    },
                    "resource_type": "inventory.CloudService"
                }
            },
            {
                "concat": {
                    "resource_type": "inventory.CloudService",
                    "query": {
                        "filter": [
                            {
                                "key": "ref_cloud_service_type.is_primary",
                                "value": true,
                                "operator": "eq"
                            },
                            {
                                "operator": "eq",
                                "value": "Security",
                                "key": "ref_cloud_service_type.labels"
                            }
                        ],
                        "aggregate": [
                            {
                                "group": {
                                    "keys": [
                                        {
                                            "key": "project_id",
                                            "name": "project_id"
                                        },
                                        {
                                            "key": "cloud_service_type",
                                            "name": "cloud_service_type"
                                        },
                                        {
                                            "name": "cloud_service_group",
                                            "key": "cloud_service_group"
                                        },
                                        {
                                            "key": "provider",
                                            "name": "provider"
                                        }
                                    ],
                                    "fields": [
                                        {
                                            "name": "value",
                                            "operator": "count"
                                        }
                                    ]
                                }
                            }
                        ]
                    },
                    "extend_data": {
                        "label": "Security"
                    }
                }
            },
            {
                "concat": {
                    "resource_type": "inventory.CloudService",
                    "extend_data": {
                        "label": "Analytics"
                    },
                    "query": {
                        "filter": [
                            {
                                "value": true,
                                "key": "ref_cloud_service_type.is_primary",
                                "operator": "eq"
                            },
                            {
                                "operator": "eq",
                                "value": "Analytics",
                                "key": "ref_cloud_service_type.labels"
                            }
                        ],
                        "aggregate": [
                            {
                                "group": {
                                    "fields": [
                                        {
                                            "operator": "count",
                                            "name": "value"
                                        }
                                    ],
                                    "keys": [
                                        {
                                            "name": "project_id",
                                            "key": "project_id"
                                        },
                                        {
                                            "key": "cloud_service_type",
                                            "name": "cloud_service_type"
                                        },
                                        {
                                            "key": "cloud_service_group",
                                            "name": "cloud_service_group"
                                        },
                                        {
                                            "key": "provider",
                                            "name": "provider"
                                        }
                                    ]
                                }
                            }
                        ]
                    }
                }
            },
            {
                "concat": {
                    "resource_type": "inventory.CloudService",
                    "extend_data": {
                        "label": "All"
                    },
                    "query": {
                        "aggregate": [
                            {
                                "group": {
                                    "keys": [
                                        {
                                            "name": "project_id",
                                            "key": "project_id"
                                        },
                                        {
                                            "name": "cloud_service_type",
                                            "key": "cloud_service_type"
                                        },
                                        {
                                            "name": "cloud_service_group",
                                            "key": "cloud_service_group"
                                        },
                                        {
                                            "key": "provider",
                                            "name": "provider"
                                        }
                                    ],
                                    "fields": [
                                        {
                                            "operator": "count",
                                            "name": "value"
                                        }
                                    ]
                                }
                            }
                        ],
                        "filter": [
                            {
                                "key": "ref_cloud_service_type.is_primary",
                                "operator": "eq",
                                "value": true
                            }
                        ]
                    }
                }
            },
            {
                "concat": {
                    "query": {
                        "filter": [
                            {
                                "value": true,
                                "operator": "eq",
                                "key": "ref_cloud_service_type.is_major"
                            },
                            {
                                "value": "Storage",
                                "operator": "eq",
                                "key": "ref_cloud_service_type.labels"
                            }
                        ],
                        "aggregate": [
                            {
                                "group": {
                                    "fields": [
                                        {
                                            "name": "value",
                                            "key": "data.size",
                                            "operator": "sum"
                                        }
                                    ],
                                    "keys": [
                                        {
                                            "name": "project_id",
                                            "key": "project_id"
                                        },
                                        {
                                            "name": "cloud_service_type",
                                            "key": "cloud_service_type"
                                        },
                                        {
                                            "key": "cloud_service_group",
                                            "name": "cloud_service_group"
                                        },
                                        {
                                            "key": "provider",
                                            "name": "provider"
                                        }
                                    ]
                                }
                            }
                        ]
                    },
                    "resource_type": "inventory.CloudService",
                    "extend_data": {
                        "label": "Storage"
                    }
                }
            }
        ]
    },
    "schedule": {
        "hours": [
            1
        ]
    },
    "tags": {},
    "domain_id": "domain-58010aa2e451"
}

update

PUT /statistics/v1/schedule/{schedule_id}

Updates a specific Schedule. You can make changes in Schedule settings, including time intervals.

Type
Message

Request

Response

{
    "schedule_id": "sch-65bb6b55d162",
    "schedule": {
        "hours": [
            2
        ]
    },
    "tags": {
        "a": "b"
    },
    "domain_id": "domain-58010aa2e451"
}

enable

PUT /statistics/v1/schedule/{schedule_id}/enable

Enables a specific Schedule. If a Schedule is enabled, the query usage will be scheduled by the time interval specified.

Type
Message

Request

Response

{
    "schedule_id": "sch-65bb6b55d162",
    "domain_id": "domain-58010aa2e451"
}

disable

PUT /statistics/v1/schedule/{schedule_id}/disable

Disables a specific Schedule. If a Schedule is disabled, the query usage will not be scheduled.

Type
Message

Request

Response

{
    "schedule_id": "sch-65bb6b55d162",
    "domain_id": "domain-58010aa2e451"
}

delete

DELETE /statistics/v1/schedule/{schedule_id}

Deletes a specific Schedule. You must specify the schedule_id of the Schedule to delete.

Type
Message

Request

Response

{
    "schedule_id": "sch-3da9c9ed2ee2",
    "domain_id": "domain-58010aa2e451"
}

get

GET /statistics/v1/schedule/{schedule_id}

Gets a specific Schedule. Prints detailed information about the Schedule, including the schedule interval and state.

Type
Message

Request

Response

{
    "schedule_id": "sch-3da9c9ed2ee2",
    "domain_id": "domain-58010aa2e451"
}

list

GET /statistics/v1/schedules

POST /statistics/v1/schedules/search

Gets a list of all Schedules. You can use a query to get a filtered list of Schedules.

Type
Message

Request

Response

{
    "query": {},
    "domain_id": "domain-58010aa2e451"
}

stat

POST /statistics/v1/schedules/stat

Type
Message

Request

Response

Message

AddScheduleRequest

Field
Type
Required
Description

topic

string

options

schedule

tags

user_id

string

domain_id

string

GetScheduleRequest

Field
Type
Required
Description

schedule_id

string

domain_id

string

only

list of string

QueryOption

Field
Type
Required
Description

aggregate

page

ScheduleInfo

Field
Type
Description

schedule_id

string

topic

string

state

  • NONE

  • ENABLED

  • DISABLED

options

schedule

tags

domain_id

string

created_at

string

last_scheduled_at

string

ScheduleQuery

Field
Type
Required
Description

query

schedule_id

string

topic

string

state

string

resource_type

string

domain_id

string

ScheduleRequest

Field
Type
Required
Description

schedule_id

string

domain_id

string

ScheduleStatQuery

Field
Type
Required
Description

query

domain_id

string

Scheduled

Field
Type
Description

cron

string

interval

minutes

hours

SchedulesInfo

Field
Type
Description

results

total_count

UpdateScheduleRequest

Field
Type
Required
Description

schedule_id

string

schedule

tags

storage_id

string

domain_id

string

Last updated