Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

POL-877 Add Alibaba Cloud CBI #1807

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

POL-877 Add Alibaba Cloud CBI #1807

wants to merge 1 commit into from

Conversation

mburmeig
Copy link
Contributor

@mburmeig mburmeig commented Feb 8, 2024

Description

Allows us to ingest both historic, single file imports, and daily, multi file exports into Flexera.

Issues Resolved

New functionality

Link to Example Applied Policy

Historic billing data import
https://ibm.app.flexera.com/orgs/35130/automation/applied-policies/projects/136970?policyId=65c5127a8e86c40001ae437d

Daily granularity import
https://ibm.app.flexera.com/orgs/35130/automation/applied-policies/projects/136970?policyId=65c5122ab7ceed00016c4189

Contribution Check List

  • New functionality includes testing.
  • New functionality has been documented in the README if applicable
  • New functionality has been documented in CHANGELOG.MD

Copy link
Contributor

github-actions bot commented Feb 8, 2024

9 Errors
🚫 cost/alibaba/Alibaba_Multiple_Files/CHANGELOG.md:1: MD022 Headers should be surrounded by blank lines

A detailed description of the rules is available at https://github.com/markdownlint/markdownlint/blob/master/docs/RULES.md

🚫 cost/alibaba/Alibaba_Multiple_Files/README.md:26: MD012 Multiple consecutive blank lines
cost/alibaba/Alibaba_Multiple_Files/README.md:40: MD034 Bare URL used

A detailed description of the rules is available at https://github.com/markdownlint/markdownlint/blob/master/docs/RULES.md

🚫 cost/alibaba/Alibaba_Single_File/CHANGELOG.md:1: MD022 Headers should be surrounded by blank lines

A detailed description of the rules is available at https://github.com/markdownlint/markdownlint/blob/master/docs/RULES.md

🚫 cost/alibaba/Alibaba_Single_File/README.md:25: MD012 Multiple consecutive blank lines
cost/alibaba/Alibaba_Single_File/README.md:9: MD032 Lists should be surrounded by blank lines
cost/alibaba/Alibaba_Single_File/README.md:11: MD032 Lists should be surrounded by blank lines
cost/alibaba/Alibaba_Single_File/README.md:19: MD032 Lists should be surrounded by blank lines
cost/alibaba/Alibaba_Single_File/README.md:39: MD034 Bare URL used

A detailed description of the rules is available at https://github.com/markdownlint/markdownlint/blob/master/docs/RULES.md

🚫 Policy Template path should be lowercase. cost/alibaba/Alibaba_Multiple_Files/Alibaba_Daily.pt
🚫 Policy Template path should be lowercase. cost/alibaba/Alibaba_Single_File/Alibaba_Monthly.pt
🚫 Please add labels to this Pull Request
🚫 Textlint failed on cost/alibaba/Alibaba_Multiple_Files/README.md
🚫 Textlint failed on cost/alibaba/Alibaba_Single_File/README.md
4 Messages
📖 Checking cost/alibaba/Alibaba_Multiple_Files/Alibaba_Daily.pt
📖 Checking cost/alibaba/Alibaba_Single_File/Alibaba_Monthly.pt
📖 /home/runner/work/policy_templates/policy_templates/cost/alibaba/Alibaba_Multiple_Files/README.md
40:42 error https://flexera.atlassian.net/wiki/spaces/FP/pages/2228814857/Alibaba+Cloud+CBI is dead. (request to https://id.atlassian.com/login?continue=https%3A%2F%2Fid.atlassian.com%2Fjoin%2Fuser-access%3Fresource%3Dari%253Acloud%253Aconfluence%253A%253Asite%252F9b84fdb5-075b-41cd-809b-b6ffa35abf85%26continue%3Dhttps%253A%252F%252Fflexera.atlassian.net%252Fwiki%252Fspaces%252FFP%252Fpages%252F2228814857%252FAlibaba%252BCloud%252BCBI&application=confluence failed, reason: write EPROTO 140540392843136:error:14094410:SSL routines:ssl3_read_bytes:sslv3 alert handshake failure:../deps/openssl/openssl/ssl/record/rec_layer_s3.c:1544:SSL alert number 40
) no-dead-link

✖ 1 problem (1 error, 0 warnings)

📖 /home/runner/work/policy_templates/policy_templates/cost/alibaba/Alibaba_Single_File/README.md
9:392 ✓ error Found trailing spaces at line's ending editorconfig
39:42 error https://flexera.atlassian.net/wiki/spaces/FP/pages/2228814857/Alibaba+Cloud+CBI is dead. (request to https://id.atlassian.com/login?continue=https%3A%2F%2Fid.atlassian.com%2Fjoin%2Fuser-access%3Fresource%3Dari%253Acloud%253Aconfluence%253A%253Asite%252F9b84fdb5-075b-41cd-809b-b6ffa35abf85%26continue%3Dhttps%253A%252F%252Fflexera.atlassian.net%252Fwiki%252Fspaces%252FFP%252Fpages%252F2228814857%252FAlibaba%252BCloud%252BCBI&application=confluence failed, reason: write EPROTO 140240203126656:error:14094410:SSL routines:ssl3_read_bytes:sslv3 alert handshake failure:../deps/openssl/openssl/ssl/record/rec_layer_s3.c:1544:SSL alert number 40
) no-dead-link

✖ 2 problems (2 errors, 0 warnings)
✓ 1 fixable problem.
Try to run: $ textlint –fix [file]

Generated by 🚫 Danger

@nia-vf1 nia-vf1 changed the title POL-877 POL-877 Add Alibaba Cloud CBI Mar 12, 2024
@@ -0,0 +1,426 @@
name "Alibaba Cloud Common Bill Ingestion daily"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Path to file is currently cost/alibaba/Alibaba_Multiple_Files/Alibaba_Daily.pt

This should be all lowercase like the other files in this repository. Consider changing to something like:
cost/alibaba/alibaba_cloud_cbi/alibaba_cloud_cbi.pt

@@ -0,0 +1,426 @@
name "Alibaba Cloud Common Bill Ingestion daily"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
name "Alibaba Cloud Common Bill Ingestion daily"
name "Alibaba Cloud Common Bill Ingestion"

category "Cost"
default_frequency "daily"
info(
version: "0.1",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
version: "0.1",
version: "1.0",

Version 1.0 is probably fine here

name "Alibaba Cloud Common Bill Ingestion daily"
rs_pt_ver 20180301
type "policy"
short_description "Downloads cost reports from Alibaba Cloud using daily granularity and then uploads them to a Flexera CBI endpoint."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
short_description "Downloads cost reports from Alibaba Cloud using daily granularity and then uploads them to a Flexera CBI endpoint."
short_description "Downloads cost reports from Alibaba Cloud using daily granularity and then uploads them to a Flexera CBI endpoint. See the [README](https://github.com/flexera-public/policy_templates/tree/master/cost/alibaba/alibaba_cloud_cbi/) and [docs.flexera.com/flexera/EN/Automation](https://docs.flexera.com/flexera/EN/Automation/AutomationGS.htm) to learn more."

rs_pt_ver 20180301
type "policy"
short_description "Downloads cost reports from Alibaba Cloud using daily granularity and then uploads them to a Flexera CBI endpoint."
long_description "This is to be used when daily granularity (multiple files) from Alibaba. Used when costs have been exported on a daily basis for consumption to OSS."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Long Description field is not needed

@@ -0,0 +1,283 @@
name "Alibaba Cloud Common Bill Ingestion Aggregate"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We would want to support daily granularity in basically all cases. Therefore a Monthly granularity policy is not needed in the Catalog.

# Authentication
###############################################################################

credentials "auth_aws" do
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
credentials "auth_aws" do
credentials "auth_alibaba" do

datasource "ds_billing_data" do
iterate $ds_dates
request do
auth $auth_aws
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
auth $auth_aws
auth $auth_alibaba

###############################################################################

###############################################################################
# Datasources
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Datasources
# Datasources & Scripts

Datasources and Scripts should be in the same section

datasource "ds_billing_period" do
run_script $js_billing_period, $param_billing_period, $param_specific_period
end

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Accompanying 'script' should follow the datasource - e.g., in this case, this datasource should be followed by the script js_billing_period block currently on line 294.

See https://github.com/flexera-public/policy_templates/blob/master/cost/azure/azure_china_cbi/azure_china_cbi.pt or https://github.com/flexera-public/policy_templates/blob/master/cost/oracle/oracle_cbi/oracle_cbi.pt for examples


credentials "auth_flexera" do
schemes "oauth2"
label "flexera"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
label "flexera"
label "Flexera"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants