@@ -142,6 +142,12 @@ def create(
142
142
map_services_to_gateway = None ,
143
143
specified_namespace_name = None ,
144
144
adopt_existing_namespace = None ,
145
+ quota_memory = None ,
146
+ quota_persistent = None ,
147
+ quota_gpus = None ,
148
+ quota_cores = None ,
149
+ quota_disk = None ,
150
+ quota_tenant_storage = None ,
145
151
):
146
152
147
153
assert (
@@ -185,6 +191,29 @@ def create(
185
191
if data ["tenant_type_info" ] == {}:
186
192
data .pop ("tenant_type_info" , None )
187
193
194
+ if (
195
+ quota_memory is not None
196
+ or quota_persistent is not None
197
+ or quota_gpus is not None
198
+ or quota_cores is not None
199
+ or quota_disk is not None
200
+ or quota_tenant_storage is not None
201
+ ):
202
+ data ["quota" ] = {}
203
+
204
+ if quota_memory is not None :
205
+ data ["quota" ]["quota_memory" ] = quota_memory
206
+ if quota_persistent is not None :
207
+ data ["quota" ]["quota_persistent" ] = quota_persistent
208
+ if quota_gpus is not None :
209
+ data ["quota" ]["quota_gpus" ] = quota_gpus
210
+ if quota_cores is not None :
211
+ data ["quota" ]["quota_cores" ] = quota_cores
212
+ if quota_disk is not None :
213
+ data ["quota" ]["quota_disk" ] = quota_disk
214
+ if quota_tenant_storage is not None :
215
+ data ["quota" ]["quota_tenant_storage" ] = quota_tenant_storage
216
+
188
217
response = self .client ._request (
189
218
url = "/api/v1/tenant" ,
190
219
http_method = "post" ,
0 commit comments