Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <http://keepachangelog.com/>`_.
====================
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
====================
Expand Down
36 changes: 36 additions & 0 deletions src/oci/budget/budget_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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),
Expand Down Expand Up @@ -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.

Expand Down Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions src/oci/budget/models/alert_rule_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions src/oci/budget/models/budget.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions src/oci/budget/models/budget_summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
Expand Down
6 changes: 3 additions & 3 deletions src/oci/budget/models/create_alert_rule_details.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions src/oci/budget/models/create_budget_details.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.


Expand All @@ -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.


Expand Down
4 changes: 2 additions & 2 deletions src/oci/budget/models/update_alert_rule_details.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/oci/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion src/oci/version.py
Original file line number Diff line number Diff line change
@@ -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"