@@ -29,7 +29,12 @@ def create_namespace(project_id, location_id, namespace_id):
2929 response = client .create_namespace (
3030 parent = 'projects/{0}/locations/{1}' .format (project_id , location_id ),
3131 namespace = namespace ,
32- namespace_id = namespace_id )
32+ namespace_id = namespace_id ,
33+ metadata = [[
34+ 'x-goog-request-params' ,
35+ 'name=projects/{0}/locations/{1}/namespaces/{2}' .format (
36+ project_id , location_id , namespace_id )
37+ ]])
3338
3439 print ('Created namespace {0}.' .format (response .name ))
3540
@@ -44,7 +49,13 @@ def delete_namespace(project_id, location_id, namespace_id):
4449 namespace_name = 'projects/{0}/locations/{1}/namespaces/{2}' .format (
4550 project_id , location_id , namespace_id )
4651
47- client .delete_namespace (name = namespace_name )
52+ client .delete_namespace (
53+ name = namespace_name ,
54+ metadata = [[
55+ 'x-goog-request-params' ,
56+ 'name=projects/{0}/locations/{1}/namespaces/{2}' .format (
57+ project_id , location_id , namespace_id )
58+ ]])
4859
4960 print ('Deleted namespace {0}.' .format (namespace_name ))
5061
@@ -62,7 +73,12 @@ def create_service(project_id, location_id, namespace_id, service_id):
6273 parent = 'projects/{0}/locations/{1}/namespaces/{2}' .format (
6374 project_id , location_id , namespace_id ),
6475 service = service ,
65- service_id = service_id )
76+ service_id = service_id ,
77+ metadata = [[
78+ 'x-goog-request-params' ,
79+ 'name=projects/{0}/locations/{1}/namespaces/{2}/services/{3}' .format (
80+ project_id , location_id , namespace_id , service_id )
81+ ]])
6682
6783 print ('Created service {0}.' .format (response .name ))
6884
@@ -77,7 +93,13 @@ def delete_service(project_id, location_id, namespace_id, service_id):
7793 service_name = 'projects/{0}/locations/{1}/namespaces/{2}/services/{3}' .format (
7894 project_id , location_id , namespace_id , service_id )
7995
80- client .delete_service (name = service_name )
96+ client .delete_service (
97+ name = service_name ,
98+ metadata = [[
99+ 'x-goog-request-params' ,
100+ 'name=projects/{0}/locations/{1}/namespaces/{2}/services/{3}' .format (
101+ project_id , location_id , namespace_id , service_id )
102+ ]])
81103
82104 print ('Deleted service {0}.' .format (service_name ))
83105
@@ -91,7 +113,13 @@ def resolve_service(project_id, location_id, namespace_id, service_id):
91113 name = 'projects/{0}/locations/{1}/namespaces/{2}/services/{3}' .format (
92114 project_id , location_id , namespace_id , service_id ))
93115
94- response = client .resolve_service (request = request )
116+ response = client .resolve_service (
117+ request = request ,
118+ metadata = [[
119+ 'x-goog-request-params' ,
120+ 'name=projects/{0}/locations/{1}/namespaces/{2}/services/{3}' .format (
121+ project_id , location_id , namespace_id , service_id )
122+ ]])
95123
96124 print ('Endpoints found:' )
97125 for endpoint in response .service .endpoints :
@@ -117,7 +145,13 @@ def create_endpoint(project_id, location_id, namespace_id, service_id,
117145 parent = 'projects/{0}/locations/{1}/namespaces/{2}/services/{3}' .format (
118146 project_id , location_id , namespace_id , service_id ),
119147 endpoint = endpoint ,
120- endpoint_id = endpoint_id )
148+ endpoint_id = endpoint_id ,
149+ metadata = [[
150+ 'x-goog-request-params' ,
151+ 'name=projects/{0}/locations/{1}/namespaces/{2}/services/{3}/endpoints/{4}'
152+ .format (project_id , location_id , namespace_id , service_id ,
153+ endpoint_id )
154+ ]])
121155
122156 print ('Created endpoint {0}.' .format (response .name ))
123157
@@ -133,6 +167,13 @@ def delete_endpoint(project_id, location_id, namespace_id, service_id,
133167 endpoint_name = 'projects/{0}/locations/{1}/namespaces/{2}/services/{3}/endpoints/{4}' .format (
134168 project_id , location_id , namespace_id , service_id , endpoint_id )
135169
136- client .delete_endpoint (name = endpoint_name )
170+ client .delete_endpoint (
171+ name = endpoint_name ,
172+ metadata = [[
173+ 'x-goog-request-params' ,
174+ 'name=projects/{0}/locations/{1}/namespaces/{2}/services/{3}/endpoints/{4}'
175+ .format (project_id , location_id , namespace_id , service_id ,
176+ endpoint_id )
177+ ]])
137178
138179 print ('Deleted endpoint {0}.' .format (endpoint_name ))
0 commit comments