@@ -240,8 +240,6 @@ def path(self, which=None):
240240
241241 The format of the returned path depends on the value of ``which``:
242242
243- add_subscriptions
244- /activation_keys/<id>/add_subscriptions
245243 copy
246244 /activation_keys/<id>/copy
247245 content_override
@@ -250,23 +248,16 @@ def path(self, which=None):
250248 /activation_keys/<id>/product_content
251249 releases
252250 /activation_keys/<id>/releases
253- remove_subscriptions
254- /activation_keys/<id>/remove_subscriptions
255- subscriptions
256- /activation_keys/<id>/subscriptions
257251
258252 ``super`` is called otherwise.
259253
260254 """
261255 if which in (
262- 'add_subscriptions' ,
263256 'content_override' ,
264257 'copy' ,
265258 'host_collections' ,
266259 'product_content' ,
267260 'releases' ,
268- 'remove_subscriptions' ,
269- 'subscriptions' ,
270261 ):
271262 return f'{ super ().path (which = "self" )} /{ which } '
272263 return super ().path (which )
@@ -297,25 +288,6 @@ def add_host_collection(self, synchronous=True, timeout=None, **kwargs):
297288 response = client .post (self .path ('host_collections' ), ** kwargs )
298289 return _handle_response (response , self ._server_config , synchronous , timeout )
299290
300- def add_subscriptions (self , synchronous = True , timeout = None , ** kwargs ):
301- """Add subscriptions to activation key.
302-
303- :param synchronous: What should happen if the server returns an HTTP
304- 202 (accepted) status code? Wait for the task to complete if
305- ``True``. Immediately return the server's response otherwise.
306- :param timeout: Maximum number of seconds to wait until timing out.
307- Defaults to ``nailgun.entity_mixins.TASK_TIMEOUT``.
308- :param kwargs: Arguments to pass to requests.
309- :returns: The server's response, with all JSON decoded.
310- :raises: ``requests.exceptions.HTTPError`` If the server responds with
311- an HTTP 4XX or 5XX message.
312-
313- """
314- kwargs = kwargs .copy () # shadow the passed-in kwargs
315- kwargs .update (self ._server_config .get_client_kwargs ())
316- response = client .put (self .path ('add_subscriptions' ), ** kwargs )
317- return _handle_response (response , self ._server_config , synchronous , timeout )
318-
319291 def copy (self , synchronous = True , timeout = None , ** kwargs ):
320292 """Copy provided activation key.
321293
@@ -337,44 +309,6 @@ def copy(self, synchronous=True, timeout=None, **kwargs):
337309 response = client .post (self .path ('copy' ), ** kwargs )
338310 return _handle_response (response , self ._server_config , synchronous , timeout )
339311
340- def remove_subscriptions (self , synchronous = True , timeout = None , ** kwargs ):
341- """Remove subscriptions from an activation key.
342-
343- :param synchronous: What should happen if the server returns an HTTP
344- 202 (accepted) status code? Wait for the task to complete if
345- ``True``. Immediately return the server's response otherwise.
346- :param timeout: Maximum number of seconds to wait until timing out.
347- Defaults to ``nailgun.entity_mixins.TASK_TIMEOUT``.
348- :param kwargs: Arguments to pass to requests.
349- :returns: The server's response, with all JSON decoded.
350- :raises: ``requests.exceptions.HTTPError`` If the server responds with
351- an HTTP 4XX or 5XX message.
352-
353- """
354- kwargs = kwargs .copy () # shadow the passed-in kwargs
355- kwargs .update (self ._server_config .get_client_kwargs ())
356- response = client .put (self .path ('remove_subscriptions' ), ** kwargs )
357- return _handle_response (response , self ._server_config , synchronous , timeout )
358-
359- def subscriptions (self , synchronous = True , timeout = None , ** kwargs ):
360- """Retrieve subscriptions on an activation key.
361-
362- :param synchronous: What should happen if the server returns an HTTP
363- 202 (accepted) status code? Wait for the task to complete if
364- ``True``. Immediately return the server's response otherwise.
365- :param timeout: Maximum number of seconds to wait until timing out.
366- Defaults to ``nailgun.entity_mixins.TASK_TIMEOUT``.
367- :param kwargs: Arguments to pass to requests.
368- :returns: The server's response, with all JSON decoded.
369- :raises: ``requests.exceptions.HTTPError`` If the server responds with
370- an HTTP 4XX or 5XX message.
371-
372- """
373- kwargs = kwargs .copy () # shadow the passed-in kwargs
374- kwargs .update (self ._server_config .get_client_kwargs ())
375- response = client .get (self .path ('subscriptions' ), ** kwargs )
376- return _handle_response (response , self ._server_config , synchronous , timeout )
377-
378312 def content_override (self , synchronous = True , timeout = None , ** kwargs ):
379313 """Override the content of an activation key.
380314
@@ -4306,97 +4240,6 @@ def __init__(self, server_config=None, **kwargs):
43064240 }
43074241
43084242
4309- class HostSubscription (Entity ):
4310- """A representation of a Host Subscription entity."""
4311-
4312- def __init__ (self , server_config = None , ** kwargs ):
4313- _check_for_value ('host' , kwargs )
4314- self ._fields = {
4315- 'content_label' : entity_fields .StringField (),
4316- 'host' : entity_fields .OneToOneField (Host , required = True ),
4317- 'subscriptions' : entity_fields .DictField (),
4318- 'value' : entity_fields .StringField (),
4319- }
4320- super ().__init__ (server_config = server_config , ** kwargs )
4321- self ._meta = {
4322- 'api_path' : f'{ self .host .path ()} /subscriptions' ,
4323- }
4324-
4325- def path (self , which = None ):
4326- """Extend ``nailgun.entity_mixins.Entity.path``.
4327-
4328- The format of the returned path depends on the value of ``which``:
4329-
4330- add_subscriptions
4331- /hosts/<id>/add_subscriptions
4332- remove_subscriptions
4333- /hosts/<id>/remove_subscriptions
4334-
4335- ``super`` is called otherwise.
4336-
4337- """
4338- if which in ('add_subscriptions' , 'remove_subscriptions' ):
4339- return f'{ super ().path (which = "base" )} /{ which } '
4340- return super ().path (which )
4341-
4342- def subscriptions (self , synchronous = True , timeout = None , ** kwargs ):
4343- """Get subscriptions from host.
4344-
4345- :param synchronous: What should happen if the server returns an HTTP
4346- 202 (accepted) status code? Wait for the task to complete if
4347- ``True``. Immediately return the server's response otherwise.
4348- :param timeout: Maximum number of seconds to wait until timing out.
4349- Defaults to ``nailgun.entity_mixins.TASK_TIMEOUT``.
4350- :param kwargs: Arguments to pass to requests.
4351- :returns: The server's response, with all JSON decoded.
4352- :raises: ``requests.exceptions.HTTPError`` If the server responds with
4353- an HTTP 4XX or 5XX message.
4354-
4355- """
4356- kwargs = kwargs .copy () # shadow the passed-in kwargs
4357- kwargs .update (self ._server_config .get_client_kwargs ())
4358- response = client .get (self .path ('base' ), ** kwargs )
4359- return _handle_response (response , self ._server_config , synchronous , timeout )
4360-
4361- def add_subscriptions (self , synchronous = True , timeout = None , ** kwargs ):
4362- """Add subscriptions to host.
4363-
4364- :param synchronous: What should happen if the server returns an HTTP
4365- 202 (accepted) status code? Wait for the task to complete if
4366- ``True``. Immediately return the server's response otherwise.
4367- :param timeout: Maximum number of seconds to wait until timing out.
4368- Defaults to ``nailgun.entity_mixins.TASK_TIMEOUT``.
4369- :param kwargs: Arguments to pass to requests.
4370- :returns: The server's response, with all JSON decoded.
4371- :raises: ``requests.exceptions.HTTPError`` If the server responds with
4372- an HTTP 4XX or 5XX message.
4373-
4374- """
4375- kwargs = kwargs .copy () # shadow the passed-in kwargs
4376- kwargs .update (self ._server_config .get_client_kwargs ())
4377- response = client .put (self .path ('add_subscriptions' ), ** kwargs )
4378- return _handle_response (response , self ._server_config , synchronous , timeout )
4379-
4380- def remove_subscriptions (self , synchronous = True , timeout = None , ** kwargs ):
4381- """Remove subscriptions from host.
4382-
4383- :param synchronous: What should happen if the server returns an HTTP
4384- 202 (accepted) status code? Wait for the task to complete if
4385- ``True``. Immediately return the server's response otherwise.
4386- :param timeout: Maximum number of seconds to wait until timing out.
4387- Defaults to ``nailgun.entity_mixins.TASK_TIMEOUT``.
4388- :param kwargs: Arguments to pass to requests.
4389- :returns: The server's response, with all JSON decoded.
4390- :raises: ``requests.exceptions.HTTPError`` If the server responds with
4391- an HTTP 4XX or 5XX message.
4392-
4393- """
4394- kwargs = kwargs .copy () # shadow the passed-in kwargs
4395- kwargs .update (self ._server_config .get_client_kwargs ())
4396- response = client .put (self .path ('remove_subscriptions' ), ** kwargs )
4397- return _handle_response (response , self ._server_config , synchronous , timeout )
4398-
4399-
44004243class Host (
44014244 Entity ,
44024245 EntityCreateMixin ,
@@ -4864,44 +4707,6 @@ def errata_applicability(self, synchronous=True, timeout=None, **kwargs):
48644707 response = client .put (self .path ('errata/applicability' ), ** kwargs )
48654708 return _handle_response (response , self ._server_config , synchronous , timeout )
48664709
4867- def bulk_add_subscriptions (self , synchronous = True , timeout = None , ** kwargs ):
4868- """Add subscriptions to one or more hosts.
4869-
4870- :param synchronous: What should happen if the server returns an HTTP
4871- 202 (accepted) status code? Wait for the task to complete if
4872- ``True``. Immediately return the server's response otherwise.
4873- :param timeout: Maximum number of seconds to wait until timing out.
4874- Defaults to ``nailgun.entity_mixins.TASK_TIMEOUT``.
4875- :param kwargs: Arguments to pass to requests.
4876- :returns: The server's response, with all content decoded.
4877- :raises: ``requests.exceptions.HTTPError`` If the server responds with
4878- an HTTP 4XX or 5XX message.
4879-
4880- """
4881- kwargs = kwargs .copy () # shadow the passed-in kwargs
4882- kwargs .update (self ._server_config .get_client_kwargs ())
4883- response = client .put (self .path ('bulk/add_subscriptions' ), ** kwargs )
4884- return _handle_response (response , self ._server_config , synchronous , timeout )
4885-
4886- def bulk_remove_subscriptions (self , synchronous = True , timeout = None , ** kwargs ):
4887- """Remove subscriptions from one or more hosts.
4888-
4889- :param synchronous: What should happen if the server returns an HTTP
4890- 202 (accepted) status code? Wait for the task to complete if
4891- ``True``. Immediately return the server's response otherwise.
4892- :param timeout: Maximum number of seconds to wait until timing out.
4893- Defaults to ``nailgun.entity_mixins.TASK_TIMEOUT``.
4894- :param kwargs: Arguments to pass to requests.
4895- :returns: The server's response, with all content decoded.
4896- :raises: ``requests.exceptions.HTTPError`` If the server responds with
4897- an HTTP 4XX or 5XX message.
4898-
4899- """
4900- kwargs = kwargs .copy () # shadow the passed-in kwargs
4901- kwargs .update (self ._server_config .get_client_kwargs ())
4902- response = client .put (self .path ('bulk/remove_subscriptions' ), ** kwargs )
4903- return _handle_response (response , self ._server_config , synchronous , timeout )
4904-
49054710 def bulk_available_incremental_updates (self , synchronous = True , timeout = None , ** kwargs ):
49064711 """Get available_incremental_updates for one or more hosts.
49074712
@@ -5119,8 +4924,6 @@ def path(self, which=None):
51194924 return f'{ super ().path (which = "self" )} /{ which } '
51204925 elif which in (
51214926 'bootc_images' ,
5122- 'bulk/add_subscriptions' ,
5123- 'bulk/remove_subscriptions' ,
51244927 'bulk/available_incremental_updates' ,
51254928 'bulk/traces' ,
51264929 'bulk/resolve_traces' ,
0 commit comments