@@ -307,13 +307,17 @@ def delete_certificate(
307307
308308 @record_metrics (Module .DESTINATION , Operation .CERTIFICATE_GET_LABELS )
309309 def get_certificate_labels (
310- self , name : str , level : Optional [Level ] = Level .SUB_ACCOUNT
310+ self ,
311+ name : str ,
312+ level : Optional [Level ] = Level .SUB_ACCOUNT ,
313+ tenant : Optional [str ] = None ,
311314 ) -> List [Label ]:
312315 """Get labels for a certificate.
313316
314317 Args:
315318 name: Certificate name.
316319 level: Scope to query (subaccount by default).
320+ tenant: Optional subscriber tenant subdomain. If provided, the request is scoped to that tenant.
317321
318322 Returns:
319323 List of labels assigned to the certificate. Returns empty list if none assigned.
@@ -323,7 +327,9 @@ def get_certificate_labels(
323327 """
324328 try :
325329 path = self ._sub_path_for_level (level )
326- resp = self ._http .get (f"{ API_V1 } /{ path } /{ name } /labels" )
330+ resp = self ._http .get (
331+ f"{ API_V1 } /{ path } /{ name } /labels" , tenant_subdomain = tenant
332+ )
327333 data = resp .json ()
328334 if not isinstance (data , list ):
329335 raise DestinationOperationError (
@@ -341,14 +347,19 @@ def get_certificate_labels(
341347
342348 @record_metrics (Module .DESTINATION , Operation .CERTIFICATE_UPDATE_LABELS )
343349 def update_certificate_labels (
344- self , name : str , labels : List [Label ], level : Optional [Level ] = Level .SUB_ACCOUNT
350+ self ,
351+ name : str ,
352+ labels : List [Label ],
353+ level : Optional [Level ] = Level .SUB_ACCOUNT ,
354+ tenant : Optional [str ] = None ,
345355 ) -> None :
346356 """Replace all labels for a certificate.
347357
348358 Args:
349359 name: Certificate name.
350360 labels: List of labels to set (replaces existing labels).
351361 level: Scope where the certificate exists (subaccount by default).
362+ tenant: Optional subscriber tenant subdomain. If provided, the request is scoped to that tenant.
352363
353364 Raises:
354365 HttpError: Propagated for HTTP errors.
@@ -360,6 +371,7 @@ def update_certificate_labels(
360371 self ._http .put (
361372 f"{ API_V1 } /{ path } /{ name } /labels" ,
362373 body = [lbl .to_dict () for lbl in labels ],
374+ tenant_subdomain = tenant ,
363375 )
364376 except HttpError :
365377 raise
@@ -370,14 +382,19 @@ def update_certificate_labels(
370382
371383 @record_metrics (Module .DESTINATION , Operation .CERTIFICATE_PATCH_LABELS )
372384 def patch_certificate_labels (
373- self , name : str , patch : PatchLabels , level : Optional [Level ] = Level .SUB_ACCOUNT
385+ self ,
386+ name : str ,
387+ patch : PatchLabels ,
388+ level : Optional [Level ] = Level .SUB_ACCOUNT ,
389+ tenant : Optional [str ] = None ,
374390 ) -> None :
375391 """Add or remove labels for a certificate.
376392
377393 Args:
378394 name: Certificate name.
379395 patch: PatchLabels with action ("ADD" or "DELETE") and labels to apply.
380396 level: Scope where the certificate exists (subaccount by default).
397+ tenant: Optional subscriber tenant subdomain. If provided, the request is scoped to that tenant.
381398
382399 Raises:
383400 HttpError: Propagated for HTTP errors.
@@ -389,6 +406,7 @@ def patch_certificate_labels(
389406 self ._http .patch (
390407 f"{ API_V1 } /{ path } /{ name } /labels" ,
391408 body = patch .to_dict (),
409+ tenant_subdomain = tenant ,
392410 )
393411 except HttpError :
394412 raise
0 commit comments