From 12bb6c9e8dffca0231d2fb9f4511d93107b81c0e Mon Sep 17 00:00:00 2001 From: bhagwatvyas Date: Tue, 10 Mar 2020 16:17:19 +0000 Subject: [PATCH] Releasing version 2.11.0 --- CHANGELOG.rst | 12 +++++++ src/oci/budget/budget_client.py | 36 +++++++++++++++++++ src/oci/budget/models/alert_rule_summary.py | 4 +-- src/oci/budget/models/budget.py | 4 +-- src/oci/budget/models/budget_summary.py | 4 +-- .../models/create_alert_rule_details.py | 6 ++-- .../budget/models/create_budget_details.py | 4 +-- .../models/update_alert_rule_details.py | 4 +-- src/oci/config.py | 2 +- src/oci/version.py | 2 +- 10 files changed, 63 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index fc7075882f..3b25a240be 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -3,6 +3,18 @@ Change Log All notable changes to this project will be documented in this file. The format is based on `Keep a Changelog `_. +==================== +2.11.0 - 2020-03-10 +==================== + +Added +----- +* Support for Events service integration with alerts in the Budgets service + +Breaking +-------- +* The parameters sort_by and lifecycle_state type from Budget service are changed from str to enum + ==================== 2.10.7 - 2020-03-03 ==================== diff --git a/src/oci/budget/budget_client.py b/src/oci/budget/budget_client.py index 64c793bc85..5d282da6e3 100644 --- a/src/oci/budget/budget_client.py +++ b/src/oci/budget/budget_client.py @@ -582,9 +582,13 @@ def list_alert_rules(self, budget_id, **kwargs): The default sort order for timeCreated is DESC. The default sort order for displayName is ASC in alphanumeric order. + Allowed values are: "timeCreated", "displayName" + :param str lifecycle_state: (optional) The current state of the resource to filter by. + Allowed values are: "ACTIVE", "INACTIVE" + :param str display_name: (optional) A user-friendly name. Does not have to be unique, and it's changeable. @@ -640,6 +644,20 @@ def list_alert_rules(self, budget_id, **kwargs): "Invalid value for `sort_order`, must be one of {0}".format(sort_order_allowed_values) ) + if 'sort_by' in kwargs: + sort_by_allowed_values = ["timeCreated", "displayName"] + if kwargs['sort_by'] not in sort_by_allowed_values: + raise ValueError( + "Invalid value for `sort_by`, must be one of {0}".format(sort_by_allowed_values) + ) + + if 'lifecycle_state' in kwargs: + lifecycle_state_allowed_values = ["ACTIVE", "INACTIVE"] + if kwargs['lifecycle_state'] not in lifecycle_state_allowed_values: + raise ValueError( + "Invalid value for `lifecycle_state`, must be one of {0}".format(lifecycle_state_allowed_values) + ) + query_params = { "limit": kwargs.get("limit", missing), "page": kwargs.get("page", missing), @@ -713,9 +731,13 @@ def list_budgets(self, compartment_id, **kwargs): The default sort order for timeCreated is DESC. The default sort order for displayName is ASC in alphanumeric order. + Allowed values are: "timeCreated", "displayName" + :param str lifecycle_state: (optional) The current state of the resource to filter by. + Allowed values are: "ACTIVE", "INACTIVE" + :param str display_name: (optional) A user-friendly name. Does not have to be unique, and it's changeable. @@ -770,6 +792,20 @@ def list_budgets(self, compartment_id, **kwargs): "Invalid value for `sort_order`, must be one of {0}".format(sort_order_allowed_values) ) + if 'sort_by' in kwargs: + sort_by_allowed_values = ["timeCreated", "displayName"] + if kwargs['sort_by'] not in sort_by_allowed_values: + raise ValueError( + "Invalid value for `sort_by`, must be one of {0}".format(sort_by_allowed_values) + ) + + if 'lifecycle_state' in kwargs: + lifecycle_state_allowed_values = ["ACTIVE", "INACTIVE"] + if kwargs['lifecycle_state'] not in lifecycle_state_allowed_values: + raise ValueError( + "Invalid value for `lifecycle_state`, must be one of {0}".format(lifecycle_state_allowed_values) + ) + if 'target_type' in kwargs: target_type_allowed_values = ["ALL", "COMPARTMENT", "TAG"] if kwargs['target_type'] not in target_type_allowed_values: diff --git a/src/oci/budget/models/alert_rule_summary.py b/src/oci/budget/models/alert_rule_summary.py index 8d90dc6ca3..e820b738d8 100644 --- a/src/oci/budget/models/alert_rule_summary.py +++ b/src/oci/budget/models/alert_rule_summary.py @@ -424,7 +424,7 @@ def version(self, version): def recipients(self): """ **[Required]** Gets the recipients of this AlertRuleSummary. - The audience that will received the alert when it triggers. + The audience that will receive the alert when it triggers. :return: The recipients of this AlertRuleSummary. @@ -436,7 +436,7 @@ def recipients(self): def recipients(self, recipients): """ Sets the recipients of this AlertRuleSummary. - The audience that will received the alert when it triggers. + The audience that will receive the alert when it triggers. :param recipients: The recipients of this AlertRuleSummary. diff --git a/src/oci/budget/models/budget.py b/src/oci/budget/models/budget.py index 8d2a7ceba0..95eb43b181 100644 --- a/src/oci/budget/models/budget.py +++ b/src/oci/budget/models/budget.py @@ -398,7 +398,7 @@ def targets(self): Gets the targets of this Budget. The list of targets on which the budget is applied. If targetType is \"COMPARTMENT\", targets contains list of compartment OCIDs. - If targetType is \"TAG\", targets contains list of tag identifiers in the form of \"{tagNamespace}.{tagKey}.{tagValue}\". + If targetType is \"TAG\", targets contains list of cost tracking tag identifiers in the form of \"{tagNamespace}.{tagKey}.{tagValue}\". :return: The targets of this Budget. @@ -412,7 +412,7 @@ def targets(self, targets): Sets the targets of this Budget. The list of targets on which the budget is applied. If targetType is \"COMPARTMENT\", targets contains list of compartment OCIDs. - If targetType is \"TAG\", targets contains list of tag identifiers in the form of \"{tagNamespace}.{tagKey}.{tagValue}\". + If targetType is \"TAG\", targets contains list of cost tracking tag identifiers in the form of \"{tagNamespace}.{tagKey}.{tagValue}\". :param targets: The targets of this Budget. diff --git a/src/oci/budget/models/budget_summary.py b/src/oci/budget/models/budget_summary.py index bfc3a6b403..14f54a66a9 100644 --- a/src/oci/budget/models/budget_summary.py +++ b/src/oci/budget/models/budget_summary.py @@ -398,7 +398,7 @@ def targets(self): Gets the targets of this BudgetSummary. The list of targets on which the budget is applied. If targetType is \"COMPARTMENT\", targets contains list of compartment OCIDs. - If targetType is \"TAG\", targets contains list of tag identifiers in the form of \"{tagNamespace}.{tagKey}.{tagValue}\". + If targetType is \"TAG\", targets contains list of cost tracking tag identifiers in the form of \"{tagNamespace}.{tagKey}.{tagValue}\". :return: The targets of this BudgetSummary. @@ -412,7 +412,7 @@ def targets(self, targets): Sets the targets of this BudgetSummary. The list of targets on which the budget is applied. If targetType is \"COMPARTMENT\", targets contains list of compartment OCIDs. - If targetType is \"TAG\", targets contains list of tag identifiers in the form of \"{tagNamespace}.{tagKey}.{tagValue}\". + If targetType is \"TAG\", targets contains list of cost tracking tag identifiers in the form of \"{tagNamespace}.{tagKey}.{tagValue}\". :param targets: The targets of this BudgetSummary. diff --git a/src/oci/budget/models/create_alert_rule_details.py b/src/oci/budget/models/create_alert_rule_details.py index 06e541fac9..f2f2a8863f 100644 --- a/src/oci/budget/models/create_alert_rule_details.py +++ b/src/oci/budget/models/create_alert_rule_details.py @@ -251,8 +251,8 @@ def threshold_type(self, threshold_type): @property def recipients(self): """ - **[Required]** Gets the recipients of this CreateAlertRuleDetails. - The audience that will received the alert when it triggers. + Gets the recipients of this CreateAlertRuleDetails. + The audience that will receive the alert when it triggers. An empty string is interpreted as null. :return: The recipients of this CreateAlertRuleDetails. @@ -264,7 +264,7 @@ def recipients(self): def recipients(self, recipients): """ Sets the recipients of this CreateAlertRuleDetails. - The audience that will received the alert when it triggers. + The audience that will receive the alert when it triggers. An empty string is interpreted as null. :param recipients: The recipients of this CreateAlertRuleDetails. diff --git a/src/oci/budget/models/create_budget_details.py b/src/oci/budget/models/create_budget_details.py index 16472ac5cf..e214922f98 100644 --- a/src/oci/budget/models/create_budget_details.py +++ b/src/oci/budget/models/create_budget_details.py @@ -306,7 +306,7 @@ def targets(self): Gets the targets of this CreateBudgetDetails. The list of targets on which the budget is applied. If targetType is \"COMPARTMENT\", targets contains list of compartment OCIDs. - If targetType is \"TAG\", targets contains list of tag identifiers in the form of \"{tagNamespace}.{tagKey}.{tagValue}\". + If targetType is \"TAG\", targets contains list of cost tracking tag identifiers in the form of \"{tagNamespace}.{tagKey}.{tagValue}\". Curerntly, the array should contain EXACT ONE item. @@ -321,7 +321,7 @@ def targets(self, targets): Sets the targets of this CreateBudgetDetails. The list of targets on which the budget is applied. If targetType is \"COMPARTMENT\", targets contains list of compartment OCIDs. - If targetType is \"TAG\", targets contains list of tag identifiers in the form of \"{tagNamespace}.{tagKey}.{tagValue}\". + If targetType is \"TAG\", targets contains list of cost tracking tag identifiers in the form of \"{tagNamespace}.{tagKey}.{tagValue}\". Curerntly, the array should contain EXACT ONE item. diff --git a/src/oci/budget/models/update_alert_rule_details.py b/src/oci/budget/models/update_alert_rule_details.py index a514fc6345..08b0ce8c7c 100644 --- a/src/oci/budget/models/update_alert_rule_details.py +++ b/src/oci/budget/models/update_alert_rule_details.py @@ -228,7 +228,7 @@ def threshold_type(self, threshold_type): def recipients(self): """ Gets the recipients of this UpdateAlertRuleDetails. - The audience that will received the alert when it triggers. + The audience that will receive the alert when it triggers. If you need to clear out this value, please pass in an empty string instead of null. :return: The recipients of this UpdateAlertRuleDetails. @@ -240,7 +240,7 @@ def recipients(self): def recipients(self, recipients): """ Sets the recipients of this UpdateAlertRuleDetails. - The audience that will received the alert when it triggers. + The audience that will receive the alert when it triggers. If you need to clear out this value, please pass in an empty string instead of null. :param recipients: The recipients of this UpdateAlertRuleDetails. diff --git a/src/oci/config.py b/src/oci/config.py index 4171f3a45e..7fb6b3f842 100644 --- a/src/oci/config.py +++ b/src/oci/config.py @@ -74,7 +74,7 @@ def from_file(file_location=DEFAULT_LOCATION, profile_name=DEFAULT_PROFILE): parser = configparser.ConfigParser(interpolation=None) if not parser.read(expanded_file_location): - raise ConfigFileNotFound("Could not find config file at {}".format(expanded_file_location)) + raise ConfigFileNotFound("Could not find config file at {}, please follow the instructions in the link to setup the config file https://docs.cloud.oracle.com/en-us/iaas/Content/API/Concepts/sdkconfig.htm".format(expanded_file_location)) if profile_name not in parser: raise ProfileNotFound("Profile '{}' not found in config file {}".format(profile_name, expanded_file_location)) diff --git a/src/oci/version.py b/src/oci/version.py index d342823baf..19ab5c68bb 100644 --- a/src/oci/version.py +++ b/src/oci/version.py @@ -1,4 +1,4 @@ # coding: utf-8 # Copyright (c) 2016, 2020, Oracle and/or its affiliates. All rights reserved. -__version__ = "2.10.7" +__version__ = "2.11.0"