
This patch adds active status fields in the storage state table (cloudkitty_storage_states). A boolean column called "active", which indicates if the CloudKitty scope is active for billing, and another one called "scope_activation_toggle_date" (timestamp field) to store the latest timestamp when the scope moved between the active/deactivated states. Then, during CloudKitty processing, we check the "active" column. If the resource is not active, we ignore it during the processing. Moreover, we introduce an API to allow operators to set the "active" field. The "scope_activation_toggle_date" will not be exposed for operators to change it. It is updated automatically according to the changes in the "active" field. This patch adds a new HTTP method to "/v2/scope" endpoint. We then use "patch" HTTP method to allow operators to patch a storage scope. The API will require the scope_id, and then, it takes into account some of the fields we allow operators to change, and "active" field is one of them. Change-Id: Ia02c2eeb98021c60549cb8deab6f2e964e573f1e Implements: https://review.opendev.org/c/openstack/cloudkitty-specs/+/770928/
120 lines
2.1 KiB
YAML
120 lines
2.1 KiB
YAML
collector: &collector
|
|
in: query
|
|
description: |
|
|
Filter on collector.
|
|
type: string
|
|
required: false
|
|
|
|
fetcher: &fetcher
|
|
in: query
|
|
description: |
|
|
Filter on fetcher.
|
|
type: string
|
|
required: false
|
|
|
|
limit:
|
|
in: query
|
|
description: |
|
|
For pagination. The maximum number of results to return.
|
|
type: int
|
|
required: false
|
|
|
|
offset: &offset
|
|
in: query
|
|
description: |
|
|
For pagination. The index of the first element that should be returned.
|
|
type: int
|
|
required: false
|
|
|
|
scope_id: &scope_id
|
|
in: query
|
|
description: |
|
|
Filter on scope.
|
|
type: string
|
|
required: false
|
|
|
|
scope_key: &scope_key
|
|
in: query
|
|
description: |
|
|
Filter on scope_key.
|
|
type: string
|
|
required: false
|
|
|
|
active_anchor_query: &active_query
|
|
in: body
|
|
description: |
|
|
Defines if a scope should be processed or not; `True` means that
|
|
CloudKitty must process the scope.
|
|
type: bool
|
|
required: true
|
|
|
|
active_body:
|
|
<<: *active_query
|
|
required: false
|
|
|
|
active_key_resp:
|
|
<<: *active_query
|
|
|
|
all_scopes: &all_scopes
|
|
in: body
|
|
description: |
|
|
Confirmation whether all scopes must be reset
|
|
type: bool
|
|
|
|
collector_body:
|
|
<<: *collector
|
|
in: body
|
|
|
|
collector_resp:
|
|
<<: *collector
|
|
required: true
|
|
description: Collector for the given scope
|
|
in: body
|
|
|
|
fetcher_body:
|
|
<<: *fetcher
|
|
in: body
|
|
|
|
fetcher_resp:
|
|
<<: *fetcher
|
|
required: true
|
|
description: Fetcher for the given scope
|
|
in: body
|
|
|
|
last_processed_timestamp:
|
|
in: body
|
|
description: |
|
|
It represents the last processed timestamp for the storage state element.
|
|
type: iso8601 timestamp
|
|
required: true
|
|
|
|
scope_id_body:
|
|
<<: *scope_id
|
|
in: body
|
|
|
|
scope_id_resp:
|
|
<<: *scope_id
|
|
required: true
|
|
description: Scope
|
|
in: body
|
|
|
|
scope_key_body:
|
|
<<: *scope_key
|
|
in: body
|
|
|
|
scope_key_resp:
|
|
<<: *scope_key
|
|
required: true
|
|
description: Scope key for the given scope
|
|
in: body
|
|
|
|
state:
|
|
in: body
|
|
description: |
|
|
State of the scope. This variable represents the last processed
|
|
timestamp for the storage state element. It is DEPRECATED, and it will
|
|
be removed in upcoming releases. The alternative is
|
|
`last_processed_timestamp`.
|
|
type: iso8601 timestamp
|
|
required: true
|