- Notifications
You must be signed in to change notification settings - Fork95
Closed
Description
python-api-core/google/api_core/path_template.py
Lines 319 to 322 infe617c2
| raiseValueError( | |
| "Request {} does not match any URL path template in available HttpRule's {}".format( | |
| request_kwargs, [opt["uri"]foroptinhttp_options] | |
| ) |
The transcoding error above should be improved to provide more helpful information when there is a transcoding issue. For example, given the code below which is missing theinstance_group parameter, the error message should say something along the lines ofmissing required parameter instance_group instead of the cryptic errorRequest {} does not match any URL path template in available HttpRule's ['/compute/v1/projects/{project}/zones/{zone}/instanceGroups/{instance_group}/listInstances']. In addition, it's not desirable to echo the parameters in the error message.
from google.cloud import compute_v1project = "project-XXX"zone = "us-central1-a"instance_groups_list_instances_request_resource = compute_v1.InstanceGroupsListInstancesRequest()instance_groups_list_instances_request_resource.instance_state = "RUNNING"instance_groups_client = compute_v1.InstanceGroupsClient()instance_groups_list = instance_groups_client.list_instances(project=project, zone=zone, instance_groups_list_instances_request_resource=instance_groups_list_instances_request_resource)for instance in instance_groups_list: print(instance.name, instance.labels)