Chargeback Groups
RCTL support helps to automate the lifecycle of operations associated with Chargeback Groups.
Resource | Create | Get | Delete |
---|---|---|---|
Chargeback Group | Yes | Yes | Yes |
Chargeback Group¶
Create Chargeback Group¶
Use the below command to create a chargeback group of summary/detailed Report
./rctl create chargebackgroup -f <configfile_name>
An illustrative example of a detailed report config file is given below
apiVersion: system.k8smgmt.io/v3
kind: ChargebackGroup
metadata:
name: rctld2
description: ""
spec:
inclusions:
- project: p1
cluster: ""
namespace: ""
label:
- scb3
exclusions:
- project: p1
cluster: ""
namespace: ""
label: []
type: detailed
An illustrative example of a summary report config file is given below
apiVersion: system.k8smgmt.io/v3
kind: ChargebackGroup
metadata:
name: rctld2
description: ""
spec:
inclusions:
- project: p1
aggregate:
project: false
cluster: false
namespace: false
label:
- scb3
type: summary
Generate Report¶
To generate a chargeback group report, use the below command
./rctl create chargebackgroupreport -f <configfile_name>
An illustrative example of a report generating config file is given below
apiVersion: system.k8smgmt.io/v3
kind: ChargebackGroupReport
metadata:
name: rctld2
description: ""
spec:
groupName: rctld2
startDate:
seconds: 1669011971
endDate:
seconds: 1669616771
List Chargeback Groups¶
To view the list of all chargeback groups, use the below command
./rctl get chargebackgroup
+------------+-------------+-------------------+
| GROUP NAME | REPORT TYPE | REPORTS GENERATED |
+------------+-------------+-------------------+
| rctl1 | summary | 0 |
+------------+-------------+-------------------+
| rctl2 | summary | 1 |
+------------+-------------+-------------------+
| rctl3 | detailed | 0 |
+------------+-------------+-------------------+
| cb-group-1 | summary | 0 |
+------------+-------------+-------------------+
| cb-group-2 | summary | 0 |
+------------+-------------+-------------------+
To retrieve a specific chargeback group details, use the below command
./rctl get chargebackgroup <group-name>
Example Output
./rctl get chargebackgroup rctl2
+------------+-------------+-------------------+
| GROUP NAME | REPORT TYPE | REPORTS GENERATED |
+------------+-------------+-------------------+
| rctl2 | summary | 1 |
+------------+-------------+-------------------+
Or you can use below commands to get more information of the chargeback group in json or yaml format
./rctl get chargebackgroup <cbg-name> -o json
(or)
./rctl get chargebackgroup <cbg-name> -o yaml
Example Output
./rctl get chargebackgroup cb-group-1 -o yaml
apiVersion: system.k8smgmt.io/v3
kind: ChargebackGroup
metadata:
name: cb-group-1
spec:
aggregate: {}
inclusions:
- label:
- ""
type: summary
status:
extra:
data: {}
Chargeback Share Configuration¶
Users can enable/disable the Chargeback Share Type via the configuration file
Below is an example of chargeback group share config file. Users can edit the shareEnabled parameter to true or false to share/unshare the chargebackgroup and change the required sharetype tenancy/allocation.
apiVersion: system.k8smgmt.io/v3
kind: ChargebackShare
metadata:
name: chargebackshare
spec:
shareEnabled: true
shareType: tenancy
Now run the below command to apply the required configuration
./rctl create chargebackshare -f <configfile_name>
Delete Chargeback Group¶
Users can delete a chargeback group using the below command
./rctl delete chargebackgroup <chargebackgroup-name>
Important
You cannot delete a chargeback group report and chargeback share