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

fix(monitoring): deprecate resource name helper methods; update docs configuration (via synth) #9838

Merged
merged 1 commit into from
Nov 19, 2019
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
2 changes: 1 addition & 1 deletion monitoring/docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
# html_static_path = []
html_static_path = ["_static"]

# Add any extra paths that contain custom files (such as robots.txt or
# .htaccess) here, relative to this directory. These files are copied
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,12 @@ def from_service_account_file(cls, filename, *args, **kwargs):

@classmethod
def alert_policy_path(cls, project, alert_policy):
"""Return a fully-qualified alert_policy string."""
"""DEPRECATED. Return a fully-qualified alert_policy string."""
warnings.warn(
"Resource name helper functions are deprecated.",
PendingDeprecationWarning,
stacklevel=1,
)
return google.api_core.path_template.expand(
"projects/{project}/alertPolicies/{alert_policy}",
project=project,
Expand All @@ -99,7 +104,12 @@ def alert_policy_path(cls, project, alert_policy):

@classmethod
def alert_policy_condition_path(cls, project, alert_policy, condition):
"""Return a fully-qualified alert_policy_condition string."""
"""DEPRECATED. Return a fully-qualified alert_policy_condition string."""
warnings.warn(
"Resource name helper functions are deprecated.",
PendingDeprecationWarning,
stacklevel=1,
)
return google.api_core.path_template.expand(
"projects/{project}/alertPolicies/{alert_policy}/conditions/{condition}",
project=project,
Expand All @@ -109,7 +119,12 @@ def alert_policy_condition_path(cls, project, alert_policy, condition):

@classmethod
def project_path(cls, project):
"""Return a fully-qualified project string."""
"""DEPRECATED. Return a fully-qualified project string."""
warnings.warn(
"Resource name helper functions are deprecated.",
PendingDeprecationWarning,
stacklevel=1,
)
return google.api_core.path_template.expand(
"projects/{project}", project=project,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,24 @@ def from_service_account_file(cls, filename, *args, **kwargs):

@classmethod
def group_path(cls, project, group):
"""Return a fully-qualified group string."""
"""DEPRECATED. Return a fully-qualified group string."""
warnings.warn(
"Resource name helper functions are deprecated.",
PendingDeprecationWarning,
stacklevel=1,
)
return google.api_core.path_template.expand(
"projects/{project}/groups/{group}", project=project, group=group,
)

@classmethod
def project_path(cls, project):
"""Return a fully-qualified project string."""
"""DEPRECATED. Return a fully-qualified project string."""
warnings.warn(
"Resource name helper functions are deprecated.",
PendingDeprecationWarning,
stacklevel=1,
)
return google.api_core.path_template.expand(
"projects/{project}", project=project,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,12 @@ def from_service_account_file(cls, filename, *args, **kwargs):

@classmethod
def metric_descriptor_path(cls, project, metric_descriptor):
"""Return a fully-qualified metric_descriptor string."""
"""DEPRECATED. Return a fully-qualified metric_descriptor string."""
warnings.warn(
"Resource name helper functions are deprecated.",
PendingDeprecationWarning,
stacklevel=1,
)
return google.api_core.path_template.expand(
"projects/{project}/metricDescriptors/{metric_descriptor=**}",
project=project,
Expand All @@ -99,7 +104,12 @@ def metric_descriptor_path(cls, project, metric_descriptor):

@classmethod
def monitored_resource_descriptor_path(cls, project, monitored_resource_descriptor):
"""Return a fully-qualified monitored_resource_descriptor string."""
"""DEPRECATED. Return a fully-qualified monitored_resource_descriptor string."""
warnings.warn(
"Resource name helper functions are deprecated.",
PendingDeprecationWarning,
stacklevel=1,
)
return google.api_core.path_template.expand(
"projects/{project}/monitoredResourceDescriptors/{monitored_resource_descriptor}",
project=project,
Expand All @@ -108,7 +118,12 @@ def monitored_resource_descriptor_path(cls, project, monitored_resource_descript

@classmethod
def project_path(cls, project):
"""Return a fully-qualified project string."""
"""DEPRECATED. Return a fully-qualified project string."""
warnings.warn(
"Resource name helper functions are deprecated.",
PendingDeprecationWarning,
stacklevel=1,
)
return google.api_core.path_template.expand(
"projects/{project}", project=project,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,12 @@ def from_service_account_file(cls, filename, *args, **kwargs):

@classmethod
def notification_channel_path(cls, project, notification_channel):
"""Return a fully-qualified notification_channel string."""
"""DEPRECATED. Return a fully-qualified notification_channel string."""
warnings.warn(
"Resource name helper functions are deprecated.",
PendingDeprecationWarning,
stacklevel=1,
)
return google.api_core.path_template.expand(
"projects/{project}/notificationChannels/{notification_channel}",
project=project,
Expand All @@ -105,7 +110,12 @@ def notification_channel_path(cls, project, notification_channel):

@classmethod
def notification_channel_descriptor_path(cls, project, channel_descriptor):
"""Return a fully-qualified notification_channel_descriptor string."""
"""DEPRECATED. Return a fully-qualified notification_channel_descriptor string."""
warnings.warn(
"Resource name helper functions are deprecated.",
PendingDeprecationWarning,
stacklevel=1,
)
return google.api_core.path_template.expand(
"projects/{project}/notificationChannelDescriptors/{channel_descriptor}",
project=project,
Expand All @@ -114,7 +124,12 @@ def notification_channel_descriptor_path(cls, project, channel_descriptor):

@classmethod
def project_path(cls, project):
"""Return a fully-qualified project string."""
"""DEPRECATED. Return a fully-qualified project string."""
warnings.warn(
"Resource name helper functions are deprecated.",
PendingDeprecationWarning,
stacklevel=1,
)
return google.api_core.path_template.expand(
"projects/{project}", project=project,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,21 +101,36 @@ def from_service_account_file(cls, filename, *args, **kwargs):

@classmethod
def project_path(cls, project):
"""Return a fully-qualified project string."""
"""DEPRECATED. Return a fully-qualified project string."""
warnings.warn(
"Resource name helper functions are deprecated.",
PendingDeprecationWarning,
stacklevel=1,
)
return google.api_core.path_template.expand(
"projects/{project}", project=project,
)

@classmethod
def service_path(cls, project, service):
"""Return a fully-qualified service string."""
"""DEPRECATED. Return a fully-qualified service string."""
warnings.warn(
"Resource name helper functions are deprecated.",
PendingDeprecationWarning,
stacklevel=1,
)
return google.api_core.path_template.expand(
"projects/{project}/services/{service}", project=project, service=service,
)

@classmethod
def service_level_objective_path(cls, project, service, service_level_objective):
"""Return a fully-qualified service_level_objective string."""
"""DEPRECATED. Return a fully-qualified service_level_objective string."""
warnings.warn(
"Resource name helper functions are deprecated.",
PendingDeprecationWarning,
stacklevel=1,
)
return google.api_core.path_template.expand(
"projects/{project}/services/{service}/serviceLevelObjectives/{service_level_objective}",
project=project,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,24 @@ def from_service_account_file(cls, filename, *args, **kwargs):

@classmethod
def project_path(cls, project):
"""Return a fully-qualified project string."""
"""DEPRECATED. Return a fully-qualified project string."""
warnings.warn(
"Resource name helper functions are deprecated.",
PendingDeprecationWarning,
stacklevel=1,
)
return google.api_core.path_template.expand(
"projects/{project}", project=project,
)

@classmethod
def uptime_check_config_path(cls, project, uptime_check_config):
"""Return a fully-qualified uptime_check_config string."""
"""DEPRECATED. Return a fully-qualified uptime_check_config string."""
warnings.warn(
"Resource name helper functions are deprecated.",
PendingDeprecationWarning,
stacklevel=1,
)
return google.api_core.path_template.expand(
"projects/{project}/uptimeCheckConfigs/{uptime_check_config}",
project=project,
Expand Down
10 changes: 5 additions & 5 deletions monitoring/synth.metadata
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"updateTime": "2019-11-14T13:26:57.703896Z",
"updateTime": "2019-11-19T13:28:35.257420Z",
"sources": [
{
"generator": {
"name": "artman",
"version": "0.41.1",
"dockerImage": "googleapis/artman@sha256:545c758c76c3f779037aa259023ec3d1ef2d57d2c8cd00a222cb187d63ceac5e"
"version": "0.42.1",
"dockerImage": "googleapis/artman@sha256:c773192618c608a7a0415dd95282f841f8e6bcdef7dd760a988c93b77a64bd57"
}
},
{
"git": {
"name": "googleapis",
"remote": "https://github.com/googleapis/googleapis.git",
"sha": "4f747bda9b099b4426f495985680d16d0227fa5f",
"internalRef": "280394936"
"sha": "d8dd7fe8d5304f7bd1c52207703d7f27d5328c5a",
"internalRef": "281088257"
}
},
{
Expand Down