@@ -29,7 +29,12 @@ def create_namespace(project_id, location_id, namespace_id):
29
29
response = client .create_namespace (
30
30
parent = 'projects/{0}/locations/{1}' .format (project_id , location_id ),
31
31
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
+ ]])
33
38
34
39
print ('Created namespace {0}.' .format (response .name ))
35
40
@@ -44,7 +49,13 @@ def delete_namespace(project_id, location_id, namespace_id):
44
49
namespace_name = 'projects/{0}/locations/{1}/namespaces/{2}' .format (
45
50
project_id , location_id , namespace_id )
46
51
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
+ ]])
48
59
49
60
print ('Deleted namespace {0}.' .format (namespace_name ))
50
61
@@ -62,7 +73,12 @@ def create_service(project_id, location_id, namespace_id, service_id):
62
73
parent = 'projects/{0}/locations/{1}/namespaces/{2}' .format (
63
74
project_id , location_id , namespace_id ),
64
75
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
+ ]])
66
82
67
83
print ('Created service {0}.' .format (response .name ))
68
84
@@ -77,7 +93,13 @@ def delete_service(project_id, location_id, namespace_id, service_id):
77
93
service_name = 'projects/{0}/locations/{1}/namespaces/{2}/services/{3}' .format (
78
94
project_id , location_id , namespace_id , service_id )
79
95
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
+ ]])
81
103
82
104
print ('Deleted service {0}.' .format (service_name ))
83
105
@@ -91,7 +113,13 @@ def resolve_service(project_id, location_id, namespace_id, service_id):
91
113
name = 'projects/{0}/locations/{1}/namespaces/{2}/services/{3}' .format (
92
114
project_id , location_id , namespace_id , service_id ))
93
115
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
+ ]])
95
123
96
124
print ('Endpoints found:' )
97
125
for endpoint in response .service .endpoints :
@@ -117,7 +145,13 @@ def create_endpoint(project_id, location_id, namespace_id, service_id,
117
145
parent = 'projects/{0}/locations/{1}/namespaces/{2}/services/{3}' .format (
118
146
project_id , location_id , namespace_id , service_id ),
119
147
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
+ ]])
121
155
122
156
print ('Created endpoint {0}.' .format (response .name ))
123
157
@@ -133,6 +167,13 @@ def delete_endpoint(project_id, location_id, namespace_id, service_id,
133
167
endpoint_name = 'projects/{0}/locations/{1}/namespaces/{2}/services/{3}/endpoints/{4}' .format (
134
168
project_id , location_id , namespace_id , service_id , endpoint_id )
135
169
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
+ ]])
137
178
138
179
print ('Deleted endpoint {0}.' .format (endpoint_name ))
0 commit comments