@@ -120,10 +120,17 @@ def list_monitored_resources():
120
120
# [END list_monitored_resources]
121
121
122
122
123
- def get_monitored_resource_descriptor (type ):
123
+ def get_monitored_resource_descriptor (type_ ):
124
124
# [START get_monitored_resources]
125
125
client = monitoring .Client ()
126
- print (client .fetch_resource_descriptor (type ))
126
+ print (client .fetch_resource_descriptor (type_ ))
127
+ # [END get_monitored_resources]
128
+
129
+
130
+ def get_metric_descriptor (type_ ):
131
+ # [START get_monitored_resources]
132
+ client = monitoring .Client ()
133
+ print (client .fetch_metric_descriptor (type_ ))
127
134
# [END get_monitored_resources]
128
135
129
136
@@ -143,6 +150,17 @@ def get_monitored_resource_descriptor(type):
143
150
help = list_metric_descriptors .__doc__
144
151
)
145
152
153
+ get_metric_descriptor_parser = subparsers .add_parser (
154
+ 'get-metric-descriptor' ,
155
+ help = get_metric_descriptor .__doc__
156
+ )
157
+
158
+ get_metric_descriptor_parser .add_argument (
159
+ '--metric' ,
160
+ help = 'The metric type of the metric descriptor to see details about.' ,
161
+ required = True
162
+ )
163
+
146
164
delete_metric_descriptor_parser = subparsers .add_parser (
147
165
'delete-metric-descriptor' ,
148
166
help = list_metric_descriptors .__doc__
@@ -201,6 +219,8 @@ def get_monitored_resource_descriptor(type):
201
219
create_metric_descriptor ()
202
220
if args .command == 'list-metric-descriptors' :
203
221
list_metric_descriptors ()
222
+ if args .command == 'get-metric-descriptor' :
223
+ get_metric_descriptor (args .metric )
204
224
if args .command == 'delete-metric-descriptor' :
205
225
delete_metric_descriptor (args .metric )
206
226
if args .command == 'list-resources' :
0 commit comments