Files
cloudkitty/doc/source/_static/cloudkitty.policy.yaml.sample
Rafael Weingärtner 2acaa5a4a3 Add active status fields in the storage state table
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/
2021-10-06 16:23:07 -03:00

108 lines
2.9 KiB
Plaintext

#"context_is_admin": "role:admin"
#"admin_or_owner": "is_admin:True or (role:admin and is_admin_project:True) or project_id:%(project_id)s"
#"default": ""
# Return the list of every services mapped to a collector.
# LIST /v1/collector/mappings
#"collector:list_mappings": "role:admin"
# Return a service to collector mapping.
# GET /v1/collector/mappings/{service_id}
#"collector:get_mapping": "role:admin"
# Manage a service to collector mapping.
# POST /v1/collector/mappings
# DELETE /v1/collector/mappings/{service_id}
#"collector:manage_mapping": "role:admin"
# Query the enable state of a collector.
# GET /v1/collector/states/{collector_id}
#"collector:get_state": "role:admin"
# Set the enable state of a collector.
# PUT /v1/collector/states/{collector_id}
#"collector:update_state": "role:admin"
# List available services information in Cloudkitty.
# LIST /v1/info/services
#"info:list_services_info": ""
# Get specified service information.
# GET /v1/info/services/{metric_id}
#"info:get_service_info": ""
# List available metrics information in Cloudkitty.
# LIST /v1/info/metrics
#"info:list_metrics_info": ""
# Get specified metric information.
# GET /v1/info/metrics/{metric_id}
#"info:get_metric_info": ""
# Get current configuration in Cloudkitty.
# GET /v1/info/config
#"info:get_config": ""
# Return the list of loaded modules in Cloudkitty.
# LIST /v1/rating/modules
#"rating:list_modules": "role:admin"
# Get specified module.
# GET /v1/rating/modules/{module_id}
#"rating:get_module": "role:admin"
# Change the state and priority of a module.
# PUT /v1/rating/modules/{module_id}
#"rating:update_module": "role:admin"
# Get an instant quote based on multiple resource descriptions.
# POST /v1/rating/quote
#"rating:quote": ""
# Trigger a rating module list reload.
# GET /v1/rating/reload_modules
#"rating:module_config": "role:admin"
# Return the list of rated tenants.
# GET /v1/report/tenants
#"report:list_tenants": "role:admin"
# Return the summary to pay for a given period.
# GET /v1/report/summary
#"report:get_summary": "rule:admin_or_owner"
# Return the amount to pay for a given period.
# GET /v1/report/total
#"report:get_total": "rule:admin_or_owner"
# Return a list of rated resources for a time period and a tenant.
# GET /v1/storage/dataframes
#"storage:list_data_frames": "rule:admin_or_owner"
# Add one or several DataFrames
# POST /v2/dataframes
#"dataframes:add": "role:admin"
# Get DataFrames
# GET /v2/dataframes
#"dataframes:get": "rule:admin_or_owner"
# Get the state of one or several scopes
# GET /v2/scope
#"scope:get_state": "role:admin"
# Reset the state of one or several scopes
# PUT /v2/scope
#"scope:reset_state": "role:admin"
# Enables operators to patch a storage scope
# PATCH /v2/scope
#"scope:patch_state": "role:admin"
# Get a rating summary
# GET /v2/summary
#"summary:get_summary": "rule:admin_or_owner"