Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2a86088

Browse files
feat(monitoring): un-deprecate resource name helpers, add 2.7 sunset warning; bump copyright year to 2020; use templated noxfile (via synth) (#10047)
1 parent4d90329 commit2a86088

File tree

46 files changed

+678
-456
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+678
-456
lines changed

‎monitoring/docs/conf.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@
264264
u"google-cloud-monitoring Documentation",
265265
author,
266266
"manual",
267-
),
267+
)
268268
]
269269

270270
# The name of an image file (relative to this directory) to place at the top of
@@ -320,7 +320,7 @@
320320
"google-cloud-monitoring",
321321
"GAPIC library for the {metadata.shortName} v3 service",
322322
"APIs",
323-
),
323+
)
324324
]
325325

326326
# Documents to append as an appendix to all manuals.

‎monitoring/google/__init__.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22
#
3-
# Copyright2019 Google LLC
3+
# Copyright2020 Google LLC
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.

‎monitoring/google/cloud/__init__.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22
#
3-
# Copyright2019 Google LLC
3+
# Copyright2020 Google LLC
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.

‎monitoring/google/cloud/monitoring.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22
#
3-
# Copyright2019 Google LLC
3+
# Copyright2020 Google LLC
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.

‎monitoring/google/cloud/monitoring_v3/__init__.py‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22
#
3-
# Copyright2019 Google LLC
3+
# Copyright2020 Google LLC
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.
@@ -16,6 +16,8 @@
1616

1717

1818
from __future__importabsolute_import
19+
importsys
20+
importwarnings
1921

2022
fromgoogle.cloud.monitoring_v3importtypes
2123
fromgoogle.cloud.monitoring_v3.gapicimportalert_policy_service_client
@@ -29,6 +31,15 @@
2931
fromgoogle.cloud.monitoring_v3.gapicimportuptime_check_service_client
3032

3133

34+
ifsys.version_info[:2]== (2,7):
35+
message= (
36+
"A future version of this library will drop support for Python 2.7."
37+
"More details about Python 2 support for Google Cloud Client Libraries"
38+
"can be found at https://cloud.google.com/python/docs/python2-sunset/"
39+
)
40+
warnings.warn(message,DeprecationWarning)
41+
42+
3243
classAlertPolicyServiceClient(alert_policy_service_client.AlertPolicyServiceClient):
3344
__doc__=alert_policy_service_client.AlertPolicyServiceClient.__doc__
3445
enums=enums

‎monitoring/google/cloud/monitoring_v3/gapic/alert_policy_service_client.py‎

Lines changed: 14 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22
#
3-
# Copyright2019 Google LLC
3+
# Copyright2020 Google LLC
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.
@@ -44,7 +44,7 @@
4444

4545

4646
_GAPIC_LIBRARY_VERSION=pkg_resources.get_distribution(
47-
"google-cloud-monitoring",
47+
"google-cloud-monitoring"
4848
).version
4949

5050

@@ -90,12 +90,7 @@ def from_service_account_file(cls, filename, *args, **kwargs):
9090

9191
@classmethod
9292
defalert_policy_path(cls,project,alert_policy):
93-
"""DEPRECATED. Return a fully-qualified alert_policy string."""
94-
warnings.warn(
95-
"Resource name helper functions are deprecated.",
96-
PendingDeprecationWarning,
97-
stacklevel=1,
98-
)
93+
"""Return a fully-qualified alert_policy string."""
9994
returngoogle.api_core.path_template.expand(
10095
"projects/{project}/alertPolicies/{alert_policy}",
10196
project=project,
@@ -104,12 +99,7 @@ def alert_policy_path(cls, project, alert_policy):
10499

105100
@classmethod
106101
defalert_policy_condition_path(cls,project,alert_policy,condition):
107-
"""DEPRECATED. Return a fully-qualified alert_policy_condition string."""
108-
warnings.warn(
109-
"Resource name helper functions are deprecated.",
110-
PendingDeprecationWarning,
111-
stacklevel=1,
112-
)
102+
"""Return a fully-qualified alert_policy_condition string."""
113103
returngoogle.api_core.path_template.expand(
114104
"projects/{project}/alertPolicies/{alert_policy}/conditions/{condition}",
115105
project=project,
@@ -119,14 +109,9 @@ def alert_policy_condition_path(cls, project, alert_policy, condition):
119109

120110
@classmethod
121111
defproject_path(cls,project):
122-
"""DEPRECATED. Return a fully-qualified project string."""
123-
warnings.warn(
124-
"Resource name helper functions are deprecated.",
125-
PendingDeprecationWarning,
126-
stacklevel=1,
127-
)
112+
"""Return a fully-qualified project string."""
128113
returngoogle.api_core.path_template.expand(
129-
"projects/{project}",project=project,
114+
"projects/{project}",project=project
130115
)
131116

132117
def__init__(
@@ -216,12 +201,12 @@ def __init__(
216201
self.transport=transport
217202
else:
218203
self.transport=alert_policy_service_grpc_transport.AlertPolicyServiceGrpcTransport(
219-
address=api_endpoint,channel=channel,credentials=credentials,
204+
address=api_endpoint,channel=channel,credentials=credentials
220205
)
221206

222207
ifclient_infoisNone:
223208
client_info=google.api_core.gapic_v1.client_info.ClientInfo(
224-
gapic_version=_GAPIC_LIBRARY_VERSION,
209+
gapic_version=_GAPIC_LIBRARY_VERSION
225210
)
226211
else:
227212
client_info.gapic_version=_GAPIC_LIBRARY_VERSION
@@ -232,7 +217,7 @@ def __init__(
232217
# (Ordinarily, these are the defaults specified in the `*_config.py`
233218
# file next to this one.)
234219
self._method_configs=google.api_core.gapic_v1.config.parse_method_configs(
235-
client_config["interfaces"][self._INTERFACE_NAME],
220+
client_config["interfaces"][self._INTERFACE_NAME]
236221
)
237222

238223
# Save a dictionary of cached API call functions.
@@ -337,7 +322,7 @@ def list_alert_policies(
337322
)
338323

339324
request=alert_service_pb2.ListAlertPoliciesRequest(
340-
name=name,filter=filter_,order_by=order_by,page_size=page_size,
325+
name=name,filter=filter_,order_by=order_by,page_size=page_size
341326
)
342327
ifmetadataisNone:
343328
metadata= []
@@ -423,7 +408,7 @@ def get_alert_policy(
423408
client_info=self._client_info,
424409
)
425410

426-
request=alert_service_pb2.GetAlertPolicyRequest(name=name,)
411+
request=alert_service_pb2.GetAlertPolicyRequest(name=name)
427412
ifmetadataisNone:
428413
metadata= []
429414
metadata=list(metadata)
@@ -513,7 +498,7 @@ def create_alert_policy(
513498
)
514499

515500
request=alert_service_pb2.CreateAlertPolicyRequest(
516-
name=name,alert_policy=alert_policy,
501+
name=name,alert_policy=alert_policy
517502
)
518503
ifmetadataisNone:
519504
metadata= []
@@ -587,7 +572,7 @@ def delete_alert_policy(
587572
client_info=self._client_info,
588573
)
589574

590-
request=alert_service_pb2.DeleteAlertPolicyRequest(name=name,)
575+
request=alert_service_pb2.DeleteAlertPolicyRequest(name=name)
591576
ifmetadataisNone:
592577
metadata= []
593578
metadata=list(metadata)
@@ -696,7 +681,7 @@ def update_alert_policy(
696681
)
697682

698683
request=alert_service_pb2.UpdateAlertPolicyRequest(
699-
alert_policy=alert_policy,update_mask=update_mask,
684+
alert_policy=alert_policy,update_mask=update_mask
700685
)
701686
ifmetadataisNone:
702687
metadata= []

‎monitoring/google/cloud/monitoring_v3/gapic/enums.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22
#
3-
# Copyright2019 Google LLC
3+
# Copyright2020 Google LLC
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.

‎monitoring/google/cloud/monitoring_v3/gapic/group_service_client.py‎

Lines changed: 14 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: utf-8 -*-
22
#
3-
# Copyright2019 Google LLC
3+
# Copyright2020 Google LLC
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
66
# you may not use this file except in compliance with the License.
@@ -47,7 +47,7 @@
4747

4848

4949
_GAPIC_LIBRARY_VERSION=pkg_resources.get_distribution(
50-
"google-cloud-monitoring",
50+
"google-cloud-monitoring"
5151
).version
5252

5353

@@ -95,26 +95,16 @@ def from_service_account_file(cls, filename, *args, **kwargs):
9595

9696
@classmethod
9797
defgroup_path(cls,project,group):
98-
"""DEPRECATED. Return a fully-qualified group string."""
99-
warnings.warn(
100-
"Resource name helper functions are deprecated.",
101-
PendingDeprecationWarning,
102-
stacklevel=1,
103-
)
98+
"""Return a fully-qualified group string."""
10499
returngoogle.api_core.path_template.expand(
105-
"projects/{project}/groups/{group}",project=project,group=group,
100+
"projects/{project}/groups/{group}",project=project,group=group
106101
)
107102

108103
@classmethod
109104
defproject_path(cls,project):
110-
"""DEPRECATED. Return a fully-qualified project string."""
111-
warnings.warn(
112-
"Resource name helper functions are deprecated.",
113-
PendingDeprecationWarning,
114-
stacklevel=1,
115-
)
105+
"""Return a fully-qualified project string."""
116106
returngoogle.api_core.path_template.expand(
117-
"projects/{project}",project=project,
107+
"projects/{project}",project=project
118108
)
119109

120110
def__init__(
@@ -204,12 +194,12 @@ def __init__(
204194
self.transport=transport
205195
else:
206196
self.transport=group_service_grpc_transport.GroupServiceGrpcTransport(
207-
address=api_endpoint,channel=channel,credentials=credentials,
197+
address=api_endpoint,channel=channel,credentials=credentials
208198
)
209199

210200
ifclient_infoisNone:
211201
client_info=google.api_core.gapic_v1.client_info.ClientInfo(
212-
gapic_version=_GAPIC_LIBRARY_VERSION,
202+
gapic_version=_GAPIC_LIBRARY_VERSION
213203
)
214204
else:
215205
client_info.gapic_version=_GAPIC_LIBRARY_VERSION
@@ -220,7 +210,7 @@ def __init__(
220210
# (Ordinarily, these are the defaults specified in the `*_config.py`
221211
# file next to this one.)
222212
self._method_configs=google.api_core.gapic_v1.config.parse_method_configs(
223-
client_config["interfaces"][self._INTERFACE_NAME],
213+
client_config["interfaces"][self._INTERFACE_NAME]
224214
)
225215

226216
# Save a dictionary of cached API call functions.
@@ -419,7 +409,7 @@ def get_group(
419409
client_info=self._client_info,
420410
)
421411

422-
request=group_service_pb2.GetGroupRequest(name=name,)
412+
request=group_service_pb2.GetGroupRequest(name=name)
423413
ifmetadataisNone:
424414
metadata= []
425415
metadata=list(metadata)
@@ -504,7 +494,7 @@ def create_group(
504494
)
505495

506496
request=group_service_pb2.CreateGroupRequest(
507-
name=name,group=group,validate_only=validate_only,
497+
name=name,group=group,validate_only=validate_only
508498
)
509499
ifmetadataisNone:
510500
metadata= []
@@ -587,7 +577,7 @@ def update_group(
587577
)
588578

589579
request=group_service_pb2.UpdateGroupRequest(
590-
group=group,validate_only=validate_only,
580+
group=group,validate_only=validate_only
591581
)
592582
ifmetadataisNone:
593583
metadata= []
@@ -662,7 +652,7 @@ def delete_group(
662652
client_info=self._client_info,
663653
)
664654

665-
request=group_service_pb2.DeleteGroupRequest(name=name,recursive=recursive,)
655+
request=group_service_pb2.DeleteGroupRequest(name=name,recursive=recursive)
666656
ifmetadataisNone:
667657
metadata= []
668658
metadata=list(metadata)
@@ -776,7 +766,7 @@ def list_group_members(
776766
)
777767

778768
request=group_service_pb2.ListGroupMembersRequest(
779-
name=name,page_size=page_size,filter=filter_,interval=interval,
769+
name=name,page_size=page_size,filter=filter_,interval=interval
780770
)
781771
ifmetadataisNone:
782772
metadata= []

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp