index
int64
0
731k
package
stringlengths
2
98
name
stringlengths
1
76
docstring
stringlengths
0
281k
code
stringlengths
4
1.07M
signature
stringlengths
2
42.8k
719,031
aiortc.rtcsctptransport
_t1_expired
null
def _t1_expired(self) -> None: self._t1_failures += 1 self._t1_handle = None self.__log_debug( "x T1(%s) expired %d", chunk_type(self._t1_chunk), self._t1_failures ) if self._t1_failures > SCTP_MAX_INIT_RETRANS: self._set_state(self.State.CLOSED) else: asyncio.ensure_future(self._send_chunk(self._t1_chunk)) self._t1_handle = self._loop.call_later(self._rto, self._t1_expired)
(self) -> NoneType
719,032
aiortc.rtcsctptransport
_t1_start
null
def _t1_start(self, chunk: Chunk) -> None: assert self._t1_handle is None self._t1_chunk = chunk self._t1_failures = 0 self.__log_debug("- T1(%s) start", chunk_type(self._t1_chunk)) self._t1_handle = self._loop.call_later(self._rto, self._t1_expired)
(self, chunk: aiortc.rtcsctptransport.Chunk) -> NoneType
719,033
aiortc.rtcsctptransport
_t2_cancel
null
def _t2_cancel(self) -> None: if self._t2_handle is not None: self.__log_debug("- T2(%s) cancel", chunk_type(self._t2_chunk)) self._t2_handle.cancel() self._t2_handle = None self._t2_chunk = None
(self) -> NoneType
719,034
aiortc.rtcsctptransport
_t2_expired
null
def _t2_expired(self) -> None: self._t2_failures += 1 self._t2_handle = None self.__log_debug( "x T2(%s) expired %d", chunk_type(self._t2_chunk), self._t2_failures ) if self._t2_failures > SCTP_MAX_ASSOCIATION_RETRANS: self._set_state(self.State.CLOSED) else: asyncio.ensure_future(self._send_chunk(self._t2_chunk)) self._t2_handle = self._loop.call_later(self._rto, self._t2_expired)
(self) -> NoneType
719,035
aiortc.rtcsctptransport
_t2_start
null
def _t2_start(self, chunk) -> None: assert self._t2_handle is None self._t2_chunk = chunk self._t2_failures = 0 self.__log_debug("- T2(%s) start", chunk_type(self._t2_chunk)) self._t2_handle = self._loop.call_later(self._rto, self._t2_expired)
(self, chunk) -> NoneType
719,036
aiortc.rtcsctptransport
_t3_cancel
null
def _t3_cancel(self) -> None: if self._t3_handle is not None: self.__log_debug("- T3 cancel") self._t3_handle.cancel() self._t3_handle = None
(self) -> NoneType
719,037
aiortc.rtcsctptransport
_t3_expired
null
@no_type_check def _t3_expired(self) -> None: self._t3_handle = None self.__log_debug("x T3 expired") # mark retransmit or abandoned chunks for chunk in self._sent_queue: if not self._maybe_abandon(chunk): chunk._retransmit = True self._update_advanced_peer_ack_point() # adjust congestion window self._fast_recovery_exit = None self._flight_size = 0 self._partial_bytes_acked = 0 self._ssthresh = max(self._cwnd // 2, 4 * USERDATA_MAX_LENGTH) self._cwnd = USERDATA_MAX_LENGTH asyncio.ensure_future(self._transmit())
(self) -> None
719,038
aiortc.rtcsctptransport
_t3_restart
null
def _t3_restart(self) -> None: self.__log_debug("- T3 restart") if self._t3_handle is not None: self._t3_handle.cancel() self._t3_handle = None self._t3_handle = self._loop.call_later(self._rto, self._t3_expired)
(self) -> NoneType
719,039
aiortc.rtcsctptransport
_t3_start
null
def _t3_start(self) -> None: assert self._t3_handle is None self.__log_debug("- T3 start") self._t3_handle = self._loop.call_later(self._rto, self._t3_expired)
(self) -> NoneType
719,040
aiortc.rtcsctptransport
_transmit
Transmit outbound data.
@no_type_check async def _transmit(self) -> None: """ Transmit outbound data. """ # send FORWARD TSN if self._forward_tsn_chunk is not None: await self._send_chunk(self._forward_tsn_chunk) self._forward_tsn_chunk = None # ensure T3 is running if not self._t3_handle: self._t3_start() # limit burst size if self._fast_recovery_exit is not None: burst_size = 2 * USERDATA_MAX_LENGTH else: burst_size = 4 * USERDATA_MAX_LENGTH cwnd = min(self._flight_size + burst_size, self._cwnd) # retransmit retransmit_earliest = True for chunk in self._sent_queue: if chunk._retransmit: if self._fast_recovery_transmit: self._fast_recovery_transmit = False elif self._flight_size >= cwnd: return self._flight_size_increase(chunk) chunk._misses = 0 chunk._retransmit = False chunk._sent_count += 1 await self._send_chunk(chunk) if retransmit_earliest: # restart the T3 timer as the earliest outstanding TSN # is being retransmitted self._t3_restart() retransmit_earliest = False while self._outbound_queue and self._flight_size < cwnd: chunk = self._outbound_queue.popleft() self._sent_queue.append(chunk) self._flight_size_increase(chunk) # update counters chunk._sent_count += 1 chunk._sent_time = time.time() await self._send_chunk(chunk) if not self._t3_handle: self._t3_start()
(self) -> None
719,041
aiortc.rtcsctptransport
_transmit_reconfig
null
@no_type_check async def _transmit(self) -> None: """ Transmit outbound data. """ # send FORWARD TSN if self._forward_tsn_chunk is not None: await self._send_chunk(self._forward_tsn_chunk) self._forward_tsn_chunk = None # ensure T3 is running if not self._t3_handle: self._t3_start() # limit burst size if self._fast_recovery_exit is not None: burst_size = 2 * USERDATA_MAX_LENGTH else: burst_size = 4 * USERDATA_MAX_LENGTH cwnd = min(self._flight_size + burst_size, self._cwnd) # retransmit retransmit_earliest = True for chunk in self._sent_queue: if chunk._retransmit: if self._fast_recovery_transmit: self._fast_recovery_transmit = False elif self._flight_size >= cwnd: return self._flight_size_increase(chunk) chunk._misses = 0 chunk._retransmit = False chunk._sent_count += 1 await self._send_chunk(chunk) if retransmit_earliest: # restart the T3 timer as the earliest outstanding TSN # is being retransmitted self._t3_restart() retransmit_earliest = False while self._outbound_queue and self._flight_size < cwnd: chunk = self._outbound_queue.popleft() self._sent_queue.append(chunk) self._flight_size_increase(chunk) # update counters chunk._sent_count += 1 chunk._sent_time = time.time() await self._send_chunk(chunk) if not self._t3_handle: self._t3_start()
(self)
719,042
aiortc.rtcsctptransport
_update_advanced_peer_ack_point
Try to advance "Advanced.Peer.Ack.Point" according to RFC 3758.
@no_type_check def _update_advanced_peer_ack_point(self) -> None: """ Try to advance "Advanced.Peer.Ack.Point" according to RFC 3758. """ if uint32_gt(self._last_sacked_tsn, self._advanced_peer_ack_tsn): self._advanced_peer_ack_tsn = self._last_sacked_tsn done = 0 streams = {} while self._sent_queue and self._sent_queue[0]._abandoned: chunk = self._sent_queue.popleft() self._advanced_peer_ack_tsn = chunk.tsn done += 1 if not (chunk.flags & SCTP_DATA_UNORDERED): streams[chunk.stream_id] = chunk.stream_seq if done: # build FORWARD TSN self._forward_tsn_chunk = ForwardTsnChunk() self._forward_tsn_chunk.cumulative_tsn = self._advanced_peer_ack_tsn self._forward_tsn_chunk.streams = list(streams.items())
(self) -> None
719,043
aiortc.rtcsctptransport
_update_rto
Update RTO given a new roundtrip measurement R.
def _update_rto(self, R: float) -> None: """ Update RTO given a new roundtrip measurement R. """ if self._srtt is None: self._rttvar = R / 2 self._srtt = R else: self._rttvar = (1 - SCTP_RTO_BETA) * self._rttvar + SCTP_RTO_BETA * abs( self._srtt - R ) self._srtt = (1 - SCTP_RTO_ALPHA) * self._srtt + SCTP_RTO_ALPHA * R self._rto = max(SCTP_RTO_MIN, min(self._srtt + 4 * self._rttvar, SCTP_RTO_MAX))
(self, R: float) -> NoneType
719,054
aiortc.rtcsctptransport
start
Start the transport.
def setTransport(self, transport) -> None: self.__transport = transport
(self, remoteCaps: aiortc.rtcsctptransport.RTCSctpCapabilities, remotePort: int) -> NoneType
719,055
aiortc.rtcsctptransport
stop
Stop the transport.
self.__log_debug = lambda msg, *args: logger.debug(prefix + msg, *args)
(self) -> NoneType
719,056
aiortc.rtcsessiondescription
RTCSessionDescription
The :class:`RTCSessionDescription` dictionary describes one end of a connection and how it's configured.
class RTCSessionDescription: """ The :class:`RTCSessionDescription` dictionary describes one end of a connection and how it's configured. """ sdp: str type: str def __post_init__(self): if self.type not in {"offer", "pranswer", "answer", "rollback"}: raise ValueError( "'type' must be in ['offer', 'pranswer', 'answer', 'rollback'] " f"(got '{self.type}')" )
(sdp: str, type: str) -> None
719,057
aiortc.rtcsessiondescription
__eq__
null
from dataclasses import dataclass @dataclass class RTCSessionDescription: """ The :class:`RTCSessionDescription` dictionary describes one end of a connection and how it's configured. """ sdp: str type: str def __post_init__(self): if self.type not in {"offer", "pranswer", "answer", "rollback"}: raise ValueError( "'type' must be in ['offer', 'pranswer', 'answer', 'rollback'] " f"(got '{self.type}')" )
(self, other)
719,059
aiortc.rtcsessiondescription
__post_init__
null
def __post_init__(self): if self.type not in {"offer", "pranswer", "answer", "rollback"}: raise ValueError( "'type' must be in ['offer', 'pranswer', 'answer', 'rollback'] " f"(got '{self.type}')" )
(self)
719,061
aiortc.stats
RTCStatsReport
Provides statistics data about WebRTC connections as returned by the :meth:`RTCPeerConnection.getStats()`, :meth:`RTCRtpReceiver.getStats()` and :meth:`RTCRtpSender.getStats()` coroutines. This object consists of a mapping of string identifiers to objects which are instances of: - :class:`RTCInboundRtpStreamStats` - :class:`RTCOutboundRtpStreamStats` - :class:`RTCRemoteInboundRtpStreamStats` - :class:`RTCRemoteOutboundRtpStreamStats` - :class:`RTCTransportStats`
class RTCStatsReport(dict): """ Provides statistics data about WebRTC connections as returned by the :meth:`RTCPeerConnection.getStats()`, :meth:`RTCRtpReceiver.getStats()` and :meth:`RTCRtpSender.getStats()` coroutines. This object consists of a mapping of string identifiers to objects which are instances of: - :class:`RTCInboundRtpStreamStats` - :class:`RTCOutboundRtpStreamStats` - :class:`RTCRemoteInboundRtpStreamStats` - :class:`RTCRemoteOutboundRtpStreamStats` - :class:`RTCTransportStats` """ def add(self, stats: RTCStats) -> None: self[stats.id] = stats
null
719,062
aiortc.stats
add
null
def add(self, stats: RTCStats) -> None: self[stats.id] = stats
(self, stats: aiortc.stats.RTCStats) -> NoneType
719,063
aiortc.stats
RTCTransportStats
RTCTransportStats(timestamp: datetime.datetime, type: str, id: str, packetsSent: int, packetsReceived: int, bytesSent: int, bytesReceived: int, iceRole: str, dtlsState: str)
class RTCTransportStats(RTCStats): packetsSent: int "Total number of packets sent over this transport." packetsReceived: int "Total number of packets received over this transport." bytesSent: int "Total number of bytes sent over this transport." bytesReceived: int "Total number of bytes received over this transport." iceRole: str "The current value of :attr:`RTCIceTransport.role`." dtlsState: str "The current value of :attr:`RTCDtlsTransport.state`."
(timestamp: datetime.datetime, type: str, id: str, packetsSent: int, packetsReceived: int, bytesSent: int, bytesReceived: int, iceRole: str, dtlsState: str) -> None
719,067
aiortc.mediastreams
VideoStreamTrack
A dummy video track which reads green frames.
class VideoStreamTrack(MediaStreamTrack): """ A dummy video track which reads green frames. """ kind = "video" _start: float _timestamp: int async def next_timestamp(self) -> Tuple[int, fractions.Fraction]: if self.readyState != "live": raise MediaStreamError if hasattr(self, "_timestamp"): self._timestamp += int(VIDEO_PTIME * VIDEO_CLOCK_RATE) wait = self._start + (self._timestamp / VIDEO_CLOCK_RATE) - time.time() await asyncio.sleep(wait) else: self._start = time.time() self._timestamp = 0 return self._timestamp, VIDEO_TIME_BASE async def recv(self) -> Frame: """ Receive the next :class:`~av.video.frame.VideoFrame`. The base implementation just reads a 640x480 green frame at 30fps, subclass :class:`VideoStreamTrack` to provide a useful implementation. """ pts, time_base = await self.next_timestamp() frame = VideoFrame(width=640, height=480) for p in frame.planes: p.update(bytes(p.buffer_size)) frame.pts = pts frame.time_base = time_base return frame
() -> None
719,084
aiortc.mediastreams
recv
Receive the next :class:`~av.video.frame.VideoFrame`. The base implementation just reads a 640x480 green frame at 30fps, subclass :class:`VideoStreamTrack` to provide a useful implementation.
def stop(self) -> None: if not self.__ended: self.__ended = True self.emit("ended") # no more events will be emitted, so remove all event listeners # to facilitate garbage collection. self.remove_all_listeners()
(self) -> av.frame.Frame
719,117
sigtools._specifiers
forged_signature
Retrieves the full signature of ``obj``, either by taking note of decorators from this module, or by performing automatic signature discovery. If ``auto`` is true, the signature will be automatically refined based on how ``*args`` and ``**kwargs`` are used throughout the function. If ``args`` and/or ``kwargs`` are specified, they are used by automatic signature discovery as arguments passed into the function. This is useful if the function calls something passed in as a parameter. You can use ``emulate=True`` as an argument to the decorators from this module if you wish them to work with `inspect.signature` or its `funcsigs<funcsigs:signature>` backport directly. :: >>> from sigtools import specifiers >>> import inspect >>> def inner(a, b): ... return a + b ... >>> # Relying on automatic discovery >>> def outer(c, *args, **kwargs): ... return c * inner(*args, **kwargs) >>> print(inspect.signature(outer)) (c, *args, **kwargs) >>> print(specifiers.signature(outer, auto=False)) (c, *args, **kwargs) >>> print(specifiers.signature(outer)) (c, a, b) >>> >>> # Using a decorator from this module >>> @specifiers.forwards_to_function(inner) ... def outer(c, *args, **kwargs): ... return c * inner(*args, **kwargs) ... >>> print(inspect.signature(outer)) (c, *args, **kwargs) >>> print(specifiers.signature(outer), auto=False) (c, a, b) >>> print(specifiers.signature(outer)) (c, a, b) >>> >>> # Using the emulate argument for compatibility with inspect >>> @specifiers.forwards_to_function(inner, emulate=True) ... def outer(c, *args, **kwargs): ... return c * inner(*args, **kwargs) >>> print(inspect.signature(outer)) (c, a, b) >>> print(specifiers.signature(outer), auto=False) (c, a, b) >>> print(specifiers.signature(outer)) (c, a, b) :param bool auto: Enable automatic signature discovery. :param sequence args: Positional arguments passed to the function. :param mapping: Named arguments passed to the function. .. seealso: :ref:`autofwd limits`
def forged_signature(obj, auto=True, args=(), kwargs={}): """Retrieves the full signature of ``obj``, either by taking note of decorators from this module, or by performing automatic signature discovery. If ``auto`` is true, the signature will be automatically refined based on how ``*args`` and ``**kwargs`` are used throughout the function. If ``args`` and/or ``kwargs`` are specified, they are used by automatic signature discovery as arguments passed into the function. This is useful if the function calls something passed in as a parameter. You can use ``emulate=True`` as an argument to the decorators from this module if you wish them to work with `inspect.signature` or its `funcsigs<funcsigs:signature>` backport directly. :: >>> from sigtools import specifiers >>> import inspect >>> def inner(a, b): ... return a + b ... >>> # Relying on automatic discovery >>> def outer(c, *args, **kwargs): ... return c * inner(*args, **kwargs) >>> print(inspect.signature(outer)) (c, *args, **kwargs) >>> print(specifiers.signature(outer, auto=False)) (c, *args, **kwargs) >>> print(specifiers.signature(outer)) (c, a, b) >>> >>> # Using a decorator from this module >>> @specifiers.forwards_to_function(inner) ... def outer(c, *args, **kwargs): ... return c * inner(*args, **kwargs) ... >>> print(inspect.signature(outer)) (c, *args, **kwargs) >>> print(specifiers.signature(outer), auto=False) (c, a, b) >>> print(specifiers.signature(outer)) (c, a, b) >>> >>> # Using the emulate argument for compatibility with inspect >>> @specifiers.forwards_to_function(inner, emulate=True) ... def outer(c, *args, **kwargs): ... return c * inner(*args, **kwargs) >>> print(inspect.signature(outer)) (c, a, b) >>> print(specifiers.signature(outer), auto=False) (c, a, b) >>> print(specifiers.signature(outer)) (c, a, b) :param bool auto: Enable automatic signature discovery. :param sequence args: Positional arguments passed to the function. :param mapping: Named arguments passed to the function. .. seealso: :ref:`autofwd limits` """ subject = _util.get_introspectable(obj, af_hint=auto) forger = getattr(subject, '_sigtools__forger', None) if forger is not None: ret = forger(obj=subject) if ret is not None: return _signatures.UpgradedSignature._upgrade_with_warning(ret) if auto: try: subject._sigtools__autoforwards_hint except AttributeError: pass else: h = subject._sigtools__autoforwards_hint(subject) if h is not None: try: ret = _autoforwards.autoforwards_ast( *h, args=args, kwargs=kwargs) except _autoforwards.UnknownForwards: pass else: return _signatures.UpgradedSignature._upgrade_with_warning(ret) subject = _util.get_introspectable(subject, af_hint=False) try: ret = _signatures.UpgradedSignature._upgrade_with_warning( _autoforwards.autoforwards(subject, args, kwargs) ) except _autoforwards.UnknownForwards: pass else: return _signatures.UpgradedSignature._upgrade_with_warning(ret) return _signatures.UpgradedSignature._upgrade_with_warning(_signatures.signature(obj))
(obj, auto=True, args=(), kwargs={})
719,170
property_manager
cached_property
A computed property whose value is computed once and cached, but can be reset. This is a variant of :class:`lazy_property` that has the :attr:`~custom_property.resettable` option enabled by default.
class cached_property(lazy_property): """ A computed property whose value is computed once and cached, but can be reset. This is a variant of :class:`lazy_property` that has the :attr:`~custom_property.resettable` option enabled by default. """ resettable = True
(*args, **options)
719,179
property_manager
clear_property
Clear the assigned or cached value of a property. :param obj: The object that owns the property. :param name: The name of the property (a string). This function directly modifies the :attr:`~object.__dict__` of the given object and as such it avoids any interaction with object properties. This is intentional: :func:`clear_property()` is meant to be used by extensions of the `property-manager` project and by user defined deleter methods.
def clear_property(obj, name): """ Clear the assigned or cached value of a property. :param obj: The object that owns the property. :param name: The name of the property (a string). This function directly modifies the :attr:`~object.__dict__` of the given object and as such it avoids any interaction with object properties. This is intentional: :func:`clear_property()` is meant to be used by extensions of the `property-manager` project and by user defined deleter methods. """ logger.spam("Clearing value of %s property ..", format_property(obj, name)) obj.__dict__.pop(name, None)
(obj, name)
719,183
property_manager
custom_property
Custom :class:`property` subclass that supports additional features. The :class:`custom_property` class implements Python's `descriptor protocol`_ to provide a decorator that turns methods into computed properties with several additional features. .. _descriptor protocol: https://docs.python.org/2/howto/descriptor.html The additional features are controlled by attributes defined on the :class:`custom_property` class. These attributes (documented below) are intended to be changed by the constructor (:func:`__new__()`) and/or classes that inherit from :class:`custom_property`.
class custom_property(property): """ Custom :class:`property` subclass that supports additional features. The :class:`custom_property` class implements Python's `descriptor protocol`_ to provide a decorator that turns methods into computed properties with several additional features. .. _descriptor protocol: https://docs.python.org/2/howto/descriptor.html The additional features are controlled by attributes defined on the :class:`custom_property` class. These attributes (documented below) are intended to be changed by the constructor (:func:`__new__()`) and/or classes that inherit from :class:`custom_property`. """ cached = False """ If this attribute is set to :data:`True` the property's value is computed only once and then cached in an object's :attr:`~object.__dict__`. The next time you access the attribute's value the cached value is automatically returned. By combining the :attr:`cached` and :attr:`resettable` options you get a cached property whose cached value can be cleared. If the value should never be recomputed then don't enable the :attr:`resettable` option. :see also: :class:`cached_property` and :class:`lazy_property`. """ dynamic = False """ :data:`True` when the :class:`custom_property` subclass was dynamically constructed by :func:`__new__()`, :data:`False` otherwise. Used by :func:`compose_usage_notes()` to decide whether to link to the documentation of the subclass or not (because it's impossible to link to anonymous classes). """ environment_variable = None """ If this attribute is set to the name of an environment variable the property's value will default to the value of the environment variable. If the environment variable isn't set the property falls back to its computed value. """ key = False """ If this attribute is :data:`True` the property's name is included in the value of :attr:`~PropertyManager.key_properties` which means that the property's value becomes part of the "key" that is used to compare, sort and hash :class:`PropertyManager` objects. There are a few things to be aware of with regards to key properties and their values: - The property's value must be set during object initialization (the same as for :attr:`required` properties) and it cannot be changed after it is initially assigned a value (because allowing this would "compromise" the results of the :func:`~PropertyManager.__hash__()` method). - The property's value must be hashable (otherwise it can't be used by the :func:`~PropertyManager.__hash__()` method). :see also: :class:`key_property`. """ repr = True """ By default :func:`PropertyManager.__repr__()` includes the names and values of all properties that aren't :data:`None` in :func:`repr()` output. If you want to omit a certain property you can set :attr:`repr` to :data:`False`. Examples of why you would want to do this include property values that contain secrets or are expensive to calculate and data structures with cycles which cause :func:`repr()` to die a slow and horrible death :-). """ required = False """ If this attribute is set to :data:`True` the property requires a value to be set during the initialization of the object that owns the property. For this to work the class that owns the property needs to inherit from :class:`PropertyManager`. :see also: :class:`required_property`. The constructor of :class:`PropertyManager` will ensure that required properties are set to values that aren't :data:`None`. Required properties must be set by providing keyword arguments to the constructor of the class that inherits from :class:`PropertyManager`. When :func:`PropertyManager.__init__()` notices that required properties haven't been set it raises a :exc:`~exceptions.TypeError` similar to the type error raised by Python when required arguments are missing in a function call. Here's an example: .. code-block:: python from property_manager import PropertyManager, required_property, mutable_property class Example(PropertyManager): @required_property def important(self): "A very important attribute." @mutable_property def optional(self): "A not so important attribute." return 13 Let's construct an instance of the class defined above: >>> Example() Traceback (most recent call last): File "property_manager/__init__.py", line 107, in __init__ raise TypeError("%s (%s)" % (msg, concatenate(missing_properties))) TypeError: missing 1 required argument ('important') As expected it complains that a required property hasn't been initialized. Here's how it's supposed to work: >>> Example(important=42) Example(important=42, optional=13) """ resettable = False """ If this attribute is set to :data:`True` the property can be reset to its default or computed value using :keyword:`del` and :func:`delattr()`. This works by removing the assigned or cached value from the object's :attr:`~object.__dict__`. :see also: :class:`mutable_property` and :class:`cached_property`. """ usage_notes = True """ If this attribute is :data:`True` :func:`inject_usage_notes()` is used to inject usage notes into the documentation of the property. You can set this attribute to :data:`False` to disable :func:`inject_usage_notes()`. """ writable = False """ If this attribute is set to :data:`True` the property supports assignment. The assigned value is stored in the :attr:`~object.__dict__` of the object that owns the property. :see also: :class:`writable_property`, :class:`mutable_property` and :class:`required_property`. A relevant note about how Python looks up attributes: When an attribute is looked up and exists in an object's :attr:`~object.__dict__` Python ignores any property (descriptor) by the same name and immediately returns the value that was found in the object's :attr:`~object.__dict__`. """ def __new__(cls, *args, **options): """ Constructor for :class:`custom_property` subclasses and instances. To construct a subclass: :param args: The first positional argument is used as the name of the subclass (defaults to 'customized_property'). :param options: Each keyword argument gives the name of an option (:attr:`writable`, :attr:`resettable`, :attr:`cached`, :attr:`required`, :attr:`environment_variable`, :attr:`repr`) and the value to use for that option (:data:`True`, :data:`False` or a string). :returns: A dynamically constructed subclass of :class:`custom_property` with the given options. To construct an instance: :param args: The first positional argument is the function that's called to compute the value of the property. :returns: A :class:`custom_property` instance corresponding to the class whose constructor was called. Here's an example of how the subclass constructor can be used to dynamically construct custom properties with specific options: .. code-block:: python from property_manager import custom_property class WritableCachedPropertyDemo(object): @custom_property(cached=True, writable=True) def customized_test_property(self): return 42 The example above defines and uses a property whose computed value is cached and which supports assignment of new values. The example could have been made even simpler: .. code-block:: python from property_manager import cached_property class WritableCachedPropertyDemo(object): @cached_property(writable=True) def customized_test_property(self): return 42 Basically you can take any of the custom property classes defined in the :mod:`property_manager` module and call the class with keyword arguments corresponding to the options you'd like to change. """ if options: # Keyword arguments construct subclasses. name = args[0] if args else 'customized_property' options['dynamic'] = True return type(name, (cls,), options) else: # Positional arguments construct instances. return super(custom_property, cls).__new__(cls, *args) def __init__(self, *args, **kw): """ Initialize a :class:`custom_property` object. :param args: Any positional arguments are passed on to the initializer of the :class:`property` class. :param kw: Any keyword arguments are passed on to the initializer of the :class:`property` class. Automatically calls :func:`inject_usage_notes()` during initialization (only if :data:`USAGE_NOTES_ENABLED` is :data:`True`). """ # It's not documented so I went to try it out and apparently the # property class initializer performs absolutely no argument # validation. The first argument doesn't have to be a callable, # in fact none of the arguments are even mandatory?! :-P super(custom_property, self).__init__(*args, **kw) # Explicit is better than implicit so I'll just go ahead and check # whether the value(s) given by the user make sense :-). self.ensure_callable('fget') # We only check the 'fset' and 'fdel' values when they are not None # because both of these arguments are supposed to be optional :-). for name in 'fset', 'fdel': if getattr(self, name) is not None: self.ensure_callable(name) # Copy some important magic members from the decorated method. for name in '__doc__', '__module__', '__name__': value = getattr(self.fget, name, None) if value is not None: setattr(self, name, value) # Inject usage notes when running under Sphinx. if USAGE_NOTES_ENABLED: self.inject_usage_notes() def ensure_callable(self, role): """ Ensure that a decorated value is in fact callable. :param role: The value's role (one of 'fget', 'fset' or 'fdel'). :raises: :exc:`exceptions.ValueError` when the value isn't callable. """ value = getattr(self, role) if not callable(value): msg = "Invalid '%s' value! (expected callable, got %r instead)" raise ValueError(msg % (role, value)) def inject_usage_notes(self): """ Inject the property's semantics into its documentation. Calls :func:`compose_usage_notes()` to get a description of the property's semantics and appends this to the property's documentation. If the property doesn't have documentation it will not be added. """ if self.usage_notes and self.__doc__ and isinstance(self.__doc__, basestring): notes = self.compose_usage_notes() if notes: self.__doc__ = "\n\n".join([ textwrap.dedent(self.__doc__), ".. note:: %s" % " ".join(notes), ]) def compose_usage_notes(self): """ Get a description of the property's semantics to include in its documentation. :returns: A list of strings describing the semantics of the :class:`custom_property` in reStructuredText_ format with Sphinx_ directives. .. _reStructuredText: https://en.wikipedia.org/wiki/ReStructuredText .. _Sphinx: http://sphinx-doc.org/ """ template = DYNAMIC_PROPERTY_NOTE if self.dynamic else CUSTOM_PROPERTY_NOTE cls = custom_property if self.dynamic else self.__class__ dotted_path = "%s.%s" % (cls.__module__, cls.__name__) notes = [format(template, name=self.__name__, type=dotted_path)] if self.environment_variable: notes.append(format(ENVIRONMENT_PROPERTY_NOTE, variable=self.environment_variable)) if self.required: notes.append(format(REQUIRED_PROPERTY_NOTE, name=self.__name__)) if self.key: notes.append(KEY_PROPERTY_NOTE) if self.writable: notes.append(WRITABLE_PROPERTY_NOTE) if self.cached: notes.append(CACHED_PROPERTY_NOTE) if self.resettable: if self.cached: notes.append(RESETTABLE_CACHED_PROPERTY_NOTE) else: notes.append(RESETTABLE_WRITABLE_PROPERTY_NOTE) return notes def __get__(self, obj, type=None): """ Get the assigned, cached or computed value of the property. :param obj: The instance that owns the property. :param type: The class that owns the property. :returns: The value of the property. """ if obj is None: # Called to get the attribute of the class. return self else: # Called to get the attribute of an instance. We calculate the # property's dotted name here once to minimize string creation. dotted_name = format_property(obj, self.__name__) if self.key or self.writable or self.cached: # Check if a value has been assigned or cached. value = obj.__dict__.get(self.__name__, NOTHING) if value is not NOTHING: logger.spam("%s reporting assigned or cached value (%r) ..", dotted_name, value) return value # Check if the property has an environment variable. We do this # after checking for an assigned value so that the `writable' and # `environment_variable' options can be used together. if self.environment_variable: value = os.environ.get(self.environment_variable, NOTHING) if value is not NOTHING: logger.spam("%s reporting value from environment variable (%r) ..", dotted_name, value) return value # Compute the property's value. value = super(custom_property, self).__get__(obj, type) logger.spam("%s reporting computed value (%r) ..", dotted_name, value) if self.cached: # Cache the computed value. logger.spam("%s caching computed value ..", dotted_name) set_property(obj, self.__name__, value) return value def __set__(self, obj, value): """ Override the computed value of the property. :param obj: The instance that owns the property. :param value: The new value for the property. :raises: :exc:`~exceptions.AttributeError` if :attr:`writable` is :data:`False`. """ # Calculate the property's dotted name only once. dotted_name = format_property(obj, self.__name__) # Evaluate the property's setter (if any). try: logger.spam("%s calling setter with value %r ..", dotted_name, value) super(custom_property, self).__set__(obj, value) except AttributeError: logger.spam("%s setter raised attribute error, falling back.", dotted_name) if self.writable: # Override a computed or previously assigned value. logger.spam("%s overriding computed value to %r ..", dotted_name, value) set_property(obj, self.__name__, value) else: # Check if we're setting a key property during initialization. if self.key and obj.__dict__.get(self.__name__, None) is None: # Make sure we were given a hashable value. if not isinstance(value, Hashable): msg = "Invalid value for key property '%s'! (expected hashable object, got %r instead)" raise ValueError(msg % (self.__name__, value)) # Set the key property's value. logger.spam("%s setting initial value to %r ..", dotted_name, value) set_property(obj, self.__name__, value) else: # Refuse to override the computed value. msg = "%r object attribute %r is read-only" raise AttributeError(msg % (obj.__class__.__name__, self.__name__)) def __delete__(self, obj): """ Reset the assigned or cached value of the property. :param obj: The instance that owns the property. :raises: :exc:`~exceptions.AttributeError` if :attr:`resettable` is :data:`False`. Once the property has been deleted the next read will evaluate the decorated function to compute the value. """ # Calculate the property's dotted name only once. dotted_name = format_property(obj, self.__name__) # Evaluate the property's deleter (if any). try: logger.spam("%s calling deleter ..", dotted_name) super(custom_property, self).__delete__(obj) except AttributeError: logger.spam("%s deleter raised attribute error, falling back.", dotted_name) if self.resettable: # Reset the computed or overridden value. logger.spam("%s clearing assigned or computed value ..", dotted_name) clear_property(obj, self.__name__) else: msg = "%r object attribute %r is read-only" raise AttributeError(msg % (obj.__class__.__name__, self.__name__))
(*args, **options)
719,193
property_manager
format_property
Format an object property's dotted name. :param obj: The object that owns the property. :param name: The name of the property (a string). :returns: The dotted path (a string).
def format_property(obj, name): """ Format an object property's dotted name. :param obj: The object that owns the property. :param name: The name of the property (a string). :returns: The dotted path (a string). """ return "%s.%s" % (obj.__class__.__name__, name)
(obj, name)
719,194
property_manager
key_property
A property whose value is used for comparison and hashing. This is a variant of :class:`custom_property` that has the :attr:`~custom_property.key` and :attr:`~custom_property.required` options enabled by default.
class key_property(custom_property): """ A property whose value is used for comparison and hashing. This is a variant of :class:`custom_property` that has the :attr:`~custom_property.key` and :attr:`~custom_property.required` options enabled by default. """ key = True required = True
(*args, **options)
719,203
property_manager
lazy_property
A computed property whose value is computed once and cached. This is a variant of :class:`custom_property` that has the :attr:`~custom_property.cached` option enabled by default.
class lazy_property(custom_property): """ A computed property whose value is computed once and cached. This is a variant of :class:`custom_property` that has the :attr:`~custom_property.cached` option enabled by default. """ cached = True
(*args, **options)
719,249
flask.cli
with_appcontext
Wraps a callback so that it's guaranteed to be executed with the script's application context. Custom commands (and their options) registered under ``app.cli`` or ``blueprint.cli`` will always have an app context available, this decorator is not required in that case. .. versionchanged:: 2.2 The app context is active for subcommands as well as the decorated callback. The app context is always available to ``app.cli`` command and parameter callbacks.
def with_appcontext(f: F) -> F: """Wraps a callback so that it's guaranteed to be executed with the script's application context. Custom commands (and their options) registered under ``app.cli`` or ``blueprint.cli`` will always have an app context available, this decorator is not required in that case. .. versionchanged:: 2.2 The app context is active for subcommands as well as the decorated callback. The app context is always available to ``app.cli`` command and parameter callbacks. """ @click.pass_context def decorator(ctx: click.Context, /, *args: t.Any, **kwargs: t.Any) -> t.Any: if not current_app: app = ctx.ensure_object(ScriptInfo).load_app() ctx.with_resource(app.app_context()) return ctx.invoke(f, *args, **kwargs) return update_wrapper(decorator, f) # type: ignore[return-value]
(f: ~F) -> ~F
719,250
pykeops
clean_pykeops
null
def clean_pykeops(recompile_jit_binaries=True): import pykeops keopscore.clean_keops(recompile_jit_binary=recompile_jit_binaries) keops_binder = pykeops.common.keops_io.keops_binder for key in keops_binder: keops_binder[key].reset() if recompile_jit_binaries and keopscore.config.config.use_cuda: pykeops.common.keops_io.LoadKeOps_nvrtc.compile_jit_binary()
(recompile_jit_binaries=True)
719,253
pykeops
get_build_folder
null
def get_build_folder(): return keops_get_build_folder()
()
719,254
keopscore.config.config
get_build_folder
null
def get_build_folder(): return _build_path
()
719,260
pykeops
set_build_folder
null
def set_build_folder(path=None): import pykeops keopscore.set_build_folder(path) keops_binder = pykeops.common.keops_io.keops_binder for key in keops_binder: keops_binder[key].reset(new_save_folder=get_build_folder()) if keopscore.config.config.use_cuda and not os.path.exists( pykeops.config.pykeops_nvrtc_name(type="target") ): pykeops.common.keops_io.LoadKeOps_nvrtc.compile_jit_binary()
(path=None)
719,261
pykeops
set_verbose
null
def set_verbose(val): global verbose verbose = val keopscore.verbose = val
(val)
719,262
keopscore.config.config
show_cuda_status
null
def show_cuda_status(force_print=False): KeOps_Print(cuda_message, force_print=force_print)
(force_print=False)
719,263
pykeops.numpy.test_install
test_numpy_bindings
This function try to compile a simple keops formula using the numpy binder.
def test_numpy_bindings(): """ This function try to compile a simple keops formula using the numpy binder. """ x = np.arange(1, 10).reshape(-1, 3).astype("float32") y = np.arange(3, 9).reshape(-1, 3).astype("float32") import pykeops.numpy as pknp my_conv = pknp.Genred(formula, var) if np.allclose(my_conv(x, y).flatten(), expected_res): pyKeOps_Message("pyKeOps with numpy bindings is working!", use_tag=False) else: pyKeOps_Message("outputs wrong values...", use_tag=False)
()
719,293
ibm_platform_services.case_management_v1
CaseManagementV1
The Case Management V1 service.
class CaseManagementV1(BaseService): """The Case Management V1 service.""" DEFAULT_SERVICE_URL = 'https://support-center.cloud.ibm.com/case-management/v1' DEFAULT_SERVICE_NAME = 'case_management' @classmethod def new_instance( cls, service_name: str = DEFAULT_SERVICE_NAME, ) -> 'CaseManagementV1': """ Return a new client for the Case Management service using the specified parameters and external configuration. """ authenticator = get_authenticator_from_environment(service_name) service = cls(authenticator) service.configure_service(service_name) return service def __init__( self, authenticator: Authenticator = None, ) -> None: """ Construct a new client for the Case Management service. :param Authenticator authenticator: The authenticator specifies the authentication mechanism. Get up to date information from https://github.com/IBM/python-sdk-core/blob/main/README.md about initializing the authenticator of your choice. """ BaseService.__init__(self, service_url=self.DEFAULT_SERVICE_URL, authenticator=authenticator) ######################### # default ######################### def get_cases( self, *, offset: int = None, limit: int = None, search: str = None, sort: str = None, status: List[str] = None, fields: List[str] = None, **kwargs, ) -> DetailedResponse: """ Get cases in account. Get cases in the account that are specified by the content of the IAM token. :param int offset: (optional) Number of cases that are skipped. :param int limit: (optional) Number of cases that are returned. :param str search: (optional) String that a case might contain. :param str sort: (optional) Sort field and direction. If omitted, default to descending of updated date. Prefix "~" signifies sort in descending. :param List[str] status: (optional) Case status filter. :param List[str] fields: (optional) Selected fields of interest instead of all of the case information. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `CaseList` object """ headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='get_cases' ) headers.update(sdk_headers) params = { 'offset': offset, 'limit': limit, 'search': search, 'sort': sort, 'status': convert_list(status), 'fields': convert_list(fields), } if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] headers['Accept'] = 'application/json' url = '/cases' request = self.prepare_request(method='GET', url=url, headers=headers, params=params) response = self.send(request, **kwargs) return response def create_case( self, type: str, subject: str, description: str, *, severity: int = None, eu: 'CasePayloadEu' = None, offering: 'Offering' = None, resources: List['ResourcePayload'] = None, watchlist: List['User'] = None, invoice_number: str = None, sla_credit_request: bool = None, **kwargs, ) -> DetailedResponse: """ Create a case. Create a support case to resolve issues in your account. :param str type: Case type. :param str subject: Short description used to identify the case. :param str description: Detailed description of the issue. :param int severity: (optional) Severity of the case. Smaller values mean higher severity. :param CasePayloadEu eu: (optional) Specify if the case should be treated as EU regulated. Only one of the following properties is required. Call EU support utility endpoint to determine which property must be specified for your account. :param Offering offering: (optional) Offering details. :param List[ResourcePayload] resources: (optional) List of resources to attach to case. If you attach Classic IaaS devices, use the type and id fields if the Cloud Resource Name (CRN) is unavailable. Otherwise, pass the resource CRN. The resource list must be consistent with the value that is selected for the resource offering. :param List[User] watchlist: (optional) Array of user IDs to add to the watchlist. :param str invoice_number: (optional) Invoice number of "Billing and Invoice" case type. :param bool sla_credit_request: (optional) Flag to indicate if case is for an Service Level Agreement (SLA) credit request. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `Case` object """ if type is None: raise ValueError('type must be provided') if subject is None: raise ValueError('subject must be provided') if description is None: raise ValueError('description must be provided') if eu is not None: eu = convert_model(eu) if offering is not None: offering = convert_model(offering) if resources is not None: resources = [convert_model(x) for x in resources] if watchlist is not None: watchlist = [convert_model(x) for x in watchlist] headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='create_case' ) headers.update(sdk_headers) data = { 'type': type, 'subject': subject, 'description': description, 'severity': severity, 'eu': eu, 'offering': offering, 'resources': resources, 'watchlist': watchlist, 'invoice_number': invoice_number, 'sla_credit_request': sla_credit_request, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) headers['content-type'] = 'application/json' if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] headers['Accept'] = 'application/json' url = '/cases' request = self.prepare_request(method='POST', url=url, headers=headers, data=data) response = self.send(request, **kwargs) return response def get_case(self, case_number: str, *, fields: List[str] = None, **kwargs) -> DetailedResponse: """ Get a case in account. View a case in the account that is specified by the case number. :param str case_number: Unique identifier of a case. :param List[str] fields: (optional) Selected fields of interest instead of all of the case information. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `Case` object """ if not case_number: raise ValueError('case_number must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='get_case' ) headers.update(sdk_headers) params = {'fields': convert_list(fields)} if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['case_number'] path_param_values = self.encode_path_vars(case_number) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/cases/{case_number}'.format(**path_param_dict) request = self.prepare_request(method='GET', url=url, headers=headers, params=params) response = self.send(request, **kwargs) return response def update_case_status(self, case_number: str, status_payload: 'StatusPayload', **kwargs) -> DetailedResponse: """ Update case status. Mark the case as resolved or unresolved, or accept the provided resolution. :param str case_number: Unique identifier of a case. :param StatusPayload status_payload: :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `Case` object """ if not case_number: raise ValueError('case_number must be provided') if status_payload is None: raise ValueError('status_payload must be provided') if isinstance(status_payload, StatusPayload): status_payload = convert_model(status_payload) headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='update_case_status' ) headers.update(sdk_headers) data = json.dumps(status_payload) headers['content-type'] = 'application/json' if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['case_number'] path_param_values = self.encode_path_vars(case_number) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/cases/{case_number}/status'.format(**path_param_dict) request = self.prepare_request(method='PUT', url=url, headers=headers, data=data) response = self.send(request, **kwargs) return response def add_comment(self, case_number: str, comment: str, **kwargs) -> DetailedResponse: """ Add comment to case. Add a comment to a case to be viewed by a support engineer. :param str case_number: Unique identifier of a case. :param str comment: Comment to add to the case. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `Comment` object """ if not case_number: raise ValueError('case_number must be provided') if comment is None: raise ValueError('comment must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='add_comment' ) headers.update(sdk_headers) data = {'comment': comment} data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) headers['content-type'] = 'application/json' if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['case_number'] path_param_values = self.encode_path_vars(case_number) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/cases/{case_number}/comments'.format(**path_param_dict) request = self.prepare_request(method='PUT', url=url, headers=headers, data=data) response = self.send(request, **kwargs) return response def add_watchlist(self, case_number: str, *, watchlist: List['User'] = None, **kwargs) -> DetailedResponse: """ Add users to watchlist of case. Add users to the watchlist of case. By adding a user to the watchlist of the case, you are granting them read and write permissions, so the user can view the case, receive updates, and make updates to the case. Note that the user must be in the account to be added to the watchlist. :param str case_number: Unique identifier of a case. :param List[User] watchlist: (optional) Array of user ID objects. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `WatchlistAddResponse` object """ if not case_number: raise ValueError('case_number must be provided') if watchlist is not None: watchlist = [convert_model(x) for x in watchlist] headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='add_watchlist' ) headers.update(sdk_headers) data = {'watchlist': watchlist} data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) headers['content-type'] = 'application/json' if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['case_number'] path_param_values = self.encode_path_vars(case_number) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/cases/{case_number}/watchlist'.format(**path_param_dict) request = self.prepare_request(method='PUT', url=url, headers=headers, data=data) response = self.send(request, **kwargs) return response def remove_watchlist(self, case_number: str, *, watchlist: List['User'] = None, **kwargs) -> DetailedResponse: """ Remove users from watchlist of case. Remove users from the watchlist of a case if you don't want them to view the case, receive updates, or make updates to the case. :param str case_number: Unique identifier of a case. :param List[User] watchlist: (optional) Array of user ID objects. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `Watchlist` object """ if not case_number: raise ValueError('case_number must be provided') if watchlist is not None: watchlist = [convert_model(x) for x in watchlist] headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='remove_watchlist' ) headers.update(sdk_headers) data = {'watchlist': watchlist} data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) headers['content-type'] = 'application/json' if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['case_number'] path_param_values = self.encode_path_vars(case_number) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/cases/{case_number}/watchlist'.format(**path_param_dict) request = self.prepare_request(method='DELETE', url=url, headers=headers, data=data) response = self.send(request, **kwargs) return response def add_resource( self, case_number: str, *, crn: str = None, type: str = None, id: float = None, note: str = None, **kwargs ) -> DetailedResponse: """ Add a resource to case. Add a resource to case by specifying the Cloud Resource Name (CRN), or id and type if attaching a class iaaS resource. :param str case_number: Unique identifier of a case. :param str crn: (optional) Cloud Resource Name of the resource. :param str type: (optional) Only used to attach Classic IaaS devices that have no CRN. :param float id: (optional) Deprecated: Only used to attach Classic IaaS devices that have no CRN. Id of Classic IaaS device. This is deprecated in favor of the crn field. :param str note: (optional) A note about this resource. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `Resource` object """ if not case_number: raise ValueError('case_number must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='add_resource' ) headers.update(sdk_headers) data = {'crn': crn, 'type': type, 'id': id, 'note': note} data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) headers['content-type'] = 'application/json' if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['case_number'] path_param_values = self.encode_path_vars(case_number) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/cases/{case_number}/resources'.format(**path_param_dict) request = self.prepare_request(method='PUT', url=url, headers=headers, data=data) response = self.send(request, **kwargs) return response def upload_file(self, case_number: str, file: List[BinaryIO], **kwargs) -> DetailedResponse: """ Add attachments to a support case. You can add attachments to a case to provide more information for the support team about the issue that you're experiencing. :param str case_number: Unique identifier of a case. :param list[FileWithMetadata] file: file of supported types, 8MB in size limit. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `Attachment` object """ if not case_number: raise ValueError('case_number must be provided') if file is None: raise ValueError('file must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='upload_file' ) headers.update(sdk_headers) form_data = [] for item in file: item = convert_model(item) _file = (item.get('filename') or None, item['data'], item.get('content_type') or 'application/octet-stream') form_data.append(('file', _file)) if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['case_number'] path_param_values = self.encode_path_vars(case_number) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/cases/{case_number}/attachments'.format(**path_param_dict) request = self.prepare_request(method='PUT', url=url, headers=headers, files=form_data) response = self.send(request, **kwargs) return response def download_file(self, case_number: str, file_id: str, **kwargs) -> DetailedResponse: """ Download an attachment. Download an attachment from a case. :param str case_number: Unique identifier of a case. :param str file_id: Unique identifier of a file. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `BinaryIO` result """ if not case_number: raise ValueError('case_number must be provided') if not file_id: raise ValueError('file_id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='download_file' ) headers.update(sdk_headers) if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] headers['Accept'] = 'application/octet-stream' path_param_keys = ['case_number', 'file_id'] path_param_values = self.encode_path_vars(case_number, file_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/cases/{case_number}/attachments/{file_id}'.format(**path_param_dict) request = self.prepare_request(method='GET', url=url, headers=headers) response = self.send(request, **kwargs) return response def delete_file(self, case_number: str, file_id: str, **kwargs) -> DetailedResponse: """ Remove attachment from case. Remove an attachment from a case. :param str case_number: Unique identifier of a case. :param str file_id: Unique identifier of a file. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `AttachmentList` object """ if not case_number: raise ValueError('case_number must be provided') if not file_id: raise ValueError('file_id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='delete_file' ) headers.update(sdk_headers) if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['case_number', 'file_id'] path_param_values = self.encode_path_vars(case_number, file_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/cases/{case_number}/attachments/{file_id}'.format(**path_param_dict) request = self.prepare_request(method='DELETE', url=url, headers=headers) response = self.send(request, **kwargs) return response
(authenticator: ibm_cloud_sdk_core.authenticators.authenticator.Authenticator = None) -> None
719,294
ibm_platform_services.case_management_v1
__init__
Construct a new client for the Case Management service. :param Authenticator authenticator: The authenticator specifies the authentication mechanism. Get up to date information from https://github.com/IBM/python-sdk-core/blob/main/README.md about initializing the authenticator of your choice.
def __init__( self, authenticator: Authenticator = None, ) -> None: """ Construct a new client for the Case Management service. :param Authenticator authenticator: The authenticator specifies the authentication mechanism. Get up to date information from https://github.com/IBM/python-sdk-core/blob/main/README.md about initializing the authenticator of your choice. """ BaseService.__init__(self, service_url=self.DEFAULT_SERVICE_URL, authenticator=authenticator)
(self, authenticator: Optional[ibm_cloud_sdk_core.authenticators.authenticator.Authenticator] = None) -> NoneType
719,299
ibm_platform_services.case_management_v1
add_comment
Add comment to case. Add a comment to a case to be viewed by a support engineer. :param str case_number: Unique identifier of a case. :param str comment: Comment to add to the case. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `Comment` object
def add_comment(self, case_number: str, comment: str, **kwargs) -> DetailedResponse: """ Add comment to case. Add a comment to a case to be viewed by a support engineer. :param str case_number: Unique identifier of a case. :param str comment: Comment to add to the case. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `Comment` object """ if not case_number: raise ValueError('case_number must be provided') if comment is None: raise ValueError('comment must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='add_comment' ) headers.update(sdk_headers) data = {'comment': comment} data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) headers['content-type'] = 'application/json' if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['case_number'] path_param_values = self.encode_path_vars(case_number) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/cases/{case_number}/comments'.format(**path_param_dict) request = self.prepare_request(method='PUT', url=url, headers=headers, data=data) response = self.send(request, **kwargs) return response
(self, case_number: str, comment: str, **kwargs) -> ibm_cloud_sdk_core.detailed_response.DetailedResponse
719,300
ibm_platform_services.case_management_v1
add_resource
Add a resource to case. Add a resource to case by specifying the Cloud Resource Name (CRN), or id and type if attaching a class iaaS resource. :param str case_number: Unique identifier of a case. :param str crn: (optional) Cloud Resource Name of the resource. :param str type: (optional) Only used to attach Classic IaaS devices that have no CRN. :param float id: (optional) Deprecated: Only used to attach Classic IaaS devices that have no CRN. Id of Classic IaaS device. This is deprecated in favor of the crn field. :param str note: (optional) A note about this resource. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `Resource` object
def add_resource( self, case_number: str, *, crn: str = None, type: str = None, id: float = None, note: str = None, **kwargs ) -> DetailedResponse: """ Add a resource to case. Add a resource to case by specifying the Cloud Resource Name (CRN), or id and type if attaching a class iaaS resource. :param str case_number: Unique identifier of a case. :param str crn: (optional) Cloud Resource Name of the resource. :param str type: (optional) Only used to attach Classic IaaS devices that have no CRN. :param float id: (optional) Deprecated: Only used to attach Classic IaaS devices that have no CRN. Id of Classic IaaS device. This is deprecated in favor of the crn field. :param str note: (optional) A note about this resource. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `Resource` object """ if not case_number: raise ValueError('case_number must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='add_resource' ) headers.update(sdk_headers) data = {'crn': crn, 'type': type, 'id': id, 'note': note} data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) headers['content-type'] = 'application/json' if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['case_number'] path_param_values = self.encode_path_vars(case_number) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/cases/{case_number}/resources'.format(**path_param_dict) request = self.prepare_request(method='PUT', url=url, headers=headers, data=data) response = self.send(request, **kwargs) return response
(self, case_number: str, *, crn: Optional[str] = None, type: Optional[str] = None, id: Optional[float] = None, note: Optional[str] = None, **kwargs) -> ibm_cloud_sdk_core.detailed_response.DetailedResponse
719,301
ibm_platform_services.case_management_v1
add_watchlist
Add users to watchlist of case. Add users to the watchlist of case. By adding a user to the watchlist of the case, you are granting them read and write permissions, so the user can view the case, receive updates, and make updates to the case. Note that the user must be in the account to be added to the watchlist. :param str case_number: Unique identifier of a case. :param List[User] watchlist: (optional) Array of user ID objects. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `WatchlistAddResponse` object
def add_watchlist(self, case_number: str, *, watchlist: List['User'] = None, **kwargs) -> DetailedResponse: """ Add users to watchlist of case. Add users to the watchlist of case. By adding a user to the watchlist of the case, you are granting them read and write permissions, so the user can view the case, receive updates, and make updates to the case. Note that the user must be in the account to be added to the watchlist. :param str case_number: Unique identifier of a case. :param List[User] watchlist: (optional) Array of user ID objects. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `WatchlistAddResponse` object """ if not case_number: raise ValueError('case_number must be provided') if watchlist is not None: watchlist = [convert_model(x) for x in watchlist] headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='add_watchlist' ) headers.update(sdk_headers) data = {'watchlist': watchlist} data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) headers['content-type'] = 'application/json' if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['case_number'] path_param_values = self.encode_path_vars(case_number) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/cases/{case_number}/watchlist'.format(**path_param_dict) request = self.prepare_request(method='PUT', url=url, headers=headers, data=data) response = self.send(request, **kwargs) return response
(self, case_number: str, *, watchlist: Optional[List[ibm_platform_services.case_management_v1.User]] = None, **kwargs) -> ibm_cloud_sdk_core.detailed_response.DetailedResponse
719,303
ibm_platform_services.case_management_v1
create_case
Create a case. Create a support case to resolve issues in your account. :param str type: Case type. :param str subject: Short description used to identify the case. :param str description: Detailed description of the issue. :param int severity: (optional) Severity of the case. Smaller values mean higher severity. :param CasePayloadEu eu: (optional) Specify if the case should be treated as EU regulated. Only one of the following properties is required. Call EU support utility endpoint to determine which property must be specified for your account. :param Offering offering: (optional) Offering details. :param List[ResourcePayload] resources: (optional) List of resources to attach to case. If you attach Classic IaaS devices, use the type and id fields if the Cloud Resource Name (CRN) is unavailable. Otherwise, pass the resource CRN. The resource list must be consistent with the value that is selected for the resource offering. :param List[User] watchlist: (optional) Array of user IDs to add to the watchlist. :param str invoice_number: (optional) Invoice number of "Billing and Invoice" case type. :param bool sla_credit_request: (optional) Flag to indicate if case is for an Service Level Agreement (SLA) credit request. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `Case` object
def create_case( self, type: str, subject: str, description: str, *, severity: int = None, eu: 'CasePayloadEu' = None, offering: 'Offering' = None, resources: List['ResourcePayload'] = None, watchlist: List['User'] = None, invoice_number: str = None, sla_credit_request: bool = None, **kwargs, ) -> DetailedResponse: """ Create a case. Create a support case to resolve issues in your account. :param str type: Case type. :param str subject: Short description used to identify the case. :param str description: Detailed description of the issue. :param int severity: (optional) Severity of the case. Smaller values mean higher severity. :param CasePayloadEu eu: (optional) Specify if the case should be treated as EU regulated. Only one of the following properties is required. Call EU support utility endpoint to determine which property must be specified for your account. :param Offering offering: (optional) Offering details. :param List[ResourcePayload] resources: (optional) List of resources to attach to case. If you attach Classic IaaS devices, use the type and id fields if the Cloud Resource Name (CRN) is unavailable. Otherwise, pass the resource CRN. The resource list must be consistent with the value that is selected for the resource offering. :param List[User] watchlist: (optional) Array of user IDs to add to the watchlist. :param str invoice_number: (optional) Invoice number of "Billing and Invoice" case type. :param bool sla_credit_request: (optional) Flag to indicate if case is for an Service Level Agreement (SLA) credit request. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `Case` object """ if type is None: raise ValueError('type must be provided') if subject is None: raise ValueError('subject must be provided') if description is None: raise ValueError('description must be provided') if eu is not None: eu = convert_model(eu) if offering is not None: offering = convert_model(offering) if resources is not None: resources = [convert_model(x) for x in resources] if watchlist is not None: watchlist = [convert_model(x) for x in watchlist] headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='create_case' ) headers.update(sdk_headers) data = { 'type': type, 'subject': subject, 'description': description, 'severity': severity, 'eu': eu, 'offering': offering, 'resources': resources, 'watchlist': watchlist, 'invoice_number': invoice_number, 'sla_credit_request': sla_credit_request, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) headers['content-type'] = 'application/json' if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] headers['Accept'] = 'application/json' url = '/cases' request = self.prepare_request(method='POST', url=url, headers=headers, data=data) response = self.send(request, **kwargs) return response
(self, type: str, subject: str, description: str, *, severity: Optional[int] = None, eu: Optional[ibm_platform_services.case_management_v1.CasePayloadEu] = None, offering: Optional[ibm_platform_services.case_management_v1.Offering] = None, resources: Optional[List[ibm_platform_services.case_management_v1.ResourcePayload]] = None, watchlist: Optional[List[ibm_platform_services.case_management_v1.User]] = None, invoice_number: Optional[str] = None, sla_credit_request: Optional[bool] = None, **kwargs) -> ibm_cloud_sdk_core.detailed_response.DetailedResponse
719,304
ibm_platform_services.case_management_v1
delete_file
Remove attachment from case. Remove an attachment from a case. :param str case_number: Unique identifier of a case. :param str file_id: Unique identifier of a file. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `AttachmentList` object
def delete_file(self, case_number: str, file_id: str, **kwargs) -> DetailedResponse: """ Remove attachment from case. Remove an attachment from a case. :param str case_number: Unique identifier of a case. :param str file_id: Unique identifier of a file. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `AttachmentList` object """ if not case_number: raise ValueError('case_number must be provided') if not file_id: raise ValueError('file_id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='delete_file' ) headers.update(sdk_headers) if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['case_number', 'file_id'] path_param_values = self.encode_path_vars(case_number, file_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/cases/{case_number}/attachments/{file_id}'.format(**path_param_dict) request = self.prepare_request(method='DELETE', url=url, headers=headers) response = self.send(request, **kwargs) return response
(self, case_number: str, file_id: str, **kwargs) -> ibm_cloud_sdk_core.detailed_response.DetailedResponse
719,306
ibm_platform_services.case_management_v1
download_file
Download an attachment. Download an attachment from a case. :param str case_number: Unique identifier of a case. :param str file_id: Unique identifier of a file. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `BinaryIO` result
def download_file(self, case_number: str, file_id: str, **kwargs) -> DetailedResponse: """ Download an attachment. Download an attachment from a case. :param str case_number: Unique identifier of a case. :param str file_id: Unique identifier of a file. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `BinaryIO` result """ if not case_number: raise ValueError('case_number must be provided') if not file_id: raise ValueError('file_id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='download_file' ) headers.update(sdk_headers) if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] headers['Accept'] = 'application/octet-stream' path_param_keys = ['case_number', 'file_id'] path_param_values = self.encode_path_vars(case_number, file_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/cases/{case_number}/attachments/{file_id}'.format(**path_param_dict) request = self.prepare_request(method='GET', url=url, headers=headers) response = self.send(request, **kwargs) return response
(self, case_number: str, file_id: str, **kwargs) -> ibm_cloud_sdk_core.detailed_response.DetailedResponse
719,310
ibm_platform_services.case_management_v1
get_case
Get a case in account. View a case in the account that is specified by the case number. :param str case_number: Unique identifier of a case. :param List[str] fields: (optional) Selected fields of interest instead of all of the case information. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `Case` object
def get_case(self, case_number: str, *, fields: List[str] = None, **kwargs) -> DetailedResponse: """ Get a case in account. View a case in the account that is specified by the case number. :param str case_number: Unique identifier of a case. :param List[str] fields: (optional) Selected fields of interest instead of all of the case information. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `Case` object """ if not case_number: raise ValueError('case_number must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='get_case' ) headers.update(sdk_headers) params = {'fields': convert_list(fields)} if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['case_number'] path_param_values = self.encode_path_vars(case_number) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/cases/{case_number}'.format(**path_param_dict) request = self.prepare_request(method='GET', url=url, headers=headers, params=params) response = self.send(request, **kwargs) return response
(self, case_number: str, *, fields: Optional[List[str]] = None, **kwargs) -> ibm_cloud_sdk_core.detailed_response.DetailedResponse
719,311
ibm_platform_services.case_management_v1
get_cases
Get cases in account. Get cases in the account that are specified by the content of the IAM token. :param int offset: (optional) Number of cases that are skipped. :param int limit: (optional) Number of cases that are returned. :param str search: (optional) String that a case might contain. :param str sort: (optional) Sort field and direction. If omitted, default to descending of updated date. Prefix "~" signifies sort in descending. :param List[str] status: (optional) Case status filter. :param List[str] fields: (optional) Selected fields of interest instead of all of the case information. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `CaseList` object
def get_cases( self, *, offset: int = None, limit: int = None, search: str = None, sort: str = None, status: List[str] = None, fields: List[str] = None, **kwargs, ) -> DetailedResponse: """ Get cases in account. Get cases in the account that are specified by the content of the IAM token. :param int offset: (optional) Number of cases that are skipped. :param int limit: (optional) Number of cases that are returned. :param str search: (optional) String that a case might contain. :param str sort: (optional) Sort field and direction. If omitted, default to descending of updated date. Prefix "~" signifies sort in descending. :param List[str] status: (optional) Case status filter. :param List[str] fields: (optional) Selected fields of interest instead of all of the case information. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `CaseList` object """ headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='get_cases' ) headers.update(sdk_headers) params = { 'offset': offset, 'limit': limit, 'search': search, 'sort': sort, 'status': convert_list(status), 'fields': convert_list(fields), } if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] headers['Accept'] = 'application/json' url = '/cases' request = self.prepare_request(method='GET', url=url, headers=headers, params=params) response = self.send(request, **kwargs) return response
(self, *, offset: Optional[int] = None, limit: Optional[int] = None, search: Optional[str] = None, sort: Optional[str] = None, status: Optional[List[str]] = None, fields: Optional[List[str]] = None, **kwargs) -> ibm_cloud_sdk_core.detailed_response.DetailedResponse
719,315
ibm_platform_services.case_management_v1
remove_watchlist
Remove users from watchlist of case. Remove users from the watchlist of a case if you don't want them to view the case, receive updates, or make updates to the case. :param str case_number: Unique identifier of a case. :param List[User] watchlist: (optional) Array of user ID objects. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `Watchlist` object
def remove_watchlist(self, case_number: str, *, watchlist: List['User'] = None, **kwargs) -> DetailedResponse: """ Remove users from watchlist of case. Remove users from the watchlist of a case if you don't want them to view the case, receive updates, or make updates to the case. :param str case_number: Unique identifier of a case. :param List[User] watchlist: (optional) Array of user ID objects. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `Watchlist` object """ if not case_number: raise ValueError('case_number must be provided') if watchlist is not None: watchlist = [convert_model(x) for x in watchlist] headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='remove_watchlist' ) headers.update(sdk_headers) data = {'watchlist': watchlist} data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) headers['content-type'] = 'application/json' if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['case_number'] path_param_values = self.encode_path_vars(case_number) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/cases/{case_number}/watchlist'.format(**path_param_dict) request = self.prepare_request(method='DELETE', url=url, headers=headers, data=data) response = self.send(request, **kwargs) return response
(self, case_number: str, *, watchlist: Optional[List[ibm_platform_services.case_management_v1.User]] = None, **kwargs) -> ibm_cloud_sdk_core.detailed_response.DetailedResponse
719,323
ibm_platform_services.case_management_v1
update_case_status
Update case status. Mark the case as resolved or unresolved, or accept the provided resolution. :param str case_number: Unique identifier of a case. :param StatusPayload status_payload: :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `Case` object
def update_case_status(self, case_number: str, status_payload: 'StatusPayload', **kwargs) -> DetailedResponse: """ Update case status. Mark the case as resolved or unresolved, or accept the provided resolution. :param str case_number: Unique identifier of a case. :param StatusPayload status_payload: :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `Case` object """ if not case_number: raise ValueError('case_number must be provided') if status_payload is None: raise ValueError('status_payload must be provided') if isinstance(status_payload, StatusPayload): status_payload = convert_model(status_payload) headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='update_case_status' ) headers.update(sdk_headers) data = json.dumps(status_payload) headers['content-type'] = 'application/json' if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['case_number'] path_param_values = self.encode_path_vars(case_number) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/cases/{case_number}/status'.format(**path_param_dict) request = self.prepare_request(method='PUT', url=url, headers=headers, data=data) response = self.send(request, **kwargs) return response
(self, case_number: str, status_payload: ibm_platform_services.case_management_v1.StatusPayload, **kwargs) -> ibm_cloud_sdk_core.detailed_response.DetailedResponse
719,324
ibm_platform_services.case_management_v1
upload_file
Add attachments to a support case. You can add attachments to a case to provide more information for the support team about the issue that you're experiencing. :param str case_number: Unique identifier of a case. :param list[FileWithMetadata] file: file of supported types, 8MB in size limit. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `Attachment` object
def upload_file(self, case_number: str, file: List[BinaryIO], **kwargs) -> DetailedResponse: """ Add attachments to a support case. You can add attachments to a case to provide more information for the support team about the issue that you're experiencing. :param str case_number: Unique identifier of a case. :param list[FileWithMetadata] file: file of supported types, 8MB in size limit. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `Attachment` object """ if not case_number: raise ValueError('case_number must be provided') if file is None: raise ValueError('file must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='upload_file' ) headers.update(sdk_headers) form_data = [] for item in file: item = convert_model(item) _file = (item.get('filename') or None, item['data'], item.get('content_type') or 'application/octet-stream') form_data.append(('file', _file)) if 'headers' in kwargs: headers.update(kwargs.get('headers')) del kwargs['headers'] headers['Accept'] = 'application/json' path_param_keys = ['case_number'] path_param_values = self.encode_path_vars(case_number) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/cases/{case_number}/attachments'.format(**path_param_dict) request = self.prepare_request(method='PUT', url=url, headers=headers, files=form_data) response = self.send(request, **kwargs) return response
(self, case_number: str, file: List[BinaryIO], **kwargs) -> ibm_cloud_sdk_core.detailed_response.DetailedResponse
719,325
ibm_platform_services.catalog_management_v1
CatalogManagementV1
The Catalog Management V1 service.
class CatalogManagementV1(BaseService): """The Catalog Management V1 service.""" DEFAULT_SERVICE_URL = 'https://cm.globalcatalog.cloud.ibm.com/api/v1-beta' DEFAULT_SERVICE_NAME = 'catalog_management' @classmethod def new_instance( cls, service_name: str = DEFAULT_SERVICE_NAME, ) -> 'CatalogManagementV1': """ Return a new client for the Catalog Management service using the specified parameters and external configuration. """ authenticator = get_authenticator_from_environment(service_name) service = cls(authenticator) service.configure_service(service_name) return service def __init__( self, authenticator: Authenticator = None, ) -> None: """ Construct a new client for the Catalog Management service. :param Authenticator authenticator: The authenticator specifies the authentication mechanism. Get up to date information from https://github.com/IBM/python-sdk-core/blob/main/README.md about initializing the authenticator of your choice. """ BaseService.__init__(self, service_url=self.DEFAULT_SERVICE_URL, authenticator=authenticator) ######################### # Account ######################### def get_catalog_account(self, **kwargs) -> DetailedResponse: """ Get catalog account settings. Get the account level settings for the account for private catalog. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `Account` object """ headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='get_catalog_account' ) headers.update(sdk_headers) if 'headers' in kwargs: headers.update(kwargs.get('headers')) headers['Accept'] = 'application/json' url = '/catalogaccount' request = self.prepare_request(method='GET', url=url, headers=headers) response = self.send(request, **kwargs) return response def update_catalog_account( self, *, id: str = None, hide_ibm_cloud_catalog: bool = None, account_filters: 'Filters' = None, **kwargs ) -> DetailedResponse: """ Update account settings. Update the account level settings for the account for private catalog. :param str id: (optional) Account identification. :param bool hide_ibm_cloud_catalog: (optional) Hide the public catalog in this account. :param Filters account_filters: (optional) Filters for account and catalog filters. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if account_filters is not None: account_filters = convert_model(account_filters) headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='update_catalog_account' ) headers.update(sdk_headers) data = {'id': id, 'hide_IBM_cloud_catalog': hide_ibm_cloud_catalog, 'account_filters': account_filters} data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) headers['content-type'] = 'application/json' if 'headers' in kwargs: headers.update(kwargs.get('headers')) url = '/catalogaccount' request = self.prepare_request(method='PUT', url=url, headers=headers, data=data) response = self.send(request, **kwargs) return response def get_catalog_account_audit(self, **kwargs) -> DetailedResponse: """ Get catalog account audit log. Get the audit log associated with a catalog account. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `AuditLog` object """ headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='get_catalog_account_audit' ) headers.update(sdk_headers) if 'headers' in kwargs: headers.update(kwargs.get('headers')) headers['Accept'] = 'application/json' url = '/catalogaccount/audit' request = self.prepare_request(method='GET', url=url, headers=headers) response = self.send(request, **kwargs) return response def get_catalog_account_filters(self, *, catalog: str = None, **kwargs) -> DetailedResponse: """ Get catalog account filters. Get the accumulated filters of the account and of the catalogs you have access to. :param str catalog: (optional) catalog id. Narrow down filters to the account and just the one catalog. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `AccumulatedFilters` object """ headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='get_catalog_account_filters' ) headers.update(sdk_headers) params = {'catalog': catalog} if 'headers' in kwargs: headers.update(kwargs.get('headers')) headers['Accept'] = 'application/json' url = '/catalogaccount/filters' request = self.prepare_request(method='GET', url=url, headers=headers, params=params) response = self.send(request, **kwargs) return response ######################### # Catalogs ######################### def list_catalogs(self, **kwargs) -> DetailedResponse: """ Get list of catalogs. Retrieves the available catalogs for a given account. This can be used by an unauthenticated user to retrieve the public catalog. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `CatalogSearchResult` object """ headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='list_catalogs' ) headers.update(sdk_headers) if 'headers' in kwargs: headers.update(kwargs.get('headers')) headers['Accept'] = 'application/json' url = '/catalogs' request = self.prepare_request(method='GET', url=url, headers=headers) response = self.send(request, **kwargs) return response def create_catalog( self, *, id: str = None, rev: str = None, label: str = None, short_description: str = None, catalog_icon_url: str = None, tags: List[str] = None, features: List['Feature'] = None, disabled: bool = None, resource_group_id: str = None, owning_account: str = None, catalog_filters: 'Filters' = None, syndication_settings: 'SyndicationResource' = None, kind: str = None, **kwargs ) -> DetailedResponse: """ Create a catalog. Create a catalog for a given account. :param str id: (optional) Unique ID. :param str rev: (optional) Cloudant revision. :param str label: (optional) Display Name in the requested language. :param str short_description: (optional) Description in the requested language. :param str catalog_icon_url: (optional) URL for an icon associated with this catalog. :param List[str] tags: (optional) List of tags associated with this catalog. :param List[Feature] features: (optional) List of features associated with this catalog. :param bool disabled: (optional) Denotes whether a catalog is disabled. :param str resource_group_id: (optional) Resource group id the catalog is owned by. :param str owning_account: (optional) Account that owns catalog. :param Filters catalog_filters: (optional) Filters for account and catalog filters. :param SyndicationResource syndication_settings: (optional) Feature information. :param str kind: (optional) Kind of catalog. Supported kinds are offering and vpe. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `Catalog` object """ if features is not None: features = [convert_model(x) for x in features] if catalog_filters is not None: catalog_filters = convert_model(catalog_filters) if syndication_settings is not None: syndication_settings = convert_model(syndication_settings) headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='create_catalog' ) headers.update(sdk_headers) data = { 'id': id, '_rev': rev, 'label': label, 'short_description': short_description, 'catalog_icon_url': catalog_icon_url, 'tags': tags, 'features': features, 'disabled': disabled, 'resource_group_id': resource_group_id, 'owning_account': owning_account, 'catalog_filters': catalog_filters, 'syndication_settings': syndication_settings, 'kind': kind, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) headers['content-type'] = 'application/json' if 'headers' in kwargs: headers.update(kwargs.get('headers')) headers['Accept'] = 'application/json' url = '/catalogs' request = self.prepare_request(method='POST', url=url, headers=headers, data=data) response = self.send(request, **kwargs) return response def get_catalog(self, catalog_identifier: str, **kwargs) -> DetailedResponse: """ Get catalog. Get a catalog. This can also be used by an unauthenticated user to get the public catalog. :param str catalog_identifier: Catalog identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `Catalog` object """ if catalog_identifier is None: raise ValueError('catalog_identifier must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='get_catalog' ) headers.update(sdk_headers) if 'headers' in kwargs: headers.update(kwargs.get('headers')) headers['Accept'] = 'application/json' path_param_keys = ['catalog_identifier'] path_param_values = self.encode_path_vars(catalog_identifier) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/catalogs/{catalog_identifier}'.format(**path_param_dict) request = self.prepare_request(method='GET', url=url, headers=headers) response = self.send(request, **kwargs) return response def replace_catalog( self, catalog_identifier: str, *, id: str = None, rev: str = None, label: str = None, short_description: str = None, catalog_icon_url: str = None, tags: List[str] = None, features: List['Feature'] = None, disabled: bool = None, resource_group_id: str = None, owning_account: str = None, catalog_filters: 'Filters' = None, syndication_settings: 'SyndicationResource' = None, kind: str = None, **kwargs ) -> DetailedResponse: """ Update catalog. Update a catalog. :param str catalog_identifier: Catalog identifier. :param str id: (optional) Unique ID. :param str rev: (optional) Cloudant revision. :param str label: (optional) Display Name in the requested language. :param str short_description: (optional) Description in the requested language. :param str catalog_icon_url: (optional) URL for an icon associated with this catalog. :param List[str] tags: (optional) List of tags associated with this catalog. :param List[Feature] features: (optional) List of features associated with this catalog. :param bool disabled: (optional) Denotes whether a catalog is disabled. :param str resource_group_id: (optional) Resource group id the catalog is owned by. :param str owning_account: (optional) Account that owns catalog. :param Filters catalog_filters: (optional) Filters for account and catalog filters. :param SyndicationResource syndication_settings: (optional) Feature information. :param str kind: (optional) Kind of catalog. Supported kinds are offering and vpe. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `Catalog` object """ if catalog_identifier is None: raise ValueError('catalog_identifier must be provided') if features is not None: features = [convert_model(x) for x in features] if catalog_filters is not None: catalog_filters = convert_model(catalog_filters) if syndication_settings is not None: syndication_settings = convert_model(syndication_settings) headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='replace_catalog' ) headers.update(sdk_headers) data = { 'id': id, '_rev': rev, 'label': label, 'short_description': short_description, 'catalog_icon_url': catalog_icon_url, 'tags': tags, 'features': features, 'disabled': disabled, 'resource_group_id': resource_group_id, 'owning_account': owning_account, 'catalog_filters': catalog_filters, 'syndication_settings': syndication_settings, 'kind': kind, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) headers['content-type'] = 'application/json' if 'headers' in kwargs: headers.update(kwargs.get('headers')) headers['Accept'] = 'application/json' path_param_keys = ['catalog_identifier'] path_param_values = self.encode_path_vars(catalog_identifier) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/catalogs/{catalog_identifier}'.format(**path_param_dict) request = self.prepare_request(method='PUT', url=url, headers=headers, data=data) response = self.send(request, **kwargs) return response def delete_catalog(self, catalog_identifier: str, **kwargs) -> DetailedResponse: """ Delete catalog. Delete a catalog. :param str catalog_identifier: Catalog identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if catalog_identifier is None: raise ValueError('catalog_identifier must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='delete_catalog' ) headers.update(sdk_headers) if 'headers' in kwargs: headers.update(kwargs.get('headers')) path_param_keys = ['catalog_identifier'] path_param_values = self.encode_path_vars(catalog_identifier) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/catalogs/{catalog_identifier}'.format(**path_param_dict) request = self.prepare_request(method='DELETE', url=url, headers=headers) response = self.send(request, **kwargs) return response def get_catalog_audit(self, catalog_identifier: str, **kwargs) -> DetailedResponse: """ Get catalog audit log. Get the audit log associated with a catalog. :param str catalog_identifier: Catalog identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `AuditLog` object """ if catalog_identifier is None: raise ValueError('catalog_identifier must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='get_catalog_audit' ) headers.update(sdk_headers) if 'headers' in kwargs: headers.update(kwargs.get('headers')) headers['Accept'] = 'application/json' path_param_keys = ['catalog_identifier'] path_param_values = self.encode_path_vars(catalog_identifier) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/catalogs/{catalog_identifier}/audit'.format(**path_param_dict) request = self.prepare_request(method='GET', url=url, headers=headers) response = self.send(request, **kwargs) return response ######################### # Offerings ######################### def get_consumption_offerings( self, *, digest: bool = None, catalog: str = None, select: str = None, include_hidden: bool = None, limit: int = None, offset: int = None, **kwargs ) -> DetailedResponse: """ Get consumption offerings. Retrieve the available offerings from both public and from the account that currently scoped for consumption. These copies cannot be used for updating. They are not complete and only return what is visible to the caller. This can be used by an unauthenticated user to retreive publicly available offerings. :param bool digest: (optional) true - Strip down the content of what is returned. For example don't return the readme. Makes the result much smaller. Defaults to false. :param str catalog: (optional) catalog id. Narrow search down to just a particular catalog. It will apply the catalog's public filters to the public catalog offerings on the result. :param str select: (optional) What should be selected. Default is 'all' which will return both public and private offerings. 'public' returns only the public offerings and 'private' returns only the private offerings. :param bool include_hidden: (optional) true - include offerings which have been marked as hidden. The default is false and hidden offerings are not returned. :param int limit: (optional) number or results to return. :param int offset: (optional) number of results to skip before returning values. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `OfferingSearchResult` object """ headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='get_consumption_offerings' ) headers.update(sdk_headers) params = { 'digest': digest, 'catalog': catalog, 'select': select, 'includeHidden': include_hidden, 'limit': limit, 'offset': offset, } if 'headers' in kwargs: headers.update(kwargs.get('headers')) headers['Accept'] = 'application/json' url = '/offerings' request = self.prepare_request(method='GET', url=url, headers=headers, params=params) response = self.send(request, **kwargs) return response def list_offerings( self, catalog_identifier: str, *, digest: bool = None, limit: int = None, offset: int = None, name: str = None, sort: str = None, **kwargs ) -> DetailedResponse: """ Get list of offerings. Retrieve the available offerings in the specified catalog. This can also be used by an unauthenticated user to retreive publicly available offerings. :param str catalog_identifier: Catalog identifier. :param bool digest: (optional) true - Strip down the content of what is returned. For example don't return the readme. Makes the result much smaller. Defaults to false. :param int limit: (optional) The maximum number of results to return. :param int offset: (optional) The number of results to skip before returning values. :param str name: (optional) Only return results that contain the specified string. :param str sort: (optional) The field on which the output is sorted. Sorts by default by **label** property. Available fields are **name**, **label**, **created**, and **updated**. By adding **-** (i.e. **-label**) in front of the query string, you can specify descending order. Default is ascending order. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `OfferingSearchResult` object """ if catalog_identifier is None: raise ValueError('catalog_identifier must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='list_offerings' ) headers.update(sdk_headers) params = {'digest': digest, 'limit': limit, 'offset': offset, 'name': name, 'sort': sort} if 'headers' in kwargs: headers.update(kwargs.get('headers')) headers['Accept'] = 'application/json' path_param_keys = ['catalog_identifier'] path_param_values = self.encode_path_vars(catalog_identifier) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/catalogs/{catalog_identifier}/offerings'.format(**path_param_dict) request = self.prepare_request(method='GET', url=url, headers=headers, params=params) response = self.send(request, **kwargs) return response def create_offering( self, catalog_identifier: str, *, id: str = None, rev: str = None, url: str = None, crn: str = None, label: str = None, name: str = None, offering_icon_url: str = None, offering_docs_url: str = None, offering_support_url: str = None, tags: List[str] = None, keywords: List[str] = None, rating: 'Rating' = None, created: datetime = None, updated: datetime = None, short_description: str = None, long_description: str = None, features: List['Feature'] = None, kinds: List['Kind'] = None, permit_request_ibm_public_publish: bool = None, ibm_publish_approved: bool = None, public_publish_approved: bool = None, public_original_crn: str = None, publish_public_crn: str = None, portal_approval_record: str = None, portal_ui_url: str = None, catalog_id: str = None, catalog_name: str = None, metadata: dict = None, disclaimer: str = None, hidden: bool = None, provider: str = None, provider_info: 'ProviderInfo' = None, repo_info: 'RepoInfo' = None, support: 'Support' = None, media: List['MediaItem'] = None, **kwargs ) -> DetailedResponse: """ Create offering. Create an offering. :param str catalog_identifier: Catalog identifier. :param str id: (optional) unique id. :param str rev: (optional) Cloudant revision. :param str url: (optional) The url for this specific offering. :param str crn: (optional) The crn for this specific offering. :param str label: (optional) Display Name in the requested language. :param str name: (optional) The programmatic name of this offering. :param str offering_icon_url: (optional) URL for an icon associated with this offering. :param str offering_docs_url: (optional) URL for an additional docs with this offering. :param str offering_support_url: (optional) [deprecated] - Use offering.support instead. URL to be displayed in the Consumption UI for getting support on this offering. :param List[str] tags: (optional) List of tags associated with this catalog. :param List[str] keywords: (optional) List of keywords associated with offering, typically used to search for it. :param Rating rating: (optional) Repository info for offerings. :param datetime created: (optional) The date and time this catalog was created. :param datetime updated: (optional) The date and time this catalog was last updated. :param str short_description: (optional) Short description in the requested language. :param str long_description: (optional) Long description in the requested language. :param List[Feature] features: (optional) list of features associated with this offering. :param List[Kind] kinds: (optional) Array of kind. :param bool permit_request_ibm_public_publish: (optional) Is it permitted to request publishing to IBM or Public. :param bool ibm_publish_approved: (optional) Indicates if this offering has been approved for use by all IBMers. :param bool public_publish_approved: (optional) Indicates if this offering has been approved for use by all IBM Cloud users. :param str public_original_crn: (optional) The original offering CRN that this publish entry came from. :param str publish_public_crn: (optional) The crn of the public catalog entry of this offering. :param str portal_approval_record: (optional) The portal's approval record ID. :param str portal_ui_url: (optional) The portal UI URL. :param str catalog_id: (optional) The id of the catalog containing this offering. :param str catalog_name: (optional) The name of the catalog. :param dict metadata: (optional) Map of metadata values for this offering. :param str disclaimer: (optional) A disclaimer for this offering. :param bool hidden: (optional) Determine if this offering should be displayed in the Consumption UI. :param str provider: (optional) Deprecated - Provider of this offering. :param ProviderInfo provider_info: (optional) Information on the provider for this offering, or omitted if no provider information is given. :param RepoInfo repo_info: (optional) Repository info for offerings. :param Support support: (optional) Offering Support information. :param List[MediaItem] media: (optional) A list of media items related to this offering. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `Offering` object """ if catalog_identifier is None: raise ValueError('catalog_identifier must be provided') if rating is not None: rating = convert_model(rating) if created is not None: created = datetime_to_string(created) if updated is not None: updated = datetime_to_string(updated) if features is not None: features = [convert_model(x) for x in features] if kinds is not None: kinds = [convert_model(x) for x in kinds] if provider_info is not None: provider_info = convert_model(provider_info) if repo_info is not None: repo_info = convert_model(repo_info) if support is not None: support = convert_model(support) if media is not None: media = [convert_model(x) for x in media] headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='create_offering' ) headers.update(sdk_headers) data = { 'id': id, '_rev': rev, 'url': url, 'crn': crn, 'label': label, 'name': name, 'offering_icon_url': offering_icon_url, 'offering_docs_url': offering_docs_url, 'offering_support_url': offering_support_url, 'tags': tags, 'keywords': keywords, 'rating': rating, 'created': created, 'updated': updated, 'short_description': short_description, 'long_description': long_description, 'features': features, 'kinds': kinds, 'permit_request_ibm_public_publish': permit_request_ibm_public_publish, 'ibm_publish_approved': ibm_publish_approved, 'public_publish_approved': public_publish_approved, 'public_original_crn': public_original_crn, 'publish_public_crn': publish_public_crn, 'portal_approval_record': portal_approval_record, 'portal_ui_url': portal_ui_url, 'catalog_id': catalog_id, 'catalog_name': catalog_name, 'metadata': metadata, 'disclaimer': disclaimer, 'hidden': hidden, 'provider': provider, 'provider_info': provider_info, 'repo_info': repo_info, 'support': support, 'media': media, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) headers['content-type'] = 'application/json' if 'headers' in kwargs: headers.update(kwargs.get('headers')) headers['Accept'] = 'application/json' path_param_keys = ['catalog_identifier'] path_param_values = self.encode_path_vars(catalog_identifier) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/catalogs/{catalog_identifier}/offerings'.format(**path_param_dict) request = self.prepare_request(method='POST', url=url, headers=headers, data=data) response = self.send(request, **kwargs) return response def import_offering_version( self, catalog_identifier: str, offering_id: str, *, tags: List[str] = None, target_kinds: List[str] = None, content: bytes = None, zipurl: str = None, target_version: str = None, include_config: bool = None, is_vsi: bool = None, repo_type: str = None, **kwargs ) -> DetailedResponse: """ Import offering version. Import new version to offering from a tgz. :param str catalog_identifier: Catalog identifier. :param str offering_id: Offering identification. :param List[str] tags: (optional) Tags array. :param List[str] target_kinds: (optional) Target kinds. Current valid values are 'iks', 'roks', 'vcenter', and 'terraform'. :param bytes content: (optional) byte array representing the content to be imported. Only supported for OVA images at this time. :param str zipurl: (optional) URL path to zip location. If not specified, must provide content in the body of this call. :param str target_version: (optional) The semver value for this new version, if not found in the zip url package content. :param bool include_config: (optional) Add all possible configuration values to this version when importing. :param bool is_vsi: (optional) Indicates that the current terraform template is used to install a VSI Image. :param str repo_type: (optional) The type of repository containing this version. Valid values are 'public_git' or 'enterprise_git'. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `Offering` object """ if catalog_identifier is None: raise ValueError('catalog_identifier must be provided') if offering_id is None: raise ValueError('offering_id must be provided') if content is not None: content = str(base64.b64encode(content), 'utf-8') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='import_offering_version' ) headers.update(sdk_headers) params = { 'zipurl': zipurl, 'targetVersion': target_version, 'includeConfig': include_config, 'isVSI': is_vsi, 'repoType': repo_type, } data = {'tags': tags, 'target_kinds': target_kinds, 'content': content} data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) headers['content-type'] = 'application/json' if 'headers' in kwargs: headers.update(kwargs.get('headers')) headers['Accept'] = 'application/json' path_param_keys = ['catalog_identifier', 'offering_id'] path_param_values = self.encode_path_vars(catalog_identifier, offering_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/catalogs/{catalog_identifier}/offerings/{offering_id}/version'.format(**path_param_dict) request = self.prepare_request(method='POST', url=url, headers=headers, params=params, data=data) response = self.send(request, **kwargs) return response def import_offering( self, catalog_identifier: str, *, tags: List[str] = None, target_kinds: List[str] = None, content: bytes = None, zipurl: str = None, offering_id: str = None, target_version: str = None, include_config: bool = None, is_vsi: bool = None, repo_type: str = None, x_auth_token: str = None, **kwargs ) -> DetailedResponse: """ Import offering. Import a new offering from a tgz. :param str catalog_identifier: Catalog identifier. :param List[str] tags: (optional) Tags array. :param List[str] target_kinds: (optional) Target kinds. Current valid values are 'iks', 'roks', 'vcenter', and 'terraform'. :param bytes content: (optional) byte array representing the content to be imported. Only supported for OVA images at this time. :param str zipurl: (optional) URL path to zip location. If not specified, must provide content in this post body. :param str offering_id: (optional) Re-use the specified offeringID during import. :param str target_version: (optional) The semver value for this new version. :param bool include_config: (optional) Add all possible configuration items when creating this version. :param bool is_vsi: (optional) Indicates that the current terraform template is used to install a VSI Image. :param str repo_type: (optional) The type of repository containing this version. Valid values are 'public_git' or 'enterprise_git'. :param str x_auth_token: (optional) Authentication token used to access the specified zip file. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `Offering` object """ if catalog_identifier is None: raise ValueError('catalog_identifier must be provided') if content is not None: content = str(base64.b64encode(content), 'utf-8') headers = {'X-Auth-Token': x_auth_token} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='import_offering' ) headers.update(sdk_headers) params = { 'zipurl': zipurl, 'offeringID': offering_id, 'targetVersion': target_version, 'includeConfig': include_config, 'isVSI': is_vsi, 'repoType': repo_type, } data = {'tags': tags, 'target_kinds': target_kinds, 'content': content} data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) headers['content-type'] = 'application/json' if 'headers' in kwargs: headers.update(kwargs.get('headers')) headers['Accept'] = 'application/json' path_param_keys = ['catalog_identifier'] path_param_values = self.encode_path_vars(catalog_identifier) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/catalogs/{catalog_identifier}/import/offerings'.format(**path_param_dict) request = self.prepare_request(method='POST', url=url, headers=headers, params=params, data=data) response = self.send(request, **kwargs) return response def reload_offering( self, catalog_identifier: str, offering_id: str, target_version: str, *, tags: List[str] = None, target_kinds: List[str] = None, content: bytes = None, zipurl: str = None, repo_type: str = None, **kwargs ) -> DetailedResponse: """ Reload offering. Reload an existing version in offering from a tgz. :param str catalog_identifier: Catalog identifier. :param str offering_id: Offering identification. :param str target_version: The semver value for this new version. :param List[str] tags: (optional) Tags array. :param List[str] target_kinds: (optional) Target kinds. Current valid values are 'iks', 'roks', 'vcenter', and 'terraform'. :param bytes content: (optional) byte array representing the content to be imported. Only supported for OVA images at this time. :param str zipurl: (optional) URL path to zip location. If not specified, must provide content in this post body. :param str repo_type: (optional) The type of repository containing this version. Valid values are 'public_git' or 'enterprise_git'. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `Offering` object """ if catalog_identifier is None: raise ValueError('catalog_identifier must be provided') if offering_id is None: raise ValueError('offering_id must be provided') if target_version is None: raise ValueError('target_version must be provided') if content is not None: content = str(base64.b64encode(content), 'utf-8') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='reload_offering' ) headers.update(sdk_headers) params = {'targetVersion': target_version, 'zipurl': zipurl, 'repoType': repo_type} data = {'tags': tags, 'target_kinds': target_kinds, 'content': content} data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) headers['content-type'] = 'application/json' if 'headers' in kwargs: headers.update(kwargs.get('headers')) headers['Accept'] = 'application/json' path_param_keys = ['catalog_identifier', 'offering_id'] path_param_values = self.encode_path_vars(catalog_identifier, offering_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/catalogs/{catalog_identifier}/offerings/{offering_id}/reload'.format(**path_param_dict) request = self.prepare_request(method='PUT', url=url, headers=headers, params=params, data=data) response = self.send(request, **kwargs) return response def get_offering( self, catalog_identifier: str, offering_id: str, *, type: str = None, digest: bool = None, **kwargs ) -> DetailedResponse: """ Get offering. Get an offering. This can be used by an unauthenticated user for publicly available offerings. :param str catalog_identifier: Catalog identifier. :param str offering_id: Offering identification. :param str type: (optional) Offering Parameter Type. Valid values are 'name' or 'id'. Default is 'id'. :param bool digest: (optional) Return the digest format of the specified offering. Default is false. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `Offering` object """ if catalog_identifier is None: raise ValueError('catalog_identifier must be provided') if offering_id is None: raise ValueError('offering_id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='get_offering' ) headers.update(sdk_headers) params = {'type': type, 'digest': digest} if 'headers' in kwargs: headers.update(kwargs.get('headers')) headers['Accept'] = 'application/json' path_param_keys = ['catalog_identifier', 'offering_id'] path_param_values = self.encode_path_vars(catalog_identifier, offering_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/catalogs/{catalog_identifier}/offerings/{offering_id}'.format(**path_param_dict) request = self.prepare_request(method='GET', url=url, headers=headers, params=params) response = self.send(request, **kwargs) return response def replace_offering( self, catalog_identifier: str, offering_id: str, *, id: str = None, rev: str = None, url: str = None, crn: str = None, label: str = None, name: str = None, offering_icon_url: str = None, offering_docs_url: str = None, offering_support_url: str = None, tags: List[str] = None, keywords: List[str] = None, rating: 'Rating' = None, created: datetime = None, updated: datetime = None, short_description: str = None, long_description: str = None, features: List['Feature'] = None, kinds: List['Kind'] = None, permit_request_ibm_public_publish: bool = None, ibm_publish_approved: bool = None, public_publish_approved: bool = None, public_original_crn: str = None, publish_public_crn: str = None, portal_approval_record: str = None, portal_ui_url: str = None, catalog_id: str = None, catalog_name: str = None, metadata: dict = None, disclaimer: str = None, hidden: bool = None, provider: str = None, provider_info: 'ProviderInfo' = None, repo_info: 'RepoInfo' = None, support: 'Support' = None, media: List['MediaItem'] = None, **kwargs ) -> DetailedResponse: """ Update offering. Update an offering. :param str catalog_identifier: Catalog identifier. :param str offering_id: Offering identification. :param str id: (optional) unique id. :param str rev: (optional) Cloudant revision. :param str url: (optional) The url for this specific offering. :param str crn: (optional) The crn for this specific offering. :param str label: (optional) Display Name in the requested language. :param str name: (optional) The programmatic name of this offering. :param str offering_icon_url: (optional) URL for an icon associated with this offering. :param str offering_docs_url: (optional) URL for an additional docs with this offering. :param str offering_support_url: (optional) [deprecated] - Use offering.support instead. URL to be displayed in the Consumption UI for getting support on this offering. :param List[str] tags: (optional) List of tags associated with this catalog. :param List[str] keywords: (optional) List of keywords associated with offering, typically used to search for it. :param Rating rating: (optional) Repository info for offerings. :param datetime created: (optional) The date and time this catalog was created. :param datetime updated: (optional) The date and time this catalog was last updated. :param str short_description: (optional) Short description in the requested language. :param str long_description: (optional) Long description in the requested language. :param List[Feature] features: (optional) list of features associated with this offering. :param List[Kind] kinds: (optional) Array of kind. :param bool permit_request_ibm_public_publish: (optional) Is it permitted to request publishing to IBM or Public. :param bool ibm_publish_approved: (optional) Indicates if this offering has been approved for use by all IBMers. :param bool public_publish_approved: (optional) Indicates if this offering has been approved for use by all IBM Cloud users. :param str public_original_crn: (optional) The original offering CRN that this publish entry came from. :param str publish_public_crn: (optional) The crn of the public catalog entry of this offering. :param str portal_approval_record: (optional) The portal's approval record ID. :param str portal_ui_url: (optional) The portal UI URL. :param str catalog_id: (optional) The id of the catalog containing this offering. :param str catalog_name: (optional) The name of the catalog. :param dict metadata: (optional) Map of metadata values for this offering. :param str disclaimer: (optional) A disclaimer for this offering. :param bool hidden: (optional) Determine if this offering should be displayed in the Consumption UI. :param str provider: (optional) Deprecated - Provider of this offering. :param ProviderInfo provider_info: (optional) Information on the provider for this offering, or omitted if no provider information is given. :param RepoInfo repo_info: (optional) Repository info for offerings. :param Support support: (optional) Offering Support information. :param List[MediaItem] media: (optional) A list of media items related to this offering. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `Offering` object """ if catalog_identifier is None: raise ValueError('catalog_identifier must be provided') if offering_id is None: raise ValueError('offering_id must be provided') if rating is not None: rating = convert_model(rating) if created is not None: created = datetime_to_string(created) if updated is not None: updated = datetime_to_string(updated) if features is not None: features = [convert_model(x) for x in features] if kinds is not None: kinds = [convert_model(x) for x in kinds] if provider_info is not None: provider_info = convert_model(provider_info) if repo_info is not None: repo_info = convert_model(repo_info) if support is not None: support = convert_model(support) if media is not None: media = [convert_model(x) for x in media] headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='replace_offering' ) headers.update(sdk_headers) data = { 'id': id, '_rev': rev, 'url': url, 'crn': crn, 'label': label, 'name': name, 'offering_icon_url': offering_icon_url, 'offering_docs_url': offering_docs_url, 'offering_support_url': offering_support_url, 'tags': tags, 'keywords': keywords, 'rating': rating, 'created': created, 'updated': updated, 'short_description': short_description, 'long_description': long_description, 'features': features, 'kinds': kinds, 'permit_request_ibm_public_publish': permit_request_ibm_public_publish, 'ibm_publish_approved': ibm_publish_approved, 'public_publish_approved': public_publish_approved, 'public_original_crn': public_original_crn, 'publish_public_crn': publish_public_crn, 'portal_approval_record': portal_approval_record, 'portal_ui_url': portal_ui_url, 'catalog_id': catalog_id, 'catalog_name': catalog_name, 'metadata': metadata, 'disclaimer': disclaimer, 'hidden': hidden, 'provider': provider, 'provider_info': provider_info, 'repo_info': repo_info, 'support': support, 'media': media, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) headers['content-type'] = 'application/json' if 'headers' in kwargs: headers.update(kwargs.get('headers')) headers['Accept'] = 'application/json' path_param_keys = ['catalog_identifier', 'offering_id'] path_param_values = self.encode_path_vars(catalog_identifier, offering_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/catalogs/{catalog_identifier}/offerings/{offering_id}'.format(**path_param_dict) request = self.prepare_request(method='PUT', url=url, headers=headers, data=data) response = self.send(request, **kwargs) return response def update_offering( self, catalog_identifier: str, offering_id: str, if_match: str, *, updates: List['JsonPatchOperation'] = None, **kwargs ) -> DetailedResponse: """ Update offering. Update an offering. :param str catalog_identifier: Catalog identifier. :param str offering_id: Offering identification. :param str if_match: Offering etag contained in quotes. :param List[JsonPatchOperation] updates: (optional) :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `Offering` object """ if catalog_identifier is None: raise ValueError('catalog_identifier must be provided') if offering_id is None: raise ValueError('offering_id must be provided') if if_match is None: raise ValueError('if_match must be provided') if updates is not None: updates = [convert_model(x) for x in updates] headers = {'If-Match': if_match} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='update_offering' ) headers.update(sdk_headers) data = json.dumps(updates) headers['content-type'] = 'application/json-patch+json' if 'headers' in kwargs: headers.update(kwargs.get('headers')) headers['Accept'] = 'application/json' path_param_keys = ['catalog_identifier', 'offering_id'] path_param_values = self.encode_path_vars(catalog_identifier, offering_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/catalogs/{catalog_identifier}/offerings/{offering_id}'.format(**path_param_dict) request = self.prepare_request(method='PATCH', url=url, headers=headers, data=data) response = self.send(request, **kwargs) return response def delete_offering(self, catalog_identifier: str, offering_id: str, **kwargs) -> DetailedResponse: """ Delete offering. Delete an offering. :param str catalog_identifier: Catalog identifier. :param str offering_id: Offering identification. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if catalog_identifier is None: raise ValueError('catalog_identifier must be provided') if offering_id is None: raise ValueError('offering_id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='delete_offering' ) headers.update(sdk_headers) if 'headers' in kwargs: headers.update(kwargs.get('headers')) path_param_keys = ['catalog_identifier', 'offering_id'] path_param_values = self.encode_path_vars(catalog_identifier, offering_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/catalogs/{catalog_identifier}/offerings/{offering_id}'.format(**path_param_dict) request = self.prepare_request(method='DELETE', url=url, headers=headers) response = self.send(request, **kwargs) return response def get_offering_audit(self, catalog_identifier: str, offering_id: str, **kwargs) -> DetailedResponse: """ Get offering audit log. Get the audit log associated with an offering. :param str catalog_identifier: Catalog identifier. :param str offering_id: Offering identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `AuditLog` object """ if catalog_identifier is None: raise ValueError('catalog_identifier must be provided') if offering_id is None: raise ValueError('offering_id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='get_offering_audit' ) headers.update(sdk_headers) if 'headers' in kwargs: headers.update(kwargs.get('headers')) headers['Accept'] = 'application/json' path_param_keys = ['catalog_identifier', 'offering_id'] path_param_values = self.encode_path_vars(catalog_identifier, offering_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/catalogs/{catalog_identifier}/offerings/{offering_id}/audit'.format(**path_param_dict) request = self.prepare_request(method='GET', url=url, headers=headers) response = self.send(request, **kwargs) return response def replace_offering_icon( self, catalog_identifier: str, offering_id: str, file_name: str, **kwargs ) -> DetailedResponse: """ Upload icon for offering. Upload an icon file to be stored in GC. File is uploaded as a binary payload - not as a form. :param str catalog_identifier: Catalog identifier. :param str offering_id: Offering identification. :param str file_name: Name of the file name that is being uploaded. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `Offering` object """ if catalog_identifier is None: raise ValueError('catalog_identifier must be provided') if offering_id is None: raise ValueError('offering_id must be provided') if file_name is None: raise ValueError('file_name must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='replace_offering_icon' ) headers.update(sdk_headers) if 'headers' in kwargs: headers.update(kwargs.get('headers')) headers['Accept'] = 'application/json' path_param_keys = ['catalog_identifier', 'offering_id', 'file_name'] path_param_values = self.encode_path_vars(catalog_identifier, offering_id, file_name) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/catalogs/{catalog_identifier}/offerings/{offering_id}/icon/{file_name}'.format(**path_param_dict) request = self.prepare_request(method='PUT', url=url, headers=headers) response = self.send(request, **kwargs) return response def update_offering_ibm( self, catalog_identifier: str, offering_id: str, approval_type: str, approved: str, **kwargs ) -> DetailedResponse: """ Allow offering to be published. Approve or disapprove the offering to be allowed to publish to the IBM Public Catalog. Options: * `allow_request` - (Allow requesting to publish to IBM) * `ibm` - (Allow publishing to be visible to IBM only) * `public` - (Allow publishing to be visible to everyone, including IBM) If disapprove `public`, then `ibm` approval will not be changed. If disapprove `ibm` then `public` will automatically be disapproved. if disapprove `allow_request` then all rights to publish will be removed. This is because the process steps always go first through `allow` to `ibm` and then to `public`. `ibm` cannot be skipped. Only users with Approval IAM authority can use this. Approvers should use the catalog and offering id from the public catalog since they wouldn't have access to the private offering. :param str catalog_identifier: Catalog identifier. :param str offering_id: Offering identification. :param str approval_type: Type of approval, ibm or public. :param str approved: Approve (true) or disapprove (false). :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `ApprovalResult` object """ if catalog_identifier is None: raise ValueError('catalog_identifier must be provided') if offering_id is None: raise ValueError('offering_id must be provided') if approval_type is None: raise ValueError('approval_type must be provided') if approved is None: raise ValueError('approved must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='update_offering_ibm' ) headers.update(sdk_headers) if 'headers' in kwargs: headers.update(kwargs.get('headers')) headers['Accept'] = 'application/json' path_param_keys = ['catalog_identifier', 'offering_id', 'approval_type', 'approved'] path_param_values = self.encode_path_vars(catalog_identifier, offering_id, approval_type, approved) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/catalogs/{catalog_identifier}/offerings/{offering_id}/publish/{approval_type}/{approved}'.format( **path_param_dict ) request = self.prepare_request(method='POST', url=url, headers=headers) response = self.send(request, **kwargs) return response def deprecate_offering( self, catalog_identifier: str, offering_id: str, setting: str, *, description: str = None, days_until_deprecate: int = None, **kwargs ) -> DetailedResponse: """ Allows offering to be deprecated. Approve or disapprove the offering to be deprecated. :param str catalog_identifier: Catalog identifier. :param str offering_id: Offering identification. :param str setting: Set deprecation (true) or cancel deprecation (false). :param str description: (optional) Additional information that users can provide to be displayed in deprecation notification. :param int days_until_deprecate: (optional) Specifies the amount of days until product is not available in catalog. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if catalog_identifier is None: raise ValueError('catalog_identifier must be provided') if offering_id is None: raise ValueError('offering_id must be provided') if setting is None: raise ValueError('setting must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='deprecate_offering' ) headers.update(sdk_headers) data = {'description': description, 'days_until_deprecate': days_until_deprecate} data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) headers['content-type'] = 'application/json' if 'headers' in kwargs: headers.update(kwargs.get('headers')) path_param_keys = ['catalog_identifier', 'offering_id', 'setting'] path_param_values = self.encode_path_vars(catalog_identifier, offering_id, setting) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/catalogs/{catalog_identifier}/offerings/{offering_id}/deprecate/{setting}'.format(**path_param_dict) request = self.prepare_request(method='POST', url=url, headers=headers, data=data) response = self.send(request, **kwargs) return response def get_offering_updates( self, catalog_identifier: str, offering_id: str, kind: str, x_auth_refresh_token: str, *, target: str = None, version: str = None, cluster_id: str = None, region: str = None, resource_group_id: str = None, namespace: str = None, sha: str = None, channel: str = None, namespaces: List[str] = None, all_namespaces: bool = None, **kwargs ) -> DetailedResponse: """ Get version updates. Get available updates for the specified version. :param str catalog_identifier: Catalog identifier. :param str offering_id: Offering identification. :param str kind: The kind of offering (e.g, helm, ova, terraform ...). :param str x_auth_refresh_token: IAM Refresh token. :param str target: (optional) The target kind of the currently installed version (e.g. iks, roks, etc). :param str version: (optional) optionaly provide an existing version to check updates for if one is not given, all version will be returned. :param str cluster_id: (optional) The id of the cluster where this version was installed. :param str region: (optional) The region of the cluster where this version was installed. :param str resource_group_id: (optional) The resource group id of the cluster where this version was installed. :param str namespace: (optional) The namespace of the cluster where this version was installed. :param str sha: (optional) The sha value of the currently installed version. :param str channel: (optional) Optionally provide the channel value of the currently installed version. :param List[str] namespaces: (optional) Optionally provide a list of namespaces used for the currently installed version. :param bool all_namespaces: (optional) Optionally indicate that the current version was installed in all namespaces. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `List[VersionUpdateDescriptor]` result """ if catalog_identifier is None: raise ValueError('catalog_identifier must be provided') if offering_id is None: raise ValueError('offering_id must be provided') if kind is None: raise ValueError('kind must be provided') if x_auth_refresh_token is None: raise ValueError('x_auth_refresh_token must be provided') headers = {'X-Auth-Refresh-Token': x_auth_refresh_token} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='get_offering_updates' ) headers.update(sdk_headers) params = { 'kind': kind, 'target': target, 'version': version, 'cluster_id': cluster_id, 'region': region, 'resource_group_id': resource_group_id, 'namespace': namespace, 'sha': sha, 'channel': channel, 'namespaces': convert_list(namespaces), 'all_namespaces': all_namespaces, } if 'headers' in kwargs: headers.update(kwargs.get('headers')) headers['Accept'] = 'application/json' path_param_keys = ['catalog_identifier', 'offering_id'] path_param_values = self.encode_path_vars(catalog_identifier, offering_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/catalogs/{catalog_identifier}/offerings/{offering_id}/updates'.format(**path_param_dict) request = self.prepare_request(method='GET', url=url, headers=headers, params=params) response = self.send(request, **kwargs) return response def get_offering_source( self, version: str, *, accept: str = None, catalog_id: str = None, name: str = None, id: str = None, kind: str = None, channel: str = None, **kwargs ) -> DetailedResponse: """ Get offering source. Get an offering's source. This request requires authorization, even for public offerings. :param str version: The version being requested. :param str accept: (optional) The type of the response: application/yaml, application/json, or application/x-gzip. :param str catalog_id: (optional) Catlaog ID. If not specified, this value will default to the public catalog. :param str name: (optional) Offering name. An offering name or ID must be specified. :param str id: (optional) Offering id. An offering name or ID must be specified. :param str kind: (optional) The kind of offering (e.g. helm, ova, terraform...). :param str channel: (optional) The channel value of the specified version. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `BinaryIO` result """ if version is None: raise ValueError('version must be provided') headers = {'Accept': accept} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='get_offering_source' ) headers.update(sdk_headers) params = {'version': version, 'catalogID': catalog_id, 'name': name, 'id': id, 'kind': kind, 'channel': channel} if 'headers' in kwargs: headers.update(kwargs.get('headers')) url = '/offering/source' request = self.prepare_request(method='GET', url=url, headers=headers, params=params) response = self.send(request, **kwargs) return response ######################### # Versions ######################### def get_offering_about(self, version_loc_id: str, **kwargs) -> DetailedResponse: """ Get version about information. Get the about information, in markdown, for the current version. :param str version_loc_id: A dotted value of `catalogID`.`versionID`. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `str` result """ if version_loc_id is None: raise ValueError('version_loc_id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='get_offering_about' ) headers.update(sdk_headers) if 'headers' in kwargs: headers.update(kwargs.get('headers')) headers['Accept'] = 'text/markdown' path_param_keys = ['version_loc_id'] path_param_values = self.encode_path_vars(version_loc_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/versions/{version_loc_id}/about'.format(**path_param_dict) request = self.prepare_request(method='GET', url=url, headers=headers) response = self.send(request, **kwargs) return response def get_offering_license(self, version_loc_id: str, license_id: str, **kwargs) -> DetailedResponse: """ Get version license content. Get the license content for the specified license ID in the specified version. :param str version_loc_id: A dotted value of `catalogID`.`versionID`. :param str license_id: The ID of the license, which maps to the file name in the 'licenses' directory of this verions tgz file. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `str` result """ if version_loc_id is None: raise ValueError('version_loc_id must be provided') if license_id is None: raise ValueError('license_id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='get_offering_license' ) headers.update(sdk_headers) if 'headers' in kwargs: headers.update(kwargs.get('headers')) headers['Accept'] = 'text/plain' path_param_keys = ['version_loc_id', 'license_id'] path_param_values = self.encode_path_vars(version_loc_id, license_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/versions/{version_loc_id}/licenses/{license_id}'.format(**path_param_dict) request = self.prepare_request(method='GET', url=url, headers=headers) response = self.send(request, **kwargs) return response def get_offering_container_images(self, version_loc_id: str, **kwargs) -> DetailedResponse: """ Get version's container images. Get the list of container images associated with the specified version. The "image_manifest_url" property of the version should be the URL for the image manifest, and the operation will return that content. :param str version_loc_id: A dotted value of `catalogID`.`versionID`. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `ImageManifest` object """ if version_loc_id is None: raise ValueError('version_loc_id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='get_offering_container_images' ) headers.update(sdk_headers) if 'headers' in kwargs: headers.update(kwargs.get('headers')) headers['Accept'] = 'application/json' path_param_keys = ['version_loc_id'] path_param_values = self.encode_path_vars(version_loc_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/versions/{version_loc_id}/containerImages'.format(**path_param_dict) request = self.prepare_request(method='GET', url=url, headers=headers) response = self.send(request, **kwargs) return response def deprecate_version(self, version_loc_id: str, **kwargs) -> DetailedResponse: """ Deprecate version immediately. Deprecate the specified version. :param str version_loc_id: A dotted value of `catalogID`.`versionID`. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if version_loc_id is None: raise ValueError('version_loc_id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='deprecate_version' ) headers.update(sdk_headers) if 'headers' in kwargs: headers.update(kwargs.get('headers')) path_param_keys = ['version_loc_id'] path_param_values = self.encode_path_vars(version_loc_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/versions/{version_loc_id}/deprecate'.format(**path_param_dict) request = self.prepare_request(method='POST', url=url, headers=headers) response = self.send(request, **kwargs) return response def set_deprecate_version( self, version_loc_id: str, setting: str, *, description: str = None, days_until_deprecate: int = None, **kwargs ) -> DetailedResponse: """ Sets version to be deprecated in a certain time period. Set or cancel the version to be deprecated. :param str version_loc_id: A dotted value of `catalogID`.`versionID`. :param str setting: Set deprecation (true) or cancel deprecation (false). :param str description: (optional) Additional information that users can provide to be displayed in deprecation notification. :param int days_until_deprecate: (optional) Specifies the amount of days until product is not available in catalog. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if version_loc_id is None: raise ValueError('version_loc_id must be provided') if setting is None: raise ValueError('setting must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='set_deprecate_version' ) headers.update(sdk_headers) data = {'description': description, 'days_until_deprecate': days_until_deprecate} data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) headers['content-type'] = 'application/json' if 'headers' in kwargs: headers.update(kwargs.get('headers')) path_param_keys = ['version_loc_id', 'setting'] path_param_values = self.encode_path_vars(version_loc_id, setting) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/versions/{version_loc_id}/deprecate/{setting}'.format(**path_param_dict) request = self.prepare_request(method='POST', url=url, headers=headers, data=data) response = self.send(request, **kwargs) return response def account_publish_version(self, version_loc_id: str, **kwargs) -> DetailedResponse: """ Publish version to account members. Publish the specified version so it is viewable by account members. :param str version_loc_id: A dotted value of `catalogID`.`versionID`. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if version_loc_id is None: raise ValueError('version_loc_id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='account_publish_version' ) headers.update(sdk_headers) if 'headers' in kwargs: headers.update(kwargs.get('headers')) path_param_keys = ['version_loc_id'] path_param_values = self.encode_path_vars(version_loc_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/versions/{version_loc_id}/account-publish'.format(**path_param_dict) request = self.prepare_request(method='POST', url=url, headers=headers) response = self.send(request, **kwargs) return response def ibm_publish_version(self, version_loc_id: str, **kwargs) -> DetailedResponse: """ Publish version to IBMers in public catalog. Publish the specified version so that it is visible to IBMers in the public catalog. :param str version_loc_id: A dotted value of `catalogID`.`versionID`. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if version_loc_id is None: raise ValueError('version_loc_id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='ibm_publish_version' ) headers.update(sdk_headers) if 'headers' in kwargs: headers.update(kwargs.get('headers')) path_param_keys = ['version_loc_id'] path_param_values = self.encode_path_vars(version_loc_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/versions/{version_loc_id}/ibm-publish'.format(**path_param_dict) request = self.prepare_request(method='POST', url=url, headers=headers) response = self.send(request, **kwargs) return response def public_publish_version(self, version_loc_id: str, **kwargs) -> DetailedResponse: """ Publish version to all users in public catalog. Publish the specified version so it is visible to all users in the public catalog. :param str version_loc_id: A dotted value of `catalogID`.`versionID`. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if version_loc_id is None: raise ValueError('version_loc_id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='public_publish_version' ) headers.update(sdk_headers) if 'headers' in kwargs: headers.update(kwargs.get('headers')) path_param_keys = ['version_loc_id'] path_param_values = self.encode_path_vars(version_loc_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/versions/{version_loc_id}/public-publish'.format(**path_param_dict) request = self.prepare_request(method='POST', url=url, headers=headers) response = self.send(request, **kwargs) return response def commit_version(self, version_loc_id: str, **kwargs) -> DetailedResponse: """ Commit version. Commit a working copy of the specified version. :param str version_loc_id: A dotted value of `catalogID`.`versionID`. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if version_loc_id is None: raise ValueError('version_loc_id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='commit_version' ) headers.update(sdk_headers) if 'headers' in kwargs: headers.update(kwargs.get('headers')) path_param_keys = ['version_loc_id'] path_param_values = self.encode_path_vars(version_loc_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/versions/{version_loc_id}/commit'.format(**path_param_dict) request = self.prepare_request(method='POST', url=url, headers=headers) response = self.send(request, **kwargs) return response def copy_version( self, version_loc_id: str, *, tags: List[str] = None, target_kinds: List[str] = None, content: bytes = None, **kwargs ) -> DetailedResponse: """ Copy version to new target kind. Copy the specified version to a new target kind within the same offering. :param str version_loc_id: A dotted value of `catalogID`.`versionID`. :param List[str] tags: (optional) Tags array. :param List[str] target_kinds: (optional) Target kinds. Current valid values are 'iks', 'roks', 'vcenter', and 'terraform'. :param bytes content: (optional) byte array representing the content to be imported. Only supported for OVA images at this time. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if version_loc_id is None: raise ValueError('version_loc_id must be provided') if content is not None: content = str(base64.b64encode(content), 'utf-8') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='copy_version' ) headers.update(sdk_headers) data = {'tags': tags, 'target_kinds': target_kinds, 'content': content} data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) headers['content-type'] = 'application/json' if 'headers' in kwargs: headers.update(kwargs.get('headers')) path_param_keys = ['version_loc_id'] path_param_values = self.encode_path_vars(version_loc_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/versions/{version_loc_id}/copy'.format(**path_param_dict) request = self.prepare_request(method='POST', url=url, headers=headers, data=data) response = self.send(request, **kwargs) return response def get_offering_working_copy(self, version_loc_id: str, **kwargs) -> DetailedResponse: """ Create working copy of version. Create a working copy of the specified version. :param str version_loc_id: A dotted value of `catalogID`.`versionID`. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `Version` object """ if version_loc_id is None: raise ValueError('version_loc_id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='get_offering_working_copy' ) headers.update(sdk_headers) if 'headers' in kwargs: headers.update(kwargs.get('headers')) headers['Accept'] = 'application/json' path_param_keys = ['version_loc_id'] path_param_values = self.encode_path_vars(version_loc_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/versions/{version_loc_id}/workingcopy'.format(**path_param_dict) request = self.prepare_request(method='POST', url=url, headers=headers) response = self.send(request, **kwargs) return response def get_version(self, version_loc_id: str, **kwargs) -> DetailedResponse: """ Get offering/kind/version 'branch'. Get the Offering/Kind/Version 'branch' for the specified locator ID. :param str version_loc_id: A dotted value of `catalogID`.`versionID`. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `Offering` object """ if version_loc_id is None: raise ValueError('version_loc_id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='get_version' ) headers.update(sdk_headers) if 'headers' in kwargs: headers.update(kwargs.get('headers')) headers['Accept'] = 'application/json' path_param_keys = ['version_loc_id'] path_param_values = self.encode_path_vars(version_loc_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/versions/{version_loc_id}'.format(**path_param_dict) request = self.prepare_request(method='GET', url=url, headers=headers) response = self.send(request, **kwargs) return response def delete_version(self, version_loc_id: str, **kwargs) -> DetailedResponse: """ Delete version. Delete the specified version. If the version is an active version with a working copy, the working copy will be deleted as well. :param str version_loc_id: A dotted value of `catalogID`.`versionID`. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if version_loc_id is None: raise ValueError('version_loc_id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='delete_version' ) headers.update(sdk_headers) if 'headers' in kwargs: headers.update(kwargs.get('headers')) path_param_keys = ['version_loc_id'] path_param_values = self.encode_path_vars(version_loc_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/versions/{version_loc_id}'.format(**path_param_dict) request = self.prepare_request(method='DELETE', url=url, headers=headers) response = self.send(request, **kwargs) return response ######################### # Deploy ######################### def get_cluster(self, cluster_id: str, region: str, x_auth_refresh_token: str, **kwargs) -> DetailedResponse: """ Get kubernetes cluster. Get the contents of the specified kubernetes cluster. :param str cluster_id: ID of the cluster. :param str region: Region of the cluster. :param str x_auth_refresh_token: IAM Refresh token. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `ClusterInfo` object """ if cluster_id is None: raise ValueError('cluster_id must be provided') if region is None: raise ValueError('region must be provided') if x_auth_refresh_token is None: raise ValueError('x_auth_refresh_token must be provided') headers = {'X-Auth-Refresh-Token': x_auth_refresh_token} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='get_cluster' ) headers.update(sdk_headers) params = {'region': region} if 'headers' in kwargs: headers.update(kwargs.get('headers')) headers['Accept'] = 'application/json' path_param_keys = ['cluster_id'] path_param_values = self.encode_path_vars(cluster_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/deploy/kubernetes/clusters/{cluster_id}'.format(**path_param_dict) request = self.prepare_request(method='GET', url=url, headers=headers, params=params) response = self.send(request, **kwargs) return response def get_namespaces( self, cluster_id: str, region: str, x_auth_refresh_token: str, *, limit: int = None, offset: int = None, **kwargs ) -> DetailedResponse: """ Get cluster namespaces. Get the namespaces associated with the specified kubernetes cluster. :param str cluster_id: ID of the cluster. :param str region: Cluster region. :param str x_auth_refresh_token: IAM Refresh token. :param int limit: (optional) The maximum number of results to return. :param int offset: (optional) The number of results to skip before returning values. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `NamespaceSearchResult` object """ if cluster_id is None: raise ValueError('cluster_id must be provided') if region is None: raise ValueError('region must be provided') if x_auth_refresh_token is None: raise ValueError('x_auth_refresh_token must be provided') headers = {'X-Auth-Refresh-Token': x_auth_refresh_token} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='get_namespaces' ) headers.update(sdk_headers) params = {'region': region, 'limit': limit, 'offset': offset} if 'headers' in kwargs: headers.update(kwargs.get('headers')) headers['Accept'] = 'application/json' path_param_keys = ['cluster_id'] path_param_values = self.encode_path_vars(cluster_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/deploy/kubernetes/clusters/{cluster_id}/namespaces'.format(**path_param_dict) request = self.prepare_request(method='GET', url=url, headers=headers, params=params) response = self.send(request, **kwargs) return response def deploy_operators( self, x_auth_refresh_token: str, *, cluster_id: str = None, region: str = None, namespaces: List[str] = None, all_namespaces: bool = None, version_locator_id: str = None, **kwargs ) -> DetailedResponse: """ Deploy operators. Deploy operators on a kubernetes cluster. :param str x_auth_refresh_token: IAM Refresh token. :param str cluster_id: (optional) Cluster ID. :param str region: (optional) Cluster region. :param List[str] namespaces: (optional) Kube namespaces to deploy Operator(s) to. :param bool all_namespaces: (optional) Denotes whether to install Operator(s) globally. :param str version_locator_id: (optional) A dotted value of `catalogID`.`versionID`. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `List[OperatorDeployResult]` result """ if x_auth_refresh_token is None: raise ValueError('x_auth_refresh_token must be provided') headers = {'X-Auth-Refresh-Token': x_auth_refresh_token} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='deploy_operators' ) headers.update(sdk_headers) data = { 'cluster_id': cluster_id, 'region': region, 'namespaces': namespaces, 'all_namespaces': all_namespaces, 'version_locator_id': version_locator_id, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) headers['content-type'] = 'application/json' if 'headers' in kwargs: headers.update(kwargs.get('headers')) headers['Accept'] = 'application/json' url = '/deploy/kubernetes/olm/operator' request = self.prepare_request(method='POST', url=url, headers=headers, data=data) response = self.send(request, **kwargs) return response def list_operators( self, x_auth_refresh_token: str, cluster_id: str, region: str, version_locator_id: str, **kwargs ) -> DetailedResponse: """ List operators. List the operators from a kubernetes cluster. :param str x_auth_refresh_token: IAM Refresh token. :param str cluster_id: Cluster identification. :param str region: Cluster region. :param str version_locator_id: A dotted value of `catalogID`.`versionID`. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `List[OperatorDeployResult]` result """ if x_auth_refresh_token is None: raise ValueError('x_auth_refresh_token must be provided') if cluster_id is None: raise ValueError('cluster_id must be provided') if region is None: raise ValueError('region must be provided') if version_locator_id is None: raise ValueError('version_locator_id must be provided') headers = {'X-Auth-Refresh-Token': x_auth_refresh_token} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='list_operators' ) headers.update(sdk_headers) params = {'cluster_id': cluster_id, 'region': region, 'version_locator_id': version_locator_id} if 'headers' in kwargs: headers.update(kwargs.get('headers')) headers['Accept'] = 'application/json' url = '/deploy/kubernetes/olm/operator' request = self.prepare_request(method='GET', url=url, headers=headers, params=params) response = self.send(request, **kwargs) return response def replace_operators( self, x_auth_refresh_token: str, *, cluster_id: str = None, region: str = None, namespaces: List[str] = None, all_namespaces: bool = None, version_locator_id: str = None, **kwargs ) -> DetailedResponse: """ Update operators. Update the operators on a kubernetes cluster. :param str x_auth_refresh_token: IAM Refresh token. :param str cluster_id: (optional) Cluster ID. :param str region: (optional) Cluster region. :param List[str] namespaces: (optional) Kube namespaces to deploy Operator(s) to. :param bool all_namespaces: (optional) Denotes whether to install Operator(s) globally. :param str version_locator_id: (optional) A dotted value of `catalogID`.`versionID`. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `List[OperatorDeployResult]` result """ if x_auth_refresh_token is None: raise ValueError('x_auth_refresh_token must be provided') headers = {'X-Auth-Refresh-Token': x_auth_refresh_token} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='replace_operators' ) headers.update(sdk_headers) data = { 'cluster_id': cluster_id, 'region': region, 'namespaces': namespaces, 'all_namespaces': all_namespaces, 'version_locator_id': version_locator_id, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) headers['content-type'] = 'application/json' if 'headers' in kwargs: headers.update(kwargs.get('headers')) headers['Accept'] = 'application/json' url = '/deploy/kubernetes/olm/operator' request = self.prepare_request(method='PUT', url=url, headers=headers, data=data) response = self.send(request, **kwargs) return response def delete_operators( self, x_auth_refresh_token: str, cluster_id: str, region: str, version_locator_id: str, **kwargs ) -> DetailedResponse: """ Delete operators. Delete operators from a kubernetes cluster. :param str x_auth_refresh_token: IAM Refresh token. :param str cluster_id: Cluster identification. :param str region: Cluster region. :param str version_locator_id: A dotted value of `catalogID`.`versionID`. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if x_auth_refresh_token is None: raise ValueError('x_auth_refresh_token must be provided') if cluster_id is None: raise ValueError('cluster_id must be provided') if region is None: raise ValueError('region must be provided') if version_locator_id is None: raise ValueError('version_locator_id must be provided') headers = {'X-Auth-Refresh-Token': x_auth_refresh_token} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='delete_operators' ) headers.update(sdk_headers) params = {'cluster_id': cluster_id, 'region': region, 'version_locator_id': version_locator_id} if 'headers' in kwargs: headers.update(kwargs.get('headers')) url = '/deploy/kubernetes/olm/operator' request = self.prepare_request(method='DELETE', url=url, headers=headers, params=params) response = self.send(request, **kwargs) return response def install_version( self, version_loc_id: str, x_auth_refresh_token: str, *, cluster_id: str = None, region: str = None, namespace: str = None, override_values: dict = None, entitlement_apikey: str = None, schematics: 'DeployRequestBodySchematics' = None, script: str = None, script_id: str = None, version_locator_id: str = None, vcenter_id: str = None, vcenter_user: str = None, vcenter_password: str = None, vcenter_location: str = None, vcenter_datastore: str = None, **kwargs ) -> DetailedResponse: """ Install version. Create an install for the specified version. :param str version_loc_id: A dotted value of `catalogID`.`versionID`. :param str x_auth_refresh_token: IAM Refresh token. :param str cluster_id: (optional) Cluster ID. :param str region: (optional) Cluster region. :param str namespace: (optional) Kube namespace. :param dict override_values: (optional) Object containing Helm chart override values. To use a secret for items of type password, specify a JSON encoded value of $ref:#/components/schemas/SecretInstance, prefixed with `cmsm_v1:`. :param str entitlement_apikey: (optional) Entitlement API Key for this offering. :param DeployRequestBodySchematics schematics: (optional) Schematics workspace configuration. :param str script: (optional) Script. :param str script_id: (optional) Script ID. :param str version_locator_id: (optional) A dotted value of `catalogID`.`versionID`. :param str vcenter_id: (optional) VCenter ID. :param str vcenter_user: (optional) VCenter User. :param str vcenter_password: (optional) VCenter Password. :param str vcenter_location: (optional) VCenter Location. :param str vcenter_datastore: (optional) VCenter Datastore. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if version_loc_id is None: raise ValueError('version_loc_id must be provided') if x_auth_refresh_token is None: raise ValueError('x_auth_refresh_token must be provided') if schematics is not None: schematics = convert_model(schematics) headers = {'X-Auth-Refresh-Token': x_auth_refresh_token} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='install_version' ) headers.update(sdk_headers) data = { 'cluster_id': cluster_id, 'region': region, 'namespace': namespace, 'override_values': override_values, 'entitlement_apikey': entitlement_apikey, 'schematics': schematics, 'script': script, 'script_id': script_id, 'version_locator_id': version_locator_id, 'vcenter_id': vcenter_id, 'vcenter_user': vcenter_user, 'vcenter_password': vcenter_password, 'vcenter_location': vcenter_location, 'vcenter_datastore': vcenter_datastore, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) headers['content-type'] = 'application/json' if 'headers' in kwargs: headers.update(kwargs.get('headers')) path_param_keys = ['version_loc_id'] path_param_values = self.encode_path_vars(version_loc_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/versions/{version_loc_id}/install'.format(**path_param_dict) request = self.prepare_request(method='POST', url=url, headers=headers, data=data) response = self.send(request, **kwargs) return response def preinstall_version( self, version_loc_id: str, x_auth_refresh_token: str, *, cluster_id: str = None, region: str = None, namespace: str = None, override_values: dict = None, entitlement_apikey: str = None, schematics: 'DeployRequestBodySchematics' = None, script: str = None, script_id: str = None, version_locator_id: str = None, vcenter_id: str = None, vcenter_user: str = None, vcenter_password: str = None, vcenter_location: str = None, vcenter_datastore: str = None, **kwargs ) -> DetailedResponse: """ Pre-install version. Create a pre-install for the specified version. :param str version_loc_id: A dotted value of `catalogID`.`versionID`. :param str x_auth_refresh_token: IAM Refresh token. :param str cluster_id: (optional) Cluster ID. :param str region: (optional) Cluster region. :param str namespace: (optional) Kube namespace. :param dict override_values: (optional) Object containing Helm chart override values. To use a secret for items of type password, specify a JSON encoded value of $ref:#/components/schemas/SecretInstance, prefixed with `cmsm_v1:`. :param str entitlement_apikey: (optional) Entitlement API Key for this offering. :param DeployRequestBodySchematics schematics: (optional) Schematics workspace configuration. :param str script: (optional) Script. :param str script_id: (optional) Script ID. :param str version_locator_id: (optional) A dotted value of `catalogID`.`versionID`. :param str vcenter_id: (optional) VCenter ID. :param str vcenter_user: (optional) VCenter User. :param str vcenter_password: (optional) VCenter Password. :param str vcenter_location: (optional) VCenter Location. :param str vcenter_datastore: (optional) VCenter Datastore. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if version_loc_id is None: raise ValueError('version_loc_id must be provided') if x_auth_refresh_token is None: raise ValueError('x_auth_refresh_token must be provided') if schematics is not None: schematics = convert_model(schematics) headers = {'X-Auth-Refresh-Token': x_auth_refresh_token} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='preinstall_version' ) headers.update(sdk_headers) data = { 'cluster_id': cluster_id, 'region': region, 'namespace': namespace, 'override_values': override_values, 'entitlement_apikey': entitlement_apikey, 'schematics': schematics, 'script': script, 'script_id': script_id, 'version_locator_id': version_locator_id, 'vcenter_id': vcenter_id, 'vcenter_user': vcenter_user, 'vcenter_password': vcenter_password, 'vcenter_location': vcenter_location, 'vcenter_datastore': vcenter_datastore, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) headers['content-type'] = 'application/json' if 'headers' in kwargs: headers.update(kwargs.get('headers')) path_param_keys = ['version_loc_id'] path_param_values = self.encode_path_vars(version_loc_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/versions/{version_loc_id}/preinstall'.format(**path_param_dict) request = self.prepare_request(method='POST', url=url, headers=headers, data=data) response = self.send(request, **kwargs) return response def get_preinstall( self, version_loc_id: str, x_auth_refresh_token: str, *, cluster_id: str = None, region: str = None, namespace: str = None, **kwargs ) -> DetailedResponse: """ Get version pre-install status. Get the pre-install status for the specified version. :param str version_loc_id: A dotted value of `catalogID`.`versionID`. :param str x_auth_refresh_token: IAM Refresh token. :param str cluster_id: (optional) ID of the cluster. :param str region: (optional) Cluster region. :param str namespace: (optional) Required if the version's pre-install scope is `namespace`. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `InstallStatus` object """ if version_loc_id is None: raise ValueError('version_loc_id must be provided') if x_auth_refresh_token is None: raise ValueError('x_auth_refresh_token must be provided') headers = {'X-Auth-Refresh-Token': x_auth_refresh_token} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='get_preinstall' ) headers.update(sdk_headers) params = {'cluster_id': cluster_id, 'region': region, 'namespace': namespace} if 'headers' in kwargs: headers.update(kwargs.get('headers')) headers['Accept'] = 'application/json' path_param_keys = ['version_loc_id'] path_param_values = self.encode_path_vars(version_loc_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/versions/{version_loc_id}/preinstall'.format(**path_param_dict) request = self.prepare_request(method='GET', url=url, headers=headers, params=params) response = self.send(request, **kwargs) return response def validate_install( self, version_loc_id: str, x_auth_refresh_token: str, *, cluster_id: str = None, region: str = None, namespace: str = None, override_values: dict = None, entitlement_apikey: str = None, schematics: 'DeployRequestBodySchematics' = None, script: str = None, script_id: str = None, version_locator_id: str = None, vcenter_id: str = None, vcenter_user: str = None, vcenter_password: str = None, vcenter_location: str = None, vcenter_datastore: str = None, **kwargs ) -> DetailedResponse: """ Validate offering. Validate the offering associated with the specified version. :param str version_loc_id: A dotted value of `catalogID`.`versionID`. :param str x_auth_refresh_token: IAM Refresh token. :param str cluster_id: (optional) Cluster ID. :param str region: (optional) Cluster region. :param str namespace: (optional) Kube namespace. :param dict override_values: (optional) Object containing Helm chart override values. To use a secret for items of type password, specify a JSON encoded value of $ref:#/components/schemas/SecretInstance, prefixed with `cmsm_v1:`. :param str entitlement_apikey: (optional) Entitlement API Key for this offering. :param DeployRequestBodySchematics schematics: (optional) Schematics workspace configuration. :param str script: (optional) Script. :param str script_id: (optional) Script ID. :param str version_locator_id: (optional) A dotted value of `catalogID`.`versionID`. :param str vcenter_id: (optional) VCenter ID. :param str vcenter_user: (optional) VCenter User. :param str vcenter_password: (optional) VCenter Password. :param str vcenter_location: (optional) VCenter Location. :param str vcenter_datastore: (optional) VCenter Datastore. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if version_loc_id is None: raise ValueError('version_loc_id must be provided') if x_auth_refresh_token is None: raise ValueError('x_auth_refresh_token must be provided') if schematics is not None: schematics = convert_model(schematics) headers = {'X-Auth-Refresh-Token': x_auth_refresh_token} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='validate_install' ) headers.update(sdk_headers) data = { 'cluster_id': cluster_id, 'region': region, 'namespace': namespace, 'override_values': override_values, 'entitlement_apikey': entitlement_apikey, 'schematics': schematics, 'script': script, 'script_id': script_id, 'version_locator_id': version_locator_id, 'vcenter_id': vcenter_id, 'vcenter_user': vcenter_user, 'vcenter_password': vcenter_password, 'vcenter_location': vcenter_location, 'vcenter_datastore': vcenter_datastore, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) headers['content-type'] = 'application/json' if 'headers' in kwargs: headers.update(kwargs.get('headers')) path_param_keys = ['version_loc_id'] path_param_values = self.encode_path_vars(version_loc_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/versions/{version_loc_id}/validation/install'.format(**path_param_dict) request = self.prepare_request(method='POST', url=url, headers=headers, data=data) response = self.send(request, **kwargs) return response def get_validation_status(self, version_loc_id: str, x_auth_refresh_token: str, **kwargs) -> DetailedResponse: """ Get offering install status. Returns the install status for the specified offering version. :param str version_loc_id: A dotted value of `catalogID`.`versionID`. :param str x_auth_refresh_token: IAM Refresh token. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `Validation` object """ if version_loc_id is None: raise ValueError('version_loc_id must be provided') if x_auth_refresh_token is None: raise ValueError('x_auth_refresh_token must be provided') headers = {'X-Auth-Refresh-Token': x_auth_refresh_token} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='get_validation_status' ) headers.update(sdk_headers) if 'headers' in kwargs: headers.update(kwargs.get('headers')) headers['Accept'] = 'application/json' path_param_keys = ['version_loc_id'] path_param_values = self.encode_path_vars(version_loc_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/versions/{version_loc_id}/validation/install'.format(**path_param_dict) request = self.prepare_request(method='GET', url=url, headers=headers) response = self.send(request, **kwargs) return response def get_override_values(self, version_loc_id: str, **kwargs) -> DetailedResponse: """ Get override values. Returns the override values that were used to validate the specified offering version. :param str version_loc_id: A dotted value of `catalogID`.`versionID`. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result """ if version_loc_id is None: raise ValueError('version_loc_id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='get_override_values' ) headers.update(sdk_headers) if 'headers' in kwargs: headers.update(kwargs.get('headers')) headers['Accept'] = 'application/json' path_param_keys = ['version_loc_id'] path_param_values = self.encode_path_vars(version_loc_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/versions/{version_loc_id}/validation/overridevalues'.format(**path_param_dict) request = self.prepare_request(method='GET', url=url, headers=headers) response = self.send(request, **kwargs) return response ######################### # Objects ######################### def search_objects( self, query: str, *, limit: int = None, offset: int = None, collapse: bool = None, digest: bool = None, **kwargs ) -> DetailedResponse: """ List objects across catalogs. List the available objects from both public and private catalogs. These copies cannot be used for updating. They are not complete and only return what is visible to the caller. :param str query: Lucene query string. :param int limit: (optional) The maximum number of results to return. :param int offset: (optional) The number of results to skip before returning values. :param bool collapse: (optional) When true, hide private objects that correspond to public or IBM published objects. :param bool digest: (optional) Display a digests of search results, has default value of true. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `ObjectSearchResult` object """ if query is None: raise ValueError('query must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='search_objects' ) headers.update(sdk_headers) params = {'query': query, 'limit': limit, 'offset': offset, 'collapse': collapse, 'digest': digest} if 'headers' in kwargs: headers.update(kwargs.get('headers')) headers['Accept'] = 'application/json' url = '/objects' request = self.prepare_request(method='GET', url=url, headers=headers, params=params) response = self.send(request, **kwargs) return response def list_objects( self, catalog_identifier: str, *, limit: int = None, offset: int = None, name: str = None, sort: str = None, **kwargs ) -> DetailedResponse: """ List objects within a catalog. List the available objects within the specified catalog. :param str catalog_identifier: Catalog identifier. :param int limit: (optional) The number of results to return. :param int offset: (optional) The number of results to skip before returning values. :param str name: (optional) Only return results that contain the specified string. :param str sort: (optional) The field on which the output is sorted. Sorts by default by **label** property. Available fields are **name**, **label**, **created**, and **updated**. By adding **-** (i.e. **-label**) in front of the query string, you can specify descending order. Default is ascending order. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `ObjectListResult` object """ if catalog_identifier is None: raise ValueError('catalog_identifier must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='list_objects' ) headers.update(sdk_headers) params = {'limit': limit, 'offset': offset, 'name': name, 'sort': sort} if 'headers' in kwargs: headers.update(kwargs.get('headers')) headers['Accept'] = 'application/json' path_param_keys = ['catalog_identifier'] path_param_values = self.encode_path_vars(catalog_identifier) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/catalogs/{catalog_identifier}/objects'.format(**path_param_dict) request = self.prepare_request(method='GET', url=url, headers=headers, params=params) response = self.send(request, **kwargs) return response def create_object( self, catalog_identifier: str, *, id: str = None, name: str = None, rev: str = None, crn: str = None, url: str = None, parent_id: str = None, label_i18n: str = None, label: str = None, tags: List[str] = None, created: datetime = None, updated: datetime = None, short_description: str = None, short_description_i18n: str = None, kind: str = None, publish: 'PublishObject' = None, state: 'State' = None, catalog_id: str = None, catalog_name: str = None, data: dict = None, **kwargs ) -> DetailedResponse: """ Create catalog object. Create an object with a specific catalog. :param str catalog_identifier: Catalog identifier. :param str id: (optional) unique id. :param str name: (optional) The programmatic name of this offering. :param str rev: (optional) Cloudant revision. :param str crn: (optional) The crn for this specific object. :param str url: (optional) The url for this specific object. :param str parent_id: (optional) The parent for this specific object. :param str label_i18n: (optional) Translated display name in the requested language. :param str label: (optional) Display name in the requested language. :param List[str] tags: (optional) List of tags associated with this catalog. :param datetime created: (optional) The date and time this catalog was created. :param datetime updated: (optional) The date and time this catalog was last updated. :param str short_description: (optional) Short description in the requested language. :param str short_description_i18n: (optional) Short description translation. :param str kind: (optional) Kind of object. :param PublishObject publish: (optional) Publish information. :param State state: (optional) Offering state. :param str catalog_id: (optional) The id of the catalog containing this offering. :param str catalog_name: (optional) The name of the catalog. :param dict data: (optional) Map of data values for this object. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `CatalogObject` object """ if catalog_identifier is None: raise ValueError('catalog_identifier must be provided') if created is not None: created = datetime_to_string(created) if updated is not None: updated = datetime_to_string(updated) if publish is not None: publish = convert_model(publish) if state is not None: state = convert_model(state) headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='create_object' ) headers.update(sdk_headers) data = { 'id': id, 'name': name, '_rev': rev, 'crn': crn, 'url': url, 'parent_id': parent_id, 'label_i18n': label_i18n, 'label': label, 'tags': tags, 'created': created, 'updated': updated, 'short_description': short_description, 'short_description_i18n': short_description_i18n, 'kind': kind, 'publish': publish, 'state': state, 'catalog_id': catalog_id, 'catalog_name': catalog_name, 'data': data, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) headers['content-type'] = 'application/json' if 'headers' in kwargs: headers.update(kwargs.get('headers')) headers['Accept'] = 'application/json' path_param_keys = ['catalog_identifier'] path_param_values = self.encode_path_vars(catalog_identifier) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/catalogs/{catalog_identifier}/objects'.format(**path_param_dict) request = self.prepare_request(method='POST', url=url, headers=headers, data=data) response = self.send(request, **kwargs) return response def get_object(self, catalog_identifier: str, object_identifier: str, **kwargs) -> DetailedResponse: """ Get catalog object. Get the specified object from within the specified catalog. :param str catalog_identifier: Catalog identifier. :param str object_identifier: Object identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `CatalogObject` object """ if catalog_identifier is None: raise ValueError('catalog_identifier must be provided') if object_identifier is None: raise ValueError('object_identifier must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='get_object' ) headers.update(sdk_headers) if 'headers' in kwargs: headers.update(kwargs.get('headers')) headers['Accept'] = 'application/json' path_param_keys = ['catalog_identifier', 'object_identifier'] path_param_values = self.encode_path_vars(catalog_identifier, object_identifier) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/catalogs/{catalog_identifier}/objects/{object_identifier}'.format(**path_param_dict) request = self.prepare_request(method='GET', url=url, headers=headers) response = self.send(request, **kwargs) return response def replace_object( self, catalog_identifier: str, object_identifier: str, *, id: str = None, name: str = None, rev: str = None, crn: str = None, url: str = None, parent_id: str = None, label_i18n: str = None, label: str = None, tags: List[str] = None, created: datetime = None, updated: datetime = None, short_description: str = None, short_description_i18n: str = None, kind: str = None, publish: 'PublishObject' = None, state: 'State' = None, catalog_id: str = None, catalog_name: str = None, data: dict = None, **kwargs ) -> DetailedResponse: """ Update catalog object. Update an object within a specific catalog. :param str catalog_identifier: Catalog identifier. :param str object_identifier: Object identifier. :param str id: (optional) unique id. :param str name: (optional) The programmatic name of this offering. :param str rev: (optional) Cloudant revision. :param str crn: (optional) The crn for this specific object. :param str url: (optional) The url for this specific object. :param str parent_id: (optional) The parent for this specific object. :param str label_i18n: (optional) Translated display name in the requested language. :param str label: (optional) Display name in the requested language. :param List[str] tags: (optional) List of tags associated with this catalog. :param datetime created: (optional) The date and time this catalog was created. :param datetime updated: (optional) The date and time this catalog was last updated. :param str short_description: (optional) Short description in the requested language. :param str short_description_i18n: (optional) Short description translation. :param str kind: (optional) Kind of object. :param PublishObject publish: (optional) Publish information. :param State state: (optional) Offering state. :param str catalog_id: (optional) The id of the catalog containing this offering. :param str catalog_name: (optional) The name of the catalog. :param dict data: (optional) Map of data values for this object. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `CatalogObject` object """ if catalog_identifier is None: raise ValueError('catalog_identifier must be provided') if object_identifier is None: raise ValueError('object_identifier must be provided') if created is not None: created = datetime_to_string(created) if updated is not None: updated = datetime_to_string(updated) if publish is not None: publish = convert_model(publish) if state is not None: state = convert_model(state) headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='replace_object' ) headers.update(sdk_headers) data = { 'id': id, 'name': name, '_rev': rev, 'crn': crn, 'url': url, 'parent_id': parent_id, 'label_i18n': label_i18n, 'label': label, 'tags': tags, 'created': created, 'updated': updated, 'short_description': short_description, 'short_description_i18n': short_description_i18n, 'kind': kind, 'publish': publish, 'state': state, 'catalog_id': catalog_id, 'catalog_name': catalog_name, 'data': data, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) headers['content-type'] = 'application/json' if 'headers' in kwargs: headers.update(kwargs.get('headers')) headers['Accept'] = 'application/json' path_param_keys = ['catalog_identifier', 'object_identifier'] path_param_values = self.encode_path_vars(catalog_identifier, object_identifier) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/catalogs/{catalog_identifier}/objects/{object_identifier}'.format(**path_param_dict) request = self.prepare_request(method='PUT', url=url, headers=headers, data=data) response = self.send(request, **kwargs) return response def delete_object(self, catalog_identifier: str, object_identifier: str, **kwargs) -> DetailedResponse: """ Delete catalog object. Delete a specific object within a specific catalog. :param str catalog_identifier: Catalog identifier. :param str object_identifier: Object identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if catalog_identifier is None: raise ValueError('catalog_identifier must be provided') if object_identifier is None: raise ValueError('object_identifier must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='delete_object' ) headers.update(sdk_headers) if 'headers' in kwargs: headers.update(kwargs.get('headers')) path_param_keys = ['catalog_identifier', 'object_identifier'] path_param_values = self.encode_path_vars(catalog_identifier, object_identifier) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/catalogs/{catalog_identifier}/objects/{object_identifier}'.format(**path_param_dict) request = self.prepare_request(method='DELETE', url=url, headers=headers) response = self.send(request, **kwargs) return response def get_object_audit(self, catalog_identifier: str, object_identifier: str, **kwargs) -> DetailedResponse: """ Get catalog object audit log. Get the audit log associated with a specific catalog object. :param str catalog_identifier: Catalog identifier. :param str object_identifier: Object identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `AuditLog` object """ if catalog_identifier is None: raise ValueError('catalog_identifier must be provided') if object_identifier is None: raise ValueError('object_identifier must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='get_object_audit' ) headers.update(sdk_headers) if 'headers' in kwargs: headers.update(kwargs.get('headers')) headers['Accept'] = 'application/json' path_param_keys = ['catalog_identifier', 'object_identifier'] path_param_values = self.encode_path_vars(catalog_identifier, object_identifier) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/catalogs/{catalog_identifier}/objects/{object_identifier}/audit'.format(**path_param_dict) request = self.prepare_request(method='GET', url=url, headers=headers) response = self.send(request, **kwargs) return response def account_publish_object(self, catalog_identifier: str, object_identifier: str, **kwargs) -> DetailedResponse: """ Publish object to account. Publish a catalog object to account. :param str catalog_identifier: Catalog identifier. :param str object_identifier: Object identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if catalog_identifier is None: raise ValueError('catalog_identifier must be provided') if object_identifier is None: raise ValueError('object_identifier must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='account_publish_object' ) headers.update(sdk_headers) if 'headers' in kwargs: headers.update(kwargs.get('headers')) path_param_keys = ['catalog_identifier', 'object_identifier'] path_param_values = self.encode_path_vars(catalog_identifier, object_identifier) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/catalogs/{catalog_identifier}/objects/{object_identifier}/account-publish'.format(**path_param_dict) request = self.prepare_request(method='POST', url=url, headers=headers) response = self.send(request, **kwargs) return response def shared_publish_object(self, catalog_identifier: str, object_identifier: str, **kwargs) -> DetailedResponse: """ Publish object to share with allow list. Publish the specified object so that it is visible to those in the allow list. :param str catalog_identifier: Catalog identifier. :param str object_identifier: Object identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if catalog_identifier is None: raise ValueError('catalog_identifier must be provided') if object_identifier is None: raise ValueError('object_identifier must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='shared_publish_object' ) headers.update(sdk_headers) if 'headers' in kwargs: headers.update(kwargs.get('headers')) path_param_keys = ['catalog_identifier', 'object_identifier'] path_param_values = self.encode_path_vars(catalog_identifier, object_identifier) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/catalogs/{catalog_identifier}/objects/{object_identifier}/shared-publish'.format(**path_param_dict) request = self.prepare_request(method='POST', url=url, headers=headers) response = self.send(request, **kwargs) return response def ibm_publish_object(self, catalog_identifier: str, object_identifier: str, **kwargs) -> DetailedResponse: """ Publish object to share with IBMers. Publish the specified object so that it is visible to IBMers in the public catalog. :param str catalog_identifier: Catalog identifier. :param str object_identifier: Object identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if catalog_identifier is None: raise ValueError('catalog_identifier must be provided') if object_identifier is None: raise ValueError('object_identifier must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='ibm_publish_object' ) headers.update(sdk_headers) if 'headers' in kwargs: headers.update(kwargs.get('headers')) path_param_keys = ['catalog_identifier', 'object_identifier'] path_param_values = self.encode_path_vars(catalog_identifier, object_identifier) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/catalogs/{catalog_identifier}/objects/{object_identifier}/ibm-publish'.format(**path_param_dict) request = self.prepare_request(method='POST', url=url, headers=headers) response = self.send(request, **kwargs) return response def public_publish_object(self, catalog_identifier: str, object_identifier: str, **kwargs) -> DetailedResponse: """ Publish object to share with all users. Publish the specified object so it is visible to all users in the public catalog. :param str catalog_identifier: Catalog identifier. :param str object_identifier: Object identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if catalog_identifier is None: raise ValueError('catalog_identifier must be provided') if object_identifier is None: raise ValueError('object_identifier must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='public_publish_object' ) headers.update(sdk_headers) if 'headers' in kwargs: headers.update(kwargs.get('headers')) path_param_keys = ['catalog_identifier', 'object_identifier'] path_param_values = self.encode_path_vars(catalog_identifier, object_identifier) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/catalogs/{catalog_identifier}/objects/{object_identifier}/public-publish'.format(**path_param_dict) request = self.prepare_request(method='POST', url=url, headers=headers) response = self.send(request, **kwargs) return response def create_object_access( self, catalog_identifier: str, object_identifier: str, account_identifier: str, **kwargs ) -> DetailedResponse: """ Add account ID to object access list. Add an account ID to an object's access list. :param str catalog_identifier: Catalog identifier. :param str object_identifier: Object identifier. :param str account_identifier: Account identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if catalog_identifier is None: raise ValueError('catalog_identifier must be provided') if object_identifier is None: raise ValueError('object_identifier must be provided') if account_identifier is None: raise ValueError('account_identifier must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='create_object_access' ) headers.update(sdk_headers) if 'headers' in kwargs: headers.update(kwargs.get('headers')) path_param_keys = ['catalog_identifier', 'object_identifier', 'account_identifier'] path_param_values = self.encode_path_vars(catalog_identifier, object_identifier, account_identifier) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/catalogs/{catalog_identifier}/objects/{object_identifier}/access/{account_identifier}'.format( **path_param_dict ) request = self.prepare_request(method='POST', url=url, headers=headers) response = self.send(request, **kwargs) return response def get_object_access( self, catalog_identifier: str, object_identifier: str, account_identifier: str, **kwargs ) -> DetailedResponse: """ Check for account ID in object access list. Determine if an account ID is in an object's access list. :param str catalog_identifier: Catalog identifier. :param str object_identifier: Object identifier. :param str account_identifier: Account identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `ObjectAccess` object """ if catalog_identifier is None: raise ValueError('catalog_identifier must be provided') if object_identifier is None: raise ValueError('object_identifier must be provided') if account_identifier is None: raise ValueError('account_identifier must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='get_object_access' ) headers.update(sdk_headers) if 'headers' in kwargs: headers.update(kwargs.get('headers')) headers['Accept'] = 'application/json' path_param_keys = ['catalog_identifier', 'object_identifier', 'account_identifier'] path_param_values = self.encode_path_vars(catalog_identifier, object_identifier, account_identifier) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/catalogs/{catalog_identifier}/objects/{object_identifier}/access/{account_identifier}'.format( **path_param_dict ) request = self.prepare_request(method='GET', url=url, headers=headers) response = self.send(request, **kwargs) return response def delete_object_access( self, catalog_identifier: str, object_identifier: str, account_identifier: str, **kwargs ) -> DetailedResponse: """ Remove account ID from object access list. Delete the specified account ID from the specified object's access list. :param str catalog_identifier: Catalog identifier. :param str object_identifier: Object identifier. :param str account_identifier: Account identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if catalog_identifier is None: raise ValueError('catalog_identifier must be provided') if object_identifier is None: raise ValueError('object_identifier must be provided') if account_identifier is None: raise ValueError('account_identifier must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='delete_object_access' ) headers.update(sdk_headers) if 'headers' in kwargs: headers.update(kwargs.get('headers')) path_param_keys = ['catalog_identifier', 'object_identifier', 'account_identifier'] path_param_values = self.encode_path_vars(catalog_identifier, object_identifier, account_identifier) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/catalogs/{catalog_identifier}/objects/{object_identifier}/access/{account_identifier}'.format( **path_param_dict ) request = self.prepare_request(method='DELETE', url=url, headers=headers) response = self.send(request, **kwargs) return response def get_object_access_list( self, catalog_identifier: str, object_identifier: str, *, limit: int = None, offset: int = None, **kwargs ) -> DetailedResponse: """ Get object access list. Get the access list associated with the specified object. :param str catalog_identifier: Catalog identifier. :param str object_identifier: Object identifier. :param int limit: (optional) The maximum number of results to return. :param int offset: (optional) The number of results to skip before returning values. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `ObjectAccessListResult` object """ if catalog_identifier is None: raise ValueError('catalog_identifier must be provided') if object_identifier is None: raise ValueError('object_identifier must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='get_object_access_list' ) headers.update(sdk_headers) params = {'limit': limit, 'offset': offset} if 'headers' in kwargs: headers.update(kwargs.get('headers')) headers['Accept'] = 'application/json' path_param_keys = ['catalog_identifier', 'object_identifier'] path_param_values = self.encode_path_vars(catalog_identifier, object_identifier) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/catalogs/{catalog_identifier}/objects/{object_identifier}/access'.format(**path_param_dict) request = self.prepare_request(method='GET', url=url, headers=headers, params=params) response = self.send(request, **kwargs) return response def delete_object_access_list( self, catalog_identifier: str, object_identifier: str, accounts: List[str], **kwargs ) -> DetailedResponse: """ Delete accounts from object access list. Delete all or a set of accounts from an object's access list. :param str catalog_identifier: Catalog identifier. :param str object_identifier: Object identifier. :param List[str] accounts: A list of accounts to delete. An entry with star["*"] will remove all accounts. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `AccessListBulkResponse` object """ if catalog_identifier is None: raise ValueError('catalog_identifier must be provided') if object_identifier is None: raise ValueError('object_identifier must be provided') if accounts is None: raise ValueError('accounts must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='delete_object_access_list' ) headers.update(sdk_headers) data = json.dumps(accounts) headers['content-type'] = 'application/json' if 'headers' in kwargs: headers.update(kwargs.get('headers')) headers['Accept'] = 'application/json' path_param_keys = ['catalog_identifier', 'object_identifier'] path_param_values = self.encode_path_vars(catalog_identifier, object_identifier) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/catalogs/{catalog_identifier}/objects/{object_identifier}/access'.format(**path_param_dict) request = self.prepare_request(method='DELETE', url=url, headers=headers, data=data) response = self.send(request, **kwargs) return response def add_object_access_list( self, catalog_identifier: str, object_identifier: str, accounts: List[str], **kwargs ) -> DetailedResponse: """ Add accounts to object access list. Add one or more accounts to the specified object's access list. :param str catalog_identifier: Catalog identifier. :param str object_identifier: Object identifier. :param List[str] accounts: A list of accounts to add. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `AccessListBulkResponse` object """ if catalog_identifier is None: raise ValueError('catalog_identifier must be provided') if object_identifier is None: raise ValueError('object_identifier must be provided') if accounts is None: raise ValueError('accounts must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='add_object_access_list' ) headers.update(sdk_headers) data = json.dumps(accounts) headers['content-type'] = 'application/json' if 'headers' in kwargs: headers.update(kwargs.get('headers')) headers['Accept'] = 'application/json' path_param_keys = ['catalog_identifier', 'object_identifier'] path_param_values = self.encode_path_vars(catalog_identifier, object_identifier) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/catalogs/{catalog_identifier}/objects/{object_identifier}/access'.format(**path_param_dict) request = self.prepare_request(method='POST', url=url, headers=headers, data=data) response = self.send(request, **kwargs) return response ######################### # Instances ######################### def create_offering_instance( self, x_auth_refresh_token: str, *, id: str = None, rev: str = None, url: str = None, crn: str = None, label: str = None, catalog_id: str = None, offering_id: str = None, kind_format: str = None, version: str = None, cluster_id: str = None, cluster_region: str = None, cluster_namespaces: List[str] = None, cluster_all_namespaces: bool = None, schematics_workspace_id: str = None, resource_group_id: str = None, install_plan: str = None, channel: str = None, metadata: dict = None, last_operation: 'OfferingInstanceLastOperation' = None, **kwargs ) -> DetailedResponse: """ Create an offering resource instance. Provision a new offering in a given account, and return its resource instance. :param str x_auth_refresh_token: IAM Refresh token. :param str id: (optional) provisioned instance ID (part of the CRN). :param str rev: (optional) Cloudant revision. :param str url: (optional) url reference to this object. :param str crn: (optional) platform CRN for this instance. :param str label: (optional) the label for this instance. :param str catalog_id: (optional) Catalog ID this instance was created from. :param str offering_id: (optional) Offering ID this instance was created from. :param str kind_format: (optional) the format this instance has (helm, operator, ova...). :param str version: (optional) The version this instance was installed from (not version id). :param str cluster_id: (optional) Cluster ID. :param str cluster_region: (optional) Cluster region (e.g., us-south). :param List[str] cluster_namespaces: (optional) List of target namespaces to install into. :param bool cluster_all_namespaces: (optional) designate to install into all namespaces. :param str schematics_workspace_id: (optional) Id of the schematics workspace, for offering instances provisioned through schematics. :param str resource_group_id: (optional) Id of the resource group to provision the offering instance into. :param str install_plan: (optional) Type of install plan (also known as approval strategy) for operator subscriptions. Can be either automatic, which automatically upgrades operators to the latest in a channel, or manual, which requires approval on the cluster. :param str channel: (optional) Channel to pin the operator subscription to. :param dict metadata: (optional) Map of metadata values for this offering instance. :param OfferingInstanceLastOperation last_operation: (optional) the last operation performed and status. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `OfferingInstance` object """ if x_auth_refresh_token is None: raise ValueError('x_auth_refresh_token must be provided') if last_operation is not None: last_operation = convert_model(last_operation) headers = {'X-Auth-Refresh-Token': x_auth_refresh_token} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='create_offering_instance' ) headers.update(sdk_headers) data = { 'id': id, '_rev': rev, 'url': url, 'crn': crn, 'label': label, 'catalog_id': catalog_id, 'offering_id': offering_id, 'kind_format': kind_format, 'version': version, 'cluster_id': cluster_id, 'cluster_region': cluster_region, 'cluster_namespaces': cluster_namespaces, 'cluster_all_namespaces': cluster_all_namespaces, 'schematics_workspace_id': schematics_workspace_id, 'resource_group_id': resource_group_id, 'install_plan': install_plan, 'channel': channel, 'metadata': metadata, 'last_operation': last_operation, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) headers['content-type'] = 'application/json' if 'headers' in kwargs: headers.update(kwargs.get('headers')) headers['Accept'] = 'application/json' url = '/instances/offerings' request = self.prepare_request(method='POST', url=url, headers=headers, data=data) response = self.send(request, **kwargs) return response def get_offering_instance(self, instance_identifier: str, **kwargs) -> DetailedResponse: """ Get Offering Instance. Get the resource associated with an installed offering instance. :param str instance_identifier: Version Instance identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `OfferingInstance` object """ if instance_identifier is None: raise ValueError('instance_identifier must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='get_offering_instance' ) headers.update(sdk_headers) if 'headers' in kwargs: headers.update(kwargs.get('headers')) headers['Accept'] = 'application/json' path_param_keys = ['instance_identifier'] path_param_values = self.encode_path_vars(instance_identifier) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/instances/offerings/{instance_identifier}'.format(**path_param_dict) request = self.prepare_request(method='GET', url=url, headers=headers) response = self.send(request, **kwargs) return response def put_offering_instance( self, instance_identifier: str, x_auth_refresh_token: str, *, id: str = None, rev: str = None, url: str = None, crn: str = None, label: str = None, catalog_id: str = None, offering_id: str = None, kind_format: str = None, version: str = None, cluster_id: str = None, cluster_region: str = None, cluster_namespaces: List[str] = None, cluster_all_namespaces: bool = None, schematics_workspace_id: str = None, resource_group_id: str = None, install_plan: str = None, channel: str = None, metadata: dict = None, last_operation: 'OfferingInstanceLastOperation' = None, **kwargs ) -> DetailedResponse: """ Update Offering Instance. Update an installed offering instance. :param str instance_identifier: Version Instance identifier. :param str x_auth_refresh_token: IAM Refresh token. :param str id: (optional) provisioned instance ID (part of the CRN). :param str rev: (optional) Cloudant revision. :param str url: (optional) url reference to this object. :param str crn: (optional) platform CRN for this instance. :param str label: (optional) the label for this instance. :param str catalog_id: (optional) Catalog ID this instance was created from. :param str offering_id: (optional) Offering ID this instance was created from. :param str kind_format: (optional) the format this instance has (helm, operator, ova...). :param str version: (optional) The version this instance was installed from (not version id). :param str cluster_id: (optional) Cluster ID. :param str cluster_region: (optional) Cluster region (e.g., us-south). :param List[str] cluster_namespaces: (optional) List of target namespaces to install into. :param bool cluster_all_namespaces: (optional) designate to install into all namespaces. :param str schematics_workspace_id: (optional) Id of the schematics workspace, for offering instances provisioned through schematics. :param str resource_group_id: (optional) Id of the resource group to provision the offering instance into. :param str install_plan: (optional) Type of install plan (also known as approval strategy) for operator subscriptions. Can be either automatic, which automatically upgrades operators to the latest in a channel, or manual, which requires approval on the cluster. :param str channel: (optional) Channel to pin the operator subscription to. :param dict metadata: (optional) Map of metadata values for this offering instance. :param OfferingInstanceLastOperation last_operation: (optional) the last operation performed and status. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `OfferingInstance` object """ if instance_identifier is None: raise ValueError('instance_identifier must be provided') if x_auth_refresh_token is None: raise ValueError('x_auth_refresh_token must be provided') if last_operation is not None: last_operation = convert_model(last_operation) headers = {'X-Auth-Refresh-Token': x_auth_refresh_token} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='put_offering_instance' ) headers.update(sdk_headers) data = { 'id': id, '_rev': rev, 'url': url, 'crn': crn, 'label': label, 'catalog_id': catalog_id, 'offering_id': offering_id, 'kind_format': kind_format, 'version': version, 'cluster_id': cluster_id, 'cluster_region': cluster_region, 'cluster_namespaces': cluster_namespaces, 'cluster_all_namespaces': cluster_all_namespaces, 'schematics_workspace_id': schematics_workspace_id, 'resource_group_id': resource_group_id, 'install_plan': install_plan, 'channel': channel, 'metadata': metadata, 'last_operation': last_operation, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) headers['content-type'] = 'application/json' if 'headers' in kwargs: headers.update(kwargs.get('headers')) headers['Accept'] = 'application/json' path_param_keys = ['instance_identifier'] path_param_values = self.encode_path_vars(instance_identifier) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/instances/offerings/{instance_identifier}'.format(**path_param_dict) request = self.prepare_request(method='PUT', url=url, headers=headers, data=data) response = self.send(request, **kwargs) return response def delete_offering_instance( self, instance_identifier: str, x_auth_refresh_token: str, **kwargs ) -> DetailedResponse: """ Delete a version instance. Delete and instance deployed out of a product version. :param str instance_identifier: Version Instance identifier. :param str x_auth_refresh_token: IAM Refresh token. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if instance_identifier is None: raise ValueError('instance_identifier must be provided') if x_auth_refresh_token is None: raise ValueError('x_auth_refresh_token must be provided') headers = {'X-Auth-Refresh-Token': x_auth_refresh_token} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='delete_offering_instance' ) headers.update(sdk_headers) if 'headers' in kwargs: headers.update(kwargs.get('headers')) path_param_keys = ['instance_identifier'] path_param_values = self.encode_path_vars(instance_identifier) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/instances/offerings/{instance_identifier}'.format(**path_param_dict) request = self.prepare_request(method='DELETE', url=url, headers=headers) response = self.send(request, **kwargs) return response
(authenticator: ibm_cloud_sdk_core.authenticators.authenticator.Authenticator = None) -> None
719,326
ibm_platform_services.catalog_management_v1
__init__
Construct a new client for the Catalog Management service. :param Authenticator authenticator: The authenticator specifies the authentication mechanism. Get up to date information from https://github.com/IBM/python-sdk-core/blob/main/README.md about initializing the authenticator of your choice.
def __init__( self, authenticator: Authenticator = None, ) -> None: """ Construct a new client for the Catalog Management service. :param Authenticator authenticator: The authenticator specifies the authentication mechanism. Get up to date information from https://github.com/IBM/python-sdk-core/blob/main/README.md about initializing the authenticator of your choice. """ BaseService.__init__(self, service_url=self.DEFAULT_SERVICE_URL, authenticator=authenticator)
(self, authenticator: Optional[ibm_cloud_sdk_core.authenticators.authenticator.Authenticator] = None) -> NoneType
719,331
ibm_platform_services.catalog_management_v1
account_publish_object
Publish object to account. Publish a catalog object to account. :param str catalog_identifier: Catalog identifier. :param str object_identifier: Object identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse
def account_publish_object(self, catalog_identifier: str, object_identifier: str, **kwargs) -> DetailedResponse: """ Publish object to account. Publish a catalog object to account. :param str catalog_identifier: Catalog identifier. :param str object_identifier: Object identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if catalog_identifier is None: raise ValueError('catalog_identifier must be provided') if object_identifier is None: raise ValueError('object_identifier must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='account_publish_object' ) headers.update(sdk_headers) if 'headers' in kwargs: headers.update(kwargs.get('headers')) path_param_keys = ['catalog_identifier', 'object_identifier'] path_param_values = self.encode_path_vars(catalog_identifier, object_identifier) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/catalogs/{catalog_identifier}/objects/{object_identifier}/account-publish'.format(**path_param_dict) request = self.prepare_request(method='POST', url=url, headers=headers) response = self.send(request, **kwargs) return response
(self, catalog_identifier: str, object_identifier: str, **kwargs) -> ibm_cloud_sdk_core.detailed_response.DetailedResponse
719,332
ibm_platform_services.catalog_management_v1
account_publish_version
Publish version to account members. Publish the specified version so it is viewable by account members. :param str version_loc_id: A dotted value of `catalogID`.`versionID`. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse
def account_publish_version(self, version_loc_id: str, **kwargs) -> DetailedResponse: """ Publish version to account members. Publish the specified version so it is viewable by account members. :param str version_loc_id: A dotted value of `catalogID`.`versionID`. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if version_loc_id is None: raise ValueError('version_loc_id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='account_publish_version' ) headers.update(sdk_headers) if 'headers' in kwargs: headers.update(kwargs.get('headers')) path_param_keys = ['version_loc_id'] path_param_values = self.encode_path_vars(version_loc_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/versions/{version_loc_id}/account-publish'.format(**path_param_dict) request = self.prepare_request(method='POST', url=url, headers=headers) response = self.send(request, **kwargs) return response
(self, version_loc_id: str, **kwargs) -> ibm_cloud_sdk_core.detailed_response.DetailedResponse
719,333
ibm_platform_services.catalog_management_v1
add_object_access_list
Add accounts to object access list. Add one or more accounts to the specified object's access list. :param str catalog_identifier: Catalog identifier. :param str object_identifier: Object identifier. :param List[str] accounts: A list of accounts to add. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `AccessListBulkResponse` object
def add_object_access_list( self, catalog_identifier: str, object_identifier: str, accounts: List[str], **kwargs ) -> DetailedResponse: """ Add accounts to object access list. Add one or more accounts to the specified object's access list. :param str catalog_identifier: Catalog identifier. :param str object_identifier: Object identifier. :param List[str] accounts: A list of accounts to add. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `AccessListBulkResponse` object """ if catalog_identifier is None: raise ValueError('catalog_identifier must be provided') if object_identifier is None: raise ValueError('object_identifier must be provided') if accounts is None: raise ValueError('accounts must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='add_object_access_list' ) headers.update(sdk_headers) data = json.dumps(accounts) headers['content-type'] = 'application/json' if 'headers' in kwargs: headers.update(kwargs.get('headers')) headers['Accept'] = 'application/json' path_param_keys = ['catalog_identifier', 'object_identifier'] path_param_values = self.encode_path_vars(catalog_identifier, object_identifier) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/catalogs/{catalog_identifier}/objects/{object_identifier}/access'.format(**path_param_dict) request = self.prepare_request(method='POST', url=url, headers=headers, data=data) response = self.send(request, **kwargs) return response
(self, catalog_identifier: str, object_identifier: str, accounts: List[str], **kwargs) -> ibm_cloud_sdk_core.detailed_response.DetailedResponse
719,334
ibm_platform_services.catalog_management_v1
commit_version
Commit version. Commit a working copy of the specified version. :param str version_loc_id: A dotted value of `catalogID`.`versionID`. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse
def commit_version(self, version_loc_id: str, **kwargs) -> DetailedResponse: """ Commit version. Commit a working copy of the specified version. :param str version_loc_id: A dotted value of `catalogID`.`versionID`. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if version_loc_id is None: raise ValueError('version_loc_id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='commit_version' ) headers.update(sdk_headers) if 'headers' in kwargs: headers.update(kwargs.get('headers')) path_param_keys = ['version_loc_id'] path_param_values = self.encode_path_vars(version_loc_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/versions/{version_loc_id}/commit'.format(**path_param_dict) request = self.prepare_request(method='POST', url=url, headers=headers) response = self.send(request, **kwargs) return response
(self, version_loc_id: str, **kwargs) -> ibm_cloud_sdk_core.detailed_response.DetailedResponse
719,336
ibm_platform_services.catalog_management_v1
copy_version
Copy version to new target kind. Copy the specified version to a new target kind within the same offering. :param str version_loc_id: A dotted value of `catalogID`.`versionID`. :param List[str] tags: (optional) Tags array. :param List[str] target_kinds: (optional) Target kinds. Current valid values are 'iks', 'roks', 'vcenter', and 'terraform'. :param bytes content: (optional) byte array representing the content to be imported. Only supported for OVA images at this time. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse
def copy_version( self, version_loc_id: str, *, tags: List[str] = None, target_kinds: List[str] = None, content: bytes = None, **kwargs ) -> DetailedResponse: """ Copy version to new target kind. Copy the specified version to a new target kind within the same offering. :param str version_loc_id: A dotted value of `catalogID`.`versionID`. :param List[str] tags: (optional) Tags array. :param List[str] target_kinds: (optional) Target kinds. Current valid values are 'iks', 'roks', 'vcenter', and 'terraform'. :param bytes content: (optional) byte array representing the content to be imported. Only supported for OVA images at this time. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if version_loc_id is None: raise ValueError('version_loc_id must be provided') if content is not None: content = str(base64.b64encode(content), 'utf-8') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='copy_version' ) headers.update(sdk_headers) data = {'tags': tags, 'target_kinds': target_kinds, 'content': content} data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) headers['content-type'] = 'application/json' if 'headers' in kwargs: headers.update(kwargs.get('headers')) path_param_keys = ['version_loc_id'] path_param_values = self.encode_path_vars(version_loc_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/versions/{version_loc_id}/copy'.format(**path_param_dict) request = self.prepare_request(method='POST', url=url, headers=headers, data=data) response = self.send(request, **kwargs) return response
(self, version_loc_id: str, *, tags: Optional[List[str]] = None, target_kinds: Optional[List[str]] = None, content: Optional[bytes] = None, **kwargs) -> ibm_cloud_sdk_core.detailed_response.DetailedResponse
719,337
ibm_platform_services.catalog_management_v1
create_catalog
Create a catalog. Create a catalog for a given account. :param str id: (optional) Unique ID. :param str rev: (optional) Cloudant revision. :param str label: (optional) Display Name in the requested language. :param str short_description: (optional) Description in the requested language. :param str catalog_icon_url: (optional) URL for an icon associated with this catalog. :param List[str] tags: (optional) List of tags associated with this catalog. :param List[Feature] features: (optional) List of features associated with this catalog. :param bool disabled: (optional) Denotes whether a catalog is disabled. :param str resource_group_id: (optional) Resource group id the catalog is owned by. :param str owning_account: (optional) Account that owns catalog. :param Filters catalog_filters: (optional) Filters for account and catalog filters. :param SyndicationResource syndication_settings: (optional) Feature information. :param str kind: (optional) Kind of catalog. Supported kinds are offering and vpe. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `Catalog` object
def create_catalog( self, *, id: str = None, rev: str = None, label: str = None, short_description: str = None, catalog_icon_url: str = None, tags: List[str] = None, features: List['Feature'] = None, disabled: bool = None, resource_group_id: str = None, owning_account: str = None, catalog_filters: 'Filters' = None, syndication_settings: 'SyndicationResource' = None, kind: str = None, **kwargs ) -> DetailedResponse: """ Create a catalog. Create a catalog for a given account. :param str id: (optional) Unique ID. :param str rev: (optional) Cloudant revision. :param str label: (optional) Display Name in the requested language. :param str short_description: (optional) Description in the requested language. :param str catalog_icon_url: (optional) URL for an icon associated with this catalog. :param List[str] tags: (optional) List of tags associated with this catalog. :param List[Feature] features: (optional) List of features associated with this catalog. :param bool disabled: (optional) Denotes whether a catalog is disabled. :param str resource_group_id: (optional) Resource group id the catalog is owned by. :param str owning_account: (optional) Account that owns catalog. :param Filters catalog_filters: (optional) Filters for account and catalog filters. :param SyndicationResource syndication_settings: (optional) Feature information. :param str kind: (optional) Kind of catalog. Supported kinds are offering and vpe. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `Catalog` object """ if features is not None: features = [convert_model(x) for x in features] if catalog_filters is not None: catalog_filters = convert_model(catalog_filters) if syndication_settings is not None: syndication_settings = convert_model(syndication_settings) headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='create_catalog' ) headers.update(sdk_headers) data = { 'id': id, '_rev': rev, 'label': label, 'short_description': short_description, 'catalog_icon_url': catalog_icon_url, 'tags': tags, 'features': features, 'disabled': disabled, 'resource_group_id': resource_group_id, 'owning_account': owning_account, 'catalog_filters': catalog_filters, 'syndication_settings': syndication_settings, 'kind': kind, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) headers['content-type'] = 'application/json' if 'headers' in kwargs: headers.update(kwargs.get('headers')) headers['Accept'] = 'application/json' url = '/catalogs' request = self.prepare_request(method='POST', url=url, headers=headers, data=data) response = self.send(request, **kwargs) return response
(self, *, id: Optional[str] = None, rev: Optional[str] = None, label: Optional[str] = None, short_description: Optional[str] = None, catalog_icon_url: Optional[str] = None, tags: Optional[List[str]] = None, features: Optional[List[ibm_platform_services.catalog_management_v1.Feature]] = None, disabled: Optional[bool] = None, resource_group_id: Optional[str] = None, owning_account: Optional[str] = None, catalog_filters: Optional[ibm_platform_services.catalog_management_v1.Filters] = None, syndication_settings: Optional[ibm_platform_services.catalog_management_v1.SyndicationResource] = None, kind: Optional[str] = None, **kwargs) -> ibm_cloud_sdk_core.detailed_response.DetailedResponse
719,338
ibm_platform_services.catalog_management_v1
create_object
Create catalog object. Create an object with a specific catalog. :param str catalog_identifier: Catalog identifier. :param str id: (optional) unique id. :param str name: (optional) The programmatic name of this offering. :param str rev: (optional) Cloudant revision. :param str crn: (optional) The crn for this specific object. :param str url: (optional) The url for this specific object. :param str parent_id: (optional) The parent for this specific object. :param str label_i18n: (optional) Translated display name in the requested language. :param str label: (optional) Display name in the requested language. :param List[str] tags: (optional) List of tags associated with this catalog. :param datetime created: (optional) The date and time this catalog was created. :param datetime updated: (optional) The date and time this catalog was last updated. :param str short_description: (optional) Short description in the requested language. :param str short_description_i18n: (optional) Short description translation. :param str kind: (optional) Kind of object. :param PublishObject publish: (optional) Publish information. :param State state: (optional) Offering state. :param str catalog_id: (optional) The id of the catalog containing this offering. :param str catalog_name: (optional) The name of the catalog. :param dict data: (optional) Map of data values for this object. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `CatalogObject` object
def create_object( self, catalog_identifier: str, *, id: str = None, name: str = None, rev: str = None, crn: str = None, url: str = None, parent_id: str = None, label_i18n: str = None, label: str = None, tags: List[str] = None, created: datetime = None, updated: datetime = None, short_description: str = None, short_description_i18n: str = None, kind: str = None, publish: 'PublishObject' = None, state: 'State' = None, catalog_id: str = None, catalog_name: str = None, data: dict = None, **kwargs ) -> DetailedResponse: """ Create catalog object. Create an object with a specific catalog. :param str catalog_identifier: Catalog identifier. :param str id: (optional) unique id. :param str name: (optional) The programmatic name of this offering. :param str rev: (optional) Cloudant revision. :param str crn: (optional) The crn for this specific object. :param str url: (optional) The url for this specific object. :param str parent_id: (optional) The parent for this specific object. :param str label_i18n: (optional) Translated display name in the requested language. :param str label: (optional) Display name in the requested language. :param List[str] tags: (optional) List of tags associated with this catalog. :param datetime created: (optional) The date and time this catalog was created. :param datetime updated: (optional) The date and time this catalog was last updated. :param str short_description: (optional) Short description in the requested language. :param str short_description_i18n: (optional) Short description translation. :param str kind: (optional) Kind of object. :param PublishObject publish: (optional) Publish information. :param State state: (optional) Offering state. :param str catalog_id: (optional) The id of the catalog containing this offering. :param str catalog_name: (optional) The name of the catalog. :param dict data: (optional) Map of data values for this object. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `CatalogObject` object """ if catalog_identifier is None: raise ValueError('catalog_identifier must be provided') if created is not None: created = datetime_to_string(created) if updated is not None: updated = datetime_to_string(updated) if publish is not None: publish = convert_model(publish) if state is not None: state = convert_model(state) headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='create_object' ) headers.update(sdk_headers) data = { 'id': id, 'name': name, '_rev': rev, 'crn': crn, 'url': url, 'parent_id': parent_id, 'label_i18n': label_i18n, 'label': label, 'tags': tags, 'created': created, 'updated': updated, 'short_description': short_description, 'short_description_i18n': short_description_i18n, 'kind': kind, 'publish': publish, 'state': state, 'catalog_id': catalog_id, 'catalog_name': catalog_name, 'data': data, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) headers['content-type'] = 'application/json' if 'headers' in kwargs: headers.update(kwargs.get('headers')) headers['Accept'] = 'application/json' path_param_keys = ['catalog_identifier'] path_param_values = self.encode_path_vars(catalog_identifier) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/catalogs/{catalog_identifier}/objects'.format(**path_param_dict) request = self.prepare_request(method='POST', url=url, headers=headers, data=data) response = self.send(request, **kwargs) return response
(self, catalog_identifier: str, *, id: Optional[str] = None, name: Optional[str] = None, rev: Optional[str] = None, crn: Optional[str] = None, url: Optional[str] = None, parent_id: Optional[str] = None, label_i18n: Optional[str] = None, label: Optional[str] = None, tags: Optional[List[str]] = None, created: Optional[datetime.datetime] = None, updated: Optional[datetime.datetime] = None, short_description: Optional[str] = None, short_description_i18n: Optional[str] = None, kind: Optional[str] = None, publish: Optional[ibm_platform_services.catalog_management_v1.PublishObject] = None, state: Optional[ibm_platform_services.catalog_management_v1.State] = None, catalog_id: Optional[str] = None, catalog_name: Optional[str] = None, data: Optional[dict] = None, **kwargs) -> ibm_cloud_sdk_core.detailed_response.DetailedResponse
719,339
ibm_platform_services.catalog_management_v1
create_object_access
Add account ID to object access list. Add an account ID to an object's access list. :param str catalog_identifier: Catalog identifier. :param str object_identifier: Object identifier. :param str account_identifier: Account identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse
def create_object_access( self, catalog_identifier: str, object_identifier: str, account_identifier: str, **kwargs ) -> DetailedResponse: """ Add account ID to object access list. Add an account ID to an object's access list. :param str catalog_identifier: Catalog identifier. :param str object_identifier: Object identifier. :param str account_identifier: Account identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if catalog_identifier is None: raise ValueError('catalog_identifier must be provided') if object_identifier is None: raise ValueError('object_identifier must be provided') if account_identifier is None: raise ValueError('account_identifier must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='create_object_access' ) headers.update(sdk_headers) if 'headers' in kwargs: headers.update(kwargs.get('headers')) path_param_keys = ['catalog_identifier', 'object_identifier', 'account_identifier'] path_param_values = self.encode_path_vars(catalog_identifier, object_identifier, account_identifier) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/catalogs/{catalog_identifier}/objects/{object_identifier}/access/{account_identifier}'.format( **path_param_dict ) request = self.prepare_request(method='POST', url=url, headers=headers) response = self.send(request, **kwargs) return response
(self, catalog_identifier: str, object_identifier: str, account_identifier: str, **kwargs) -> ibm_cloud_sdk_core.detailed_response.DetailedResponse
719,340
ibm_platform_services.catalog_management_v1
create_offering
Create offering. Create an offering. :param str catalog_identifier: Catalog identifier. :param str id: (optional) unique id. :param str rev: (optional) Cloudant revision. :param str url: (optional) The url for this specific offering. :param str crn: (optional) The crn for this specific offering. :param str label: (optional) Display Name in the requested language. :param str name: (optional) The programmatic name of this offering. :param str offering_icon_url: (optional) URL for an icon associated with this offering. :param str offering_docs_url: (optional) URL for an additional docs with this offering. :param str offering_support_url: (optional) [deprecated] - Use offering.support instead. URL to be displayed in the Consumption UI for getting support on this offering. :param List[str] tags: (optional) List of tags associated with this catalog. :param List[str] keywords: (optional) List of keywords associated with offering, typically used to search for it. :param Rating rating: (optional) Repository info for offerings. :param datetime created: (optional) The date and time this catalog was created. :param datetime updated: (optional) The date and time this catalog was last updated. :param str short_description: (optional) Short description in the requested language. :param str long_description: (optional) Long description in the requested language. :param List[Feature] features: (optional) list of features associated with this offering. :param List[Kind] kinds: (optional) Array of kind. :param bool permit_request_ibm_public_publish: (optional) Is it permitted to request publishing to IBM or Public. :param bool ibm_publish_approved: (optional) Indicates if this offering has been approved for use by all IBMers. :param bool public_publish_approved: (optional) Indicates if this offering has been approved for use by all IBM Cloud users. :param str public_original_crn: (optional) The original offering CRN that this publish entry came from. :param str publish_public_crn: (optional) The crn of the public catalog entry of this offering. :param str portal_approval_record: (optional) The portal's approval record ID. :param str portal_ui_url: (optional) The portal UI URL. :param str catalog_id: (optional) The id of the catalog containing this offering. :param str catalog_name: (optional) The name of the catalog. :param dict metadata: (optional) Map of metadata values for this offering. :param str disclaimer: (optional) A disclaimer for this offering. :param bool hidden: (optional) Determine if this offering should be displayed in the Consumption UI. :param str provider: (optional) Deprecated - Provider of this offering. :param ProviderInfo provider_info: (optional) Information on the provider for this offering, or omitted if no provider information is given. :param RepoInfo repo_info: (optional) Repository info for offerings. :param Support support: (optional) Offering Support information. :param List[MediaItem] media: (optional) A list of media items related to this offering. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `Offering` object
def create_offering( self, catalog_identifier: str, *, id: str = None, rev: str = None, url: str = None, crn: str = None, label: str = None, name: str = None, offering_icon_url: str = None, offering_docs_url: str = None, offering_support_url: str = None, tags: List[str] = None, keywords: List[str] = None, rating: 'Rating' = None, created: datetime = None, updated: datetime = None, short_description: str = None, long_description: str = None, features: List['Feature'] = None, kinds: List['Kind'] = None, permit_request_ibm_public_publish: bool = None, ibm_publish_approved: bool = None, public_publish_approved: bool = None, public_original_crn: str = None, publish_public_crn: str = None, portal_approval_record: str = None, portal_ui_url: str = None, catalog_id: str = None, catalog_name: str = None, metadata: dict = None, disclaimer: str = None, hidden: bool = None, provider: str = None, provider_info: 'ProviderInfo' = None, repo_info: 'RepoInfo' = None, support: 'Support' = None, media: List['MediaItem'] = None, **kwargs ) -> DetailedResponse: """ Create offering. Create an offering. :param str catalog_identifier: Catalog identifier. :param str id: (optional) unique id. :param str rev: (optional) Cloudant revision. :param str url: (optional) The url for this specific offering. :param str crn: (optional) The crn for this specific offering. :param str label: (optional) Display Name in the requested language. :param str name: (optional) The programmatic name of this offering. :param str offering_icon_url: (optional) URL for an icon associated with this offering. :param str offering_docs_url: (optional) URL for an additional docs with this offering. :param str offering_support_url: (optional) [deprecated] - Use offering.support instead. URL to be displayed in the Consumption UI for getting support on this offering. :param List[str] tags: (optional) List of tags associated with this catalog. :param List[str] keywords: (optional) List of keywords associated with offering, typically used to search for it. :param Rating rating: (optional) Repository info for offerings. :param datetime created: (optional) The date and time this catalog was created. :param datetime updated: (optional) The date and time this catalog was last updated. :param str short_description: (optional) Short description in the requested language. :param str long_description: (optional) Long description in the requested language. :param List[Feature] features: (optional) list of features associated with this offering. :param List[Kind] kinds: (optional) Array of kind. :param bool permit_request_ibm_public_publish: (optional) Is it permitted to request publishing to IBM or Public. :param bool ibm_publish_approved: (optional) Indicates if this offering has been approved for use by all IBMers. :param bool public_publish_approved: (optional) Indicates if this offering has been approved for use by all IBM Cloud users. :param str public_original_crn: (optional) The original offering CRN that this publish entry came from. :param str publish_public_crn: (optional) The crn of the public catalog entry of this offering. :param str portal_approval_record: (optional) The portal's approval record ID. :param str portal_ui_url: (optional) The portal UI URL. :param str catalog_id: (optional) The id of the catalog containing this offering. :param str catalog_name: (optional) The name of the catalog. :param dict metadata: (optional) Map of metadata values for this offering. :param str disclaimer: (optional) A disclaimer for this offering. :param bool hidden: (optional) Determine if this offering should be displayed in the Consumption UI. :param str provider: (optional) Deprecated - Provider of this offering. :param ProviderInfo provider_info: (optional) Information on the provider for this offering, or omitted if no provider information is given. :param RepoInfo repo_info: (optional) Repository info for offerings. :param Support support: (optional) Offering Support information. :param List[MediaItem] media: (optional) A list of media items related to this offering. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `Offering` object """ if catalog_identifier is None: raise ValueError('catalog_identifier must be provided') if rating is not None: rating = convert_model(rating) if created is not None: created = datetime_to_string(created) if updated is not None: updated = datetime_to_string(updated) if features is not None: features = [convert_model(x) for x in features] if kinds is not None: kinds = [convert_model(x) for x in kinds] if provider_info is not None: provider_info = convert_model(provider_info) if repo_info is not None: repo_info = convert_model(repo_info) if support is not None: support = convert_model(support) if media is not None: media = [convert_model(x) for x in media] headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='create_offering' ) headers.update(sdk_headers) data = { 'id': id, '_rev': rev, 'url': url, 'crn': crn, 'label': label, 'name': name, 'offering_icon_url': offering_icon_url, 'offering_docs_url': offering_docs_url, 'offering_support_url': offering_support_url, 'tags': tags, 'keywords': keywords, 'rating': rating, 'created': created, 'updated': updated, 'short_description': short_description, 'long_description': long_description, 'features': features, 'kinds': kinds, 'permit_request_ibm_public_publish': permit_request_ibm_public_publish, 'ibm_publish_approved': ibm_publish_approved, 'public_publish_approved': public_publish_approved, 'public_original_crn': public_original_crn, 'publish_public_crn': publish_public_crn, 'portal_approval_record': portal_approval_record, 'portal_ui_url': portal_ui_url, 'catalog_id': catalog_id, 'catalog_name': catalog_name, 'metadata': metadata, 'disclaimer': disclaimer, 'hidden': hidden, 'provider': provider, 'provider_info': provider_info, 'repo_info': repo_info, 'support': support, 'media': media, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) headers['content-type'] = 'application/json' if 'headers' in kwargs: headers.update(kwargs.get('headers')) headers['Accept'] = 'application/json' path_param_keys = ['catalog_identifier'] path_param_values = self.encode_path_vars(catalog_identifier) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/catalogs/{catalog_identifier}/offerings'.format(**path_param_dict) request = self.prepare_request(method='POST', url=url, headers=headers, data=data) response = self.send(request, **kwargs) return response
(self, catalog_identifier: str, *, id: Optional[str] = None, rev: Optional[str] = None, url: Optional[str] = None, crn: Optional[str] = None, label: Optional[str] = None, name: Optional[str] = None, offering_icon_url: Optional[str] = None, offering_docs_url: Optional[str] = None, offering_support_url: Optional[str] = None, tags: Optional[List[str]] = None, keywords: Optional[List[str]] = None, rating: Optional[ibm_platform_services.catalog_management_v1.Rating] = None, created: Optional[datetime.datetime] = None, updated: Optional[datetime.datetime] = None, short_description: Optional[str] = None, long_description: Optional[str] = None, features: Optional[List[ibm_platform_services.catalog_management_v1.Feature]] = None, kinds: Optional[List[ibm_platform_services.catalog_management_v1.Kind]] = None, permit_request_ibm_public_publish: Optional[bool] = None, ibm_publish_approved: Optional[bool] = None, public_publish_approved: Optional[bool] = None, public_original_crn: Optional[str] = None, publish_public_crn: Optional[str] = None, portal_approval_record: Optional[str] = None, portal_ui_url: Optional[str] = None, catalog_id: Optional[str] = None, catalog_name: Optional[str] = None, metadata: Optional[dict] = None, disclaimer: Optional[str] = None, hidden: Optional[bool] = None, provider: Optional[str] = None, provider_info: Optional[ibm_platform_services.catalog_management_v1.ProviderInfo] = None, repo_info: Optional[ibm_platform_services.catalog_management_v1.RepoInfo] = None, support: Optional[ibm_platform_services.catalog_management_v1.Support] = None, media: Optional[List[ibm_platform_services.catalog_management_v1.MediaItem]] = None, **kwargs) -> ibm_cloud_sdk_core.detailed_response.DetailedResponse
719,341
ibm_platform_services.catalog_management_v1
create_offering_instance
Create an offering resource instance. Provision a new offering in a given account, and return its resource instance. :param str x_auth_refresh_token: IAM Refresh token. :param str id: (optional) provisioned instance ID (part of the CRN). :param str rev: (optional) Cloudant revision. :param str url: (optional) url reference to this object. :param str crn: (optional) platform CRN for this instance. :param str label: (optional) the label for this instance. :param str catalog_id: (optional) Catalog ID this instance was created from. :param str offering_id: (optional) Offering ID this instance was created from. :param str kind_format: (optional) the format this instance has (helm, operator, ova...). :param str version: (optional) The version this instance was installed from (not version id). :param str cluster_id: (optional) Cluster ID. :param str cluster_region: (optional) Cluster region (e.g., us-south). :param List[str] cluster_namespaces: (optional) List of target namespaces to install into. :param bool cluster_all_namespaces: (optional) designate to install into all namespaces. :param str schematics_workspace_id: (optional) Id of the schematics workspace, for offering instances provisioned through schematics. :param str resource_group_id: (optional) Id of the resource group to provision the offering instance into. :param str install_plan: (optional) Type of install plan (also known as approval strategy) for operator subscriptions. Can be either automatic, which automatically upgrades operators to the latest in a channel, or manual, which requires approval on the cluster. :param str channel: (optional) Channel to pin the operator subscription to. :param dict metadata: (optional) Map of metadata values for this offering instance. :param OfferingInstanceLastOperation last_operation: (optional) the last operation performed and status. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `OfferingInstance` object
def create_offering_instance( self, x_auth_refresh_token: str, *, id: str = None, rev: str = None, url: str = None, crn: str = None, label: str = None, catalog_id: str = None, offering_id: str = None, kind_format: str = None, version: str = None, cluster_id: str = None, cluster_region: str = None, cluster_namespaces: List[str] = None, cluster_all_namespaces: bool = None, schematics_workspace_id: str = None, resource_group_id: str = None, install_plan: str = None, channel: str = None, metadata: dict = None, last_operation: 'OfferingInstanceLastOperation' = None, **kwargs ) -> DetailedResponse: """ Create an offering resource instance. Provision a new offering in a given account, and return its resource instance. :param str x_auth_refresh_token: IAM Refresh token. :param str id: (optional) provisioned instance ID (part of the CRN). :param str rev: (optional) Cloudant revision. :param str url: (optional) url reference to this object. :param str crn: (optional) platform CRN for this instance. :param str label: (optional) the label for this instance. :param str catalog_id: (optional) Catalog ID this instance was created from. :param str offering_id: (optional) Offering ID this instance was created from. :param str kind_format: (optional) the format this instance has (helm, operator, ova...). :param str version: (optional) The version this instance was installed from (not version id). :param str cluster_id: (optional) Cluster ID. :param str cluster_region: (optional) Cluster region (e.g., us-south). :param List[str] cluster_namespaces: (optional) List of target namespaces to install into. :param bool cluster_all_namespaces: (optional) designate to install into all namespaces. :param str schematics_workspace_id: (optional) Id of the schematics workspace, for offering instances provisioned through schematics. :param str resource_group_id: (optional) Id of the resource group to provision the offering instance into. :param str install_plan: (optional) Type of install plan (also known as approval strategy) for operator subscriptions. Can be either automatic, which automatically upgrades operators to the latest in a channel, or manual, which requires approval on the cluster. :param str channel: (optional) Channel to pin the operator subscription to. :param dict metadata: (optional) Map of metadata values for this offering instance. :param OfferingInstanceLastOperation last_operation: (optional) the last operation performed and status. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `OfferingInstance` object """ if x_auth_refresh_token is None: raise ValueError('x_auth_refresh_token must be provided') if last_operation is not None: last_operation = convert_model(last_operation) headers = {'X-Auth-Refresh-Token': x_auth_refresh_token} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='create_offering_instance' ) headers.update(sdk_headers) data = { 'id': id, '_rev': rev, 'url': url, 'crn': crn, 'label': label, 'catalog_id': catalog_id, 'offering_id': offering_id, 'kind_format': kind_format, 'version': version, 'cluster_id': cluster_id, 'cluster_region': cluster_region, 'cluster_namespaces': cluster_namespaces, 'cluster_all_namespaces': cluster_all_namespaces, 'schematics_workspace_id': schematics_workspace_id, 'resource_group_id': resource_group_id, 'install_plan': install_plan, 'channel': channel, 'metadata': metadata, 'last_operation': last_operation, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) headers['content-type'] = 'application/json' if 'headers' in kwargs: headers.update(kwargs.get('headers')) headers['Accept'] = 'application/json' url = '/instances/offerings' request = self.prepare_request(method='POST', url=url, headers=headers, data=data) response = self.send(request, **kwargs) return response
(self, x_auth_refresh_token: str, *, id: Optional[str] = None, rev: Optional[str] = None, url: Optional[str] = None, crn: Optional[str] = None, label: Optional[str] = None, catalog_id: Optional[str] = None, offering_id: Optional[str] = None, kind_format: Optional[str] = None, version: Optional[str] = None, cluster_id: Optional[str] = None, cluster_region: Optional[str] = None, cluster_namespaces: Optional[List[str]] = None, cluster_all_namespaces: Optional[bool] = None, schematics_workspace_id: Optional[str] = None, resource_group_id: Optional[str] = None, install_plan: Optional[str] = None, channel: Optional[str] = None, metadata: Optional[dict] = None, last_operation: Optional[ibm_platform_services.catalog_management_v1.OfferingInstanceLastOperation] = None, **kwargs) -> ibm_cloud_sdk_core.detailed_response.DetailedResponse
719,342
ibm_platform_services.catalog_management_v1
delete_catalog
Delete catalog. Delete a catalog. :param str catalog_identifier: Catalog identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse
def delete_catalog(self, catalog_identifier: str, **kwargs) -> DetailedResponse: """ Delete catalog. Delete a catalog. :param str catalog_identifier: Catalog identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if catalog_identifier is None: raise ValueError('catalog_identifier must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='delete_catalog' ) headers.update(sdk_headers) if 'headers' in kwargs: headers.update(kwargs.get('headers')) path_param_keys = ['catalog_identifier'] path_param_values = self.encode_path_vars(catalog_identifier) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/catalogs/{catalog_identifier}'.format(**path_param_dict) request = self.prepare_request(method='DELETE', url=url, headers=headers) response = self.send(request, **kwargs) return response
(self, catalog_identifier: str, **kwargs) -> ibm_cloud_sdk_core.detailed_response.DetailedResponse
719,343
ibm_platform_services.catalog_management_v1
delete_object
Delete catalog object. Delete a specific object within a specific catalog. :param str catalog_identifier: Catalog identifier. :param str object_identifier: Object identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse
def delete_object(self, catalog_identifier: str, object_identifier: str, **kwargs) -> DetailedResponse: """ Delete catalog object. Delete a specific object within a specific catalog. :param str catalog_identifier: Catalog identifier. :param str object_identifier: Object identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if catalog_identifier is None: raise ValueError('catalog_identifier must be provided') if object_identifier is None: raise ValueError('object_identifier must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='delete_object' ) headers.update(sdk_headers) if 'headers' in kwargs: headers.update(kwargs.get('headers')) path_param_keys = ['catalog_identifier', 'object_identifier'] path_param_values = self.encode_path_vars(catalog_identifier, object_identifier) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/catalogs/{catalog_identifier}/objects/{object_identifier}'.format(**path_param_dict) request = self.prepare_request(method='DELETE', url=url, headers=headers) response = self.send(request, **kwargs) return response
(self, catalog_identifier: str, object_identifier: str, **kwargs) -> ibm_cloud_sdk_core.detailed_response.DetailedResponse
719,344
ibm_platform_services.catalog_management_v1
delete_object_access
Remove account ID from object access list. Delete the specified account ID from the specified object's access list. :param str catalog_identifier: Catalog identifier. :param str object_identifier: Object identifier. :param str account_identifier: Account identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse
def delete_object_access( self, catalog_identifier: str, object_identifier: str, account_identifier: str, **kwargs ) -> DetailedResponse: """ Remove account ID from object access list. Delete the specified account ID from the specified object's access list. :param str catalog_identifier: Catalog identifier. :param str object_identifier: Object identifier. :param str account_identifier: Account identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if catalog_identifier is None: raise ValueError('catalog_identifier must be provided') if object_identifier is None: raise ValueError('object_identifier must be provided') if account_identifier is None: raise ValueError('account_identifier must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='delete_object_access' ) headers.update(sdk_headers) if 'headers' in kwargs: headers.update(kwargs.get('headers')) path_param_keys = ['catalog_identifier', 'object_identifier', 'account_identifier'] path_param_values = self.encode_path_vars(catalog_identifier, object_identifier, account_identifier) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/catalogs/{catalog_identifier}/objects/{object_identifier}/access/{account_identifier}'.format( **path_param_dict ) request = self.prepare_request(method='DELETE', url=url, headers=headers) response = self.send(request, **kwargs) return response
(self, catalog_identifier: str, object_identifier: str, account_identifier: str, **kwargs) -> ibm_cloud_sdk_core.detailed_response.DetailedResponse
719,345
ibm_platform_services.catalog_management_v1
delete_object_access_list
Delete accounts from object access list. Delete all or a set of accounts from an object's access list. :param str catalog_identifier: Catalog identifier. :param str object_identifier: Object identifier. :param List[str] accounts: A list of accounts to delete. An entry with star["*"] will remove all accounts. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `AccessListBulkResponse` object
def delete_object_access_list( self, catalog_identifier: str, object_identifier: str, accounts: List[str], **kwargs ) -> DetailedResponse: """ Delete accounts from object access list. Delete all or a set of accounts from an object's access list. :param str catalog_identifier: Catalog identifier. :param str object_identifier: Object identifier. :param List[str] accounts: A list of accounts to delete. An entry with star["*"] will remove all accounts. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `AccessListBulkResponse` object """ if catalog_identifier is None: raise ValueError('catalog_identifier must be provided') if object_identifier is None: raise ValueError('object_identifier must be provided') if accounts is None: raise ValueError('accounts must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='delete_object_access_list' ) headers.update(sdk_headers) data = json.dumps(accounts) headers['content-type'] = 'application/json' if 'headers' in kwargs: headers.update(kwargs.get('headers')) headers['Accept'] = 'application/json' path_param_keys = ['catalog_identifier', 'object_identifier'] path_param_values = self.encode_path_vars(catalog_identifier, object_identifier) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/catalogs/{catalog_identifier}/objects/{object_identifier}/access'.format(**path_param_dict) request = self.prepare_request(method='DELETE', url=url, headers=headers, data=data) response = self.send(request, **kwargs) return response
(self, catalog_identifier: str, object_identifier: str, accounts: List[str], **kwargs) -> ibm_cloud_sdk_core.detailed_response.DetailedResponse
719,346
ibm_platform_services.catalog_management_v1
delete_offering
Delete offering. Delete an offering. :param str catalog_identifier: Catalog identifier. :param str offering_id: Offering identification. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse
def delete_offering(self, catalog_identifier: str, offering_id: str, **kwargs) -> DetailedResponse: """ Delete offering. Delete an offering. :param str catalog_identifier: Catalog identifier. :param str offering_id: Offering identification. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if catalog_identifier is None: raise ValueError('catalog_identifier must be provided') if offering_id is None: raise ValueError('offering_id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='delete_offering' ) headers.update(sdk_headers) if 'headers' in kwargs: headers.update(kwargs.get('headers')) path_param_keys = ['catalog_identifier', 'offering_id'] path_param_values = self.encode_path_vars(catalog_identifier, offering_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/catalogs/{catalog_identifier}/offerings/{offering_id}'.format(**path_param_dict) request = self.prepare_request(method='DELETE', url=url, headers=headers) response = self.send(request, **kwargs) return response
(self, catalog_identifier: str, offering_id: str, **kwargs) -> ibm_cloud_sdk_core.detailed_response.DetailedResponse
719,347
ibm_platform_services.catalog_management_v1
delete_offering_instance
Delete a version instance. Delete and instance deployed out of a product version. :param str instance_identifier: Version Instance identifier. :param str x_auth_refresh_token: IAM Refresh token. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse
def delete_offering_instance( self, instance_identifier: str, x_auth_refresh_token: str, **kwargs ) -> DetailedResponse: """ Delete a version instance. Delete and instance deployed out of a product version. :param str instance_identifier: Version Instance identifier. :param str x_auth_refresh_token: IAM Refresh token. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if instance_identifier is None: raise ValueError('instance_identifier must be provided') if x_auth_refresh_token is None: raise ValueError('x_auth_refresh_token must be provided') headers = {'X-Auth-Refresh-Token': x_auth_refresh_token} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='delete_offering_instance' ) headers.update(sdk_headers) if 'headers' in kwargs: headers.update(kwargs.get('headers')) path_param_keys = ['instance_identifier'] path_param_values = self.encode_path_vars(instance_identifier) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/instances/offerings/{instance_identifier}'.format(**path_param_dict) request = self.prepare_request(method='DELETE', url=url, headers=headers) response = self.send(request, **kwargs) return response
(self, instance_identifier: str, x_auth_refresh_token: str, **kwargs) -> ibm_cloud_sdk_core.detailed_response.DetailedResponse
719,348
ibm_platform_services.catalog_management_v1
delete_operators
Delete operators. Delete operators from a kubernetes cluster. :param str x_auth_refresh_token: IAM Refresh token. :param str cluster_id: Cluster identification. :param str region: Cluster region. :param str version_locator_id: A dotted value of `catalogID`.`versionID`. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse
def delete_operators( self, x_auth_refresh_token: str, cluster_id: str, region: str, version_locator_id: str, **kwargs ) -> DetailedResponse: """ Delete operators. Delete operators from a kubernetes cluster. :param str x_auth_refresh_token: IAM Refresh token. :param str cluster_id: Cluster identification. :param str region: Cluster region. :param str version_locator_id: A dotted value of `catalogID`.`versionID`. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if x_auth_refresh_token is None: raise ValueError('x_auth_refresh_token must be provided') if cluster_id is None: raise ValueError('cluster_id must be provided') if region is None: raise ValueError('region must be provided') if version_locator_id is None: raise ValueError('version_locator_id must be provided') headers = {'X-Auth-Refresh-Token': x_auth_refresh_token} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='delete_operators' ) headers.update(sdk_headers) params = {'cluster_id': cluster_id, 'region': region, 'version_locator_id': version_locator_id} if 'headers' in kwargs: headers.update(kwargs.get('headers')) url = '/deploy/kubernetes/olm/operator' request = self.prepare_request(method='DELETE', url=url, headers=headers, params=params) response = self.send(request, **kwargs) return response
(self, x_auth_refresh_token: str, cluster_id: str, region: str, version_locator_id: str, **kwargs) -> ibm_cloud_sdk_core.detailed_response.DetailedResponse
719,349
ibm_platform_services.catalog_management_v1
delete_version
Delete version. Delete the specified version. If the version is an active version with a working copy, the working copy will be deleted as well. :param str version_loc_id: A dotted value of `catalogID`.`versionID`. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse
def delete_version(self, version_loc_id: str, **kwargs) -> DetailedResponse: """ Delete version. Delete the specified version. If the version is an active version with a working copy, the working copy will be deleted as well. :param str version_loc_id: A dotted value of `catalogID`.`versionID`. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if version_loc_id is None: raise ValueError('version_loc_id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='delete_version' ) headers.update(sdk_headers) if 'headers' in kwargs: headers.update(kwargs.get('headers')) path_param_keys = ['version_loc_id'] path_param_values = self.encode_path_vars(version_loc_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/versions/{version_loc_id}'.format(**path_param_dict) request = self.prepare_request(method='DELETE', url=url, headers=headers) response = self.send(request, **kwargs) return response
(self, version_loc_id: str, **kwargs) -> ibm_cloud_sdk_core.detailed_response.DetailedResponse
719,350
ibm_platform_services.catalog_management_v1
deploy_operators
Deploy operators. Deploy operators on a kubernetes cluster. :param str x_auth_refresh_token: IAM Refresh token. :param str cluster_id: (optional) Cluster ID. :param str region: (optional) Cluster region. :param List[str] namespaces: (optional) Kube namespaces to deploy Operator(s) to. :param bool all_namespaces: (optional) Denotes whether to install Operator(s) globally. :param str version_locator_id: (optional) A dotted value of `catalogID`.`versionID`. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `List[OperatorDeployResult]` result
def deploy_operators( self, x_auth_refresh_token: str, *, cluster_id: str = None, region: str = None, namespaces: List[str] = None, all_namespaces: bool = None, version_locator_id: str = None, **kwargs ) -> DetailedResponse: """ Deploy operators. Deploy operators on a kubernetes cluster. :param str x_auth_refresh_token: IAM Refresh token. :param str cluster_id: (optional) Cluster ID. :param str region: (optional) Cluster region. :param List[str] namespaces: (optional) Kube namespaces to deploy Operator(s) to. :param bool all_namespaces: (optional) Denotes whether to install Operator(s) globally. :param str version_locator_id: (optional) A dotted value of `catalogID`.`versionID`. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `List[OperatorDeployResult]` result """ if x_auth_refresh_token is None: raise ValueError('x_auth_refresh_token must be provided') headers = {'X-Auth-Refresh-Token': x_auth_refresh_token} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='deploy_operators' ) headers.update(sdk_headers) data = { 'cluster_id': cluster_id, 'region': region, 'namespaces': namespaces, 'all_namespaces': all_namespaces, 'version_locator_id': version_locator_id, } data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) headers['content-type'] = 'application/json' if 'headers' in kwargs: headers.update(kwargs.get('headers')) headers['Accept'] = 'application/json' url = '/deploy/kubernetes/olm/operator' request = self.prepare_request(method='POST', url=url, headers=headers, data=data) response = self.send(request, **kwargs) return response
(self, x_auth_refresh_token: str, *, cluster_id: Optional[str] = None, region: Optional[str] = None, namespaces: Optional[List[str]] = None, all_namespaces: Optional[bool] = None, version_locator_id: Optional[str] = None, **kwargs) -> ibm_cloud_sdk_core.detailed_response.DetailedResponse
719,351
ibm_platform_services.catalog_management_v1
deprecate_offering
Allows offering to be deprecated. Approve or disapprove the offering to be deprecated. :param str catalog_identifier: Catalog identifier. :param str offering_id: Offering identification. :param str setting: Set deprecation (true) or cancel deprecation (false). :param str description: (optional) Additional information that users can provide to be displayed in deprecation notification. :param int days_until_deprecate: (optional) Specifies the amount of days until product is not available in catalog. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse
def deprecate_offering( self, catalog_identifier: str, offering_id: str, setting: str, *, description: str = None, days_until_deprecate: int = None, **kwargs ) -> DetailedResponse: """ Allows offering to be deprecated. Approve or disapprove the offering to be deprecated. :param str catalog_identifier: Catalog identifier. :param str offering_id: Offering identification. :param str setting: Set deprecation (true) or cancel deprecation (false). :param str description: (optional) Additional information that users can provide to be displayed in deprecation notification. :param int days_until_deprecate: (optional) Specifies the amount of days until product is not available in catalog. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if catalog_identifier is None: raise ValueError('catalog_identifier must be provided') if offering_id is None: raise ValueError('offering_id must be provided') if setting is None: raise ValueError('setting must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='deprecate_offering' ) headers.update(sdk_headers) data = {'description': description, 'days_until_deprecate': days_until_deprecate} data = {k: v for (k, v) in data.items() if v is not None} data = json.dumps(data) headers['content-type'] = 'application/json' if 'headers' in kwargs: headers.update(kwargs.get('headers')) path_param_keys = ['catalog_identifier', 'offering_id', 'setting'] path_param_values = self.encode_path_vars(catalog_identifier, offering_id, setting) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/catalogs/{catalog_identifier}/offerings/{offering_id}/deprecate/{setting}'.format(**path_param_dict) request = self.prepare_request(method='POST', url=url, headers=headers, data=data) response = self.send(request, **kwargs) return response
(self, catalog_identifier: str, offering_id: str, setting: str, *, description: Optional[str] = None, days_until_deprecate: Optional[int] = None, **kwargs) -> ibm_cloud_sdk_core.detailed_response.DetailedResponse
719,352
ibm_platform_services.catalog_management_v1
deprecate_version
Deprecate version immediately. Deprecate the specified version. :param str version_loc_id: A dotted value of `catalogID`.`versionID`. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse
def deprecate_version(self, version_loc_id: str, **kwargs) -> DetailedResponse: """ Deprecate version immediately. Deprecate the specified version. :param str version_loc_id: A dotted value of `catalogID`.`versionID`. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if version_loc_id is None: raise ValueError('version_loc_id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='deprecate_version' ) headers.update(sdk_headers) if 'headers' in kwargs: headers.update(kwargs.get('headers')) path_param_keys = ['version_loc_id'] path_param_values = self.encode_path_vars(version_loc_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/versions/{version_loc_id}/deprecate'.format(**path_param_dict) request = self.prepare_request(method='POST', url=url, headers=headers) response = self.send(request, **kwargs) return response
(self, version_loc_id: str, **kwargs) -> ibm_cloud_sdk_core.detailed_response.DetailedResponse
719,357
ibm_platform_services.catalog_management_v1
get_catalog
Get catalog. Get a catalog. This can also be used by an unauthenticated user to get the public catalog. :param str catalog_identifier: Catalog identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `Catalog` object
def get_catalog(self, catalog_identifier: str, **kwargs) -> DetailedResponse: """ Get catalog. Get a catalog. This can also be used by an unauthenticated user to get the public catalog. :param str catalog_identifier: Catalog identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `Catalog` object """ if catalog_identifier is None: raise ValueError('catalog_identifier must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='get_catalog' ) headers.update(sdk_headers) if 'headers' in kwargs: headers.update(kwargs.get('headers')) headers['Accept'] = 'application/json' path_param_keys = ['catalog_identifier'] path_param_values = self.encode_path_vars(catalog_identifier) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/catalogs/{catalog_identifier}'.format(**path_param_dict) request = self.prepare_request(method='GET', url=url, headers=headers) response = self.send(request, **kwargs) return response
(self, catalog_identifier: str, **kwargs) -> ibm_cloud_sdk_core.detailed_response.DetailedResponse
719,358
ibm_platform_services.catalog_management_v1
get_catalog_account
Get catalog account settings. Get the account level settings for the account for private catalog. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `Account` object
def get_catalog_account(self, **kwargs) -> DetailedResponse: """ Get catalog account settings. Get the account level settings for the account for private catalog. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `Account` object """ headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='get_catalog_account' ) headers.update(sdk_headers) if 'headers' in kwargs: headers.update(kwargs.get('headers')) headers['Accept'] = 'application/json' url = '/catalogaccount' request = self.prepare_request(method='GET', url=url, headers=headers) response = self.send(request, **kwargs) return response
(self, **kwargs) -> ibm_cloud_sdk_core.detailed_response.DetailedResponse
719,359
ibm_platform_services.catalog_management_v1
get_catalog_account_audit
Get catalog account audit log. Get the audit log associated with a catalog account. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `AuditLog` object
def get_catalog_account_audit(self, **kwargs) -> DetailedResponse: """ Get catalog account audit log. Get the audit log associated with a catalog account. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `AuditLog` object """ headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='get_catalog_account_audit' ) headers.update(sdk_headers) if 'headers' in kwargs: headers.update(kwargs.get('headers')) headers['Accept'] = 'application/json' url = '/catalogaccount/audit' request = self.prepare_request(method='GET', url=url, headers=headers) response = self.send(request, **kwargs) return response
(self, **kwargs) -> ibm_cloud_sdk_core.detailed_response.DetailedResponse
719,360
ibm_platform_services.catalog_management_v1
get_catalog_account_filters
Get catalog account filters. Get the accumulated filters of the account and of the catalogs you have access to. :param str catalog: (optional) catalog id. Narrow down filters to the account and just the one catalog. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `AccumulatedFilters` object
def get_catalog_account_filters(self, *, catalog: str = None, **kwargs) -> DetailedResponse: """ Get catalog account filters. Get the accumulated filters of the account and of the catalogs you have access to. :param str catalog: (optional) catalog id. Narrow down filters to the account and just the one catalog. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `AccumulatedFilters` object """ headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='get_catalog_account_filters' ) headers.update(sdk_headers) params = {'catalog': catalog} if 'headers' in kwargs: headers.update(kwargs.get('headers')) headers['Accept'] = 'application/json' url = '/catalogaccount/filters' request = self.prepare_request(method='GET', url=url, headers=headers, params=params) response = self.send(request, **kwargs) return response
(self, *, catalog: Optional[str] = None, **kwargs) -> ibm_cloud_sdk_core.detailed_response.DetailedResponse
719,361
ibm_platform_services.catalog_management_v1
get_catalog_audit
Get catalog audit log. Get the audit log associated with a catalog. :param str catalog_identifier: Catalog identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `AuditLog` object
def get_catalog_audit(self, catalog_identifier: str, **kwargs) -> DetailedResponse: """ Get catalog audit log. Get the audit log associated with a catalog. :param str catalog_identifier: Catalog identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `AuditLog` object """ if catalog_identifier is None: raise ValueError('catalog_identifier must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='get_catalog_audit' ) headers.update(sdk_headers) if 'headers' in kwargs: headers.update(kwargs.get('headers')) headers['Accept'] = 'application/json' path_param_keys = ['catalog_identifier'] path_param_values = self.encode_path_vars(catalog_identifier) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/catalogs/{catalog_identifier}/audit'.format(**path_param_dict) request = self.prepare_request(method='GET', url=url, headers=headers) response = self.send(request, **kwargs) return response
(self, catalog_identifier: str, **kwargs) -> ibm_cloud_sdk_core.detailed_response.DetailedResponse
719,362
ibm_platform_services.catalog_management_v1
get_cluster
Get kubernetes cluster. Get the contents of the specified kubernetes cluster. :param str cluster_id: ID of the cluster. :param str region: Region of the cluster. :param str x_auth_refresh_token: IAM Refresh token. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `ClusterInfo` object
def get_cluster(self, cluster_id: str, region: str, x_auth_refresh_token: str, **kwargs) -> DetailedResponse: """ Get kubernetes cluster. Get the contents of the specified kubernetes cluster. :param str cluster_id: ID of the cluster. :param str region: Region of the cluster. :param str x_auth_refresh_token: IAM Refresh token. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `ClusterInfo` object """ if cluster_id is None: raise ValueError('cluster_id must be provided') if region is None: raise ValueError('region must be provided') if x_auth_refresh_token is None: raise ValueError('x_auth_refresh_token must be provided') headers = {'X-Auth-Refresh-Token': x_auth_refresh_token} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='get_cluster' ) headers.update(sdk_headers) params = {'region': region} if 'headers' in kwargs: headers.update(kwargs.get('headers')) headers['Accept'] = 'application/json' path_param_keys = ['cluster_id'] path_param_values = self.encode_path_vars(cluster_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/deploy/kubernetes/clusters/{cluster_id}'.format(**path_param_dict) request = self.prepare_request(method='GET', url=url, headers=headers, params=params) response = self.send(request, **kwargs) return response
(self, cluster_id: str, region: str, x_auth_refresh_token: str, **kwargs) -> ibm_cloud_sdk_core.detailed_response.DetailedResponse
719,363
ibm_platform_services.catalog_management_v1
get_consumption_offerings
Get consumption offerings. Retrieve the available offerings from both public and from the account that currently scoped for consumption. These copies cannot be used for updating. They are not complete and only return what is visible to the caller. This can be used by an unauthenticated user to retreive publicly available offerings. :param bool digest: (optional) true - Strip down the content of what is returned. For example don't return the readme. Makes the result much smaller. Defaults to false. :param str catalog: (optional) catalog id. Narrow search down to just a particular catalog. It will apply the catalog's public filters to the public catalog offerings on the result. :param str select: (optional) What should be selected. Default is 'all' which will return both public and private offerings. 'public' returns only the public offerings and 'private' returns only the private offerings. :param bool include_hidden: (optional) true - include offerings which have been marked as hidden. The default is false and hidden offerings are not returned. :param int limit: (optional) number or results to return. :param int offset: (optional) number of results to skip before returning values. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `OfferingSearchResult` object
def get_consumption_offerings( self, *, digest: bool = None, catalog: str = None, select: str = None, include_hidden: bool = None, limit: int = None, offset: int = None, **kwargs ) -> DetailedResponse: """ Get consumption offerings. Retrieve the available offerings from both public and from the account that currently scoped for consumption. These copies cannot be used for updating. They are not complete and only return what is visible to the caller. This can be used by an unauthenticated user to retreive publicly available offerings. :param bool digest: (optional) true - Strip down the content of what is returned. For example don't return the readme. Makes the result much smaller. Defaults to false. :param str catalog: (optional) catalog id. Narrow search down to just a particular catalog. It will apply the catalog's public filters to the public catalog offerings on the result. :param str select: (optional) What should be selected. Default is 'all' which will return both public and private offerings. 'public' returns only the public offerings and 'private' returns only the private offerings. :param bool include_hidden: (optional) true - include offerings which have been marked as hidden. The default is false and hidden offerings are not returned. :param int limit: (optional) number or results to return. :param int offset: (optional) number of results to skip before returning values. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `OfferingSearchResult` object """ headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='get_consumption_offerings' ) headers.update(sdk_headers) params = { 'digest': digest, 'catalog': catalog, 'select': select, 'includeHidden': include_hidden, 'limit': limit, 'offset': offset, } if 'headers' in kwargs: headers.update(kwargs.get('headers')) headers['Accept'] = 'application/json' url = '/offerings' request = self.prepare_request(method='GET', url=url, headers=headers, params=params) response = self.send(request, **kwargs) return response
(self, *, digest: Optional[bool] = None, catalog: Optional[str] = None, select: Optional[str] = None, include_hidden: Optional[bool] = None, limit: Optional[int] = None, offset: Optional[int] = None, **kwargs) -> ibm_cloud_sdk_core.detailed_response.DetailedResponse
719,366
ibm_platform_services.catalog_management_v1
get_namespaces
Get cluster namespaces. Get the namespaces associated with the specified kubernetes cluster. :param str cluster_id: ID of the cluster. :param str region: Cluster region. :param str x_auth_refresh_token: IAM Refresh token. :param int limit: (optional) The maximum number of results to return. :param int offset: (optional) The number of results to skip before returning values. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `NamespaceSearchResult` object
def get_namespaces( self, cluster_id: str, region: str, x_auth_refresh_token: str, *, limit: int = None, offset: int = None, **kwargs ) -> DetailedResponse: """ Get cluster namespaces. Get the namespaces associated with the specified kubernetes cluster. :param str cluster_id: ID of the cluster. :param str region: Cluster region. :param str x_auth_refresh_token: IAM Refresh token. :param int limit: (optional) The maximum number of results to return. :param int offset: (optional) The number of results to skip before returning values. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `NamespaceSearchResult` object """ if cluster_id is None: raise ValueError('cluster_id must be provided') if region is None: raise ValueError('region must be provided') if x_auth_refresh_token is None: raise ValueError('x_auth_refresh_token must be provided') headers = {'X-Auth-Refresh-Token': x_auth_refresh_token} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='get_namespaces' ) headers.update(sdk_headers) params = {'region': region, 'limit': limit, 'offset': offset} if 'headers' in kwargs: headers.update(kwargs.get('headers')) headers['Accept'] = 'application/json' path_param_keys = ['cluster_id'] path_param_values = self.encode_path_vars(cluster_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/deploy/kubernetes/clusters/{cluster_id}/namespaces'.format(**path_param_dict) request = self.prepare_request(method='GET', url=url, headers=headers, params=params) response = self.send(request, **kwargs) return response
(self, cluster_id: str, region: str, x_auth_refresh_token: str, *, limit: Optional[int] = None, offset: Optional[int] = None, **kwargs) -> ibm_cloud_sdk_core.detailed_response.DetailedResponse
719,367
ibm_platform_services.catalog_management_v1
get_object
Get catalog object. Get the specified object from within the specified catalog. :param str catalog_identifier: Catalog identifier. :param str object_identifier: Object identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `CatalogObject` object
def get_object(self, catalog_identifier: str, object_identifier: str, **kwargs) -> DetailedResponse: """ Get catalog object. Get the specified object from within the specified catalog. :param str catalog_identifier: Catalog identifier. :param str object_identifier: Object identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `CatalogObject` object """ if catalog_identifier is None: raise ValueError('catalog_identifier must be provided') if object_identifier is None: raise ValueError('object_identifier must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='get_object' ) headers.update(sdk_headers) if 'headers' in kwargs: headers.update(kwargs.get('headers')) headers['Accept'] = 'application/json' path_param_keys = ['catalog_identifier', 'object_identifier'] path_param_values = self.encode_path_vars(catalog_identifier, object_identifier) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/catalogs/{catalog_identifier}/objects/{object_identifier}'.format(**path_param_dict) request = self.prepare_request(method='GET', url=url, headers=headers) response = self.send(request, **kwargs) return response
(self, catalog_identifier: str, object_identifier: str, **kwargs) -> ibm_cloud_sdk_core.detailed_response.DetailedResponse
719,368
ibm_platform_services.catalog_management_v1
get_object_access
Check for account ID in object access list. Determine if an account ID is in an object's access list. :param str catalog_identifier: Catalog identifier. :param str object_identifier: Object identifier. :param str account_identifier: Account identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `ObjectAccess` object
def get_object_access( self, catalog_identifier: str, object_identifier: str, account_identifier: str, **kwargs ) -> DetailedResponse: """ Check for account ID in object access list. Determine if an account ID is in an object's access list. :param str catalog_identifier: Catalog identifier. :param str object_identifier: Object identifier. :param str account_identifier: Account identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `ObjectAccess` object """ if catalog_identifier is None: raise ValueError('catalog_identifier must be provided') if object_identifier is None: raise ValueError('object_identifier must be provided') if account_identifier is None: raise ValueError('account_identifier must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='get_object_access' ) headers.update(sdk_headers) if 'headers' in kwargs: headers.update(kwargs.get('headers')) headers['Accept'] = 'application/json' path_param_keys = ['catalog_identifier', 'object_identifier', 'account_identifier'] path_param_values = self.encode_path_vars(catalog_identifier, object_identifier, account_identifier) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/catalogs/{catalog_identifier}/objects/{object_identifier}/access/{account_identifier}'.format( **path_param_dict ) request = self.prepare_request(method='GET', url=url, headers=headers) response = self.send(request, **kwargs) return response
(self, catalog_identifier: str, object_identifier: str, account_identifier: str, **kwargs) -> ibm_cloud_sdk_core.detailed_response.DetailedResponse
719,369
ibm_platform_services.catalog_management_v1
get_object_access_list
Get object access list. Get the access list associated with the specified object. :param str catalog_identifier: Catalog identifier. :param str object_identifier: Object identifier. :param int limit: (optional) The maximum number of results to return. :param int offset: (optional) The number of results to skip before returning values. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `ObjectAccessListResult` object
def get_object_access_list( self, catalog_identifier: str, object_identifier: str, *, limit: int = None, offset: int = None, **kwargs ) -> DetailedResponse: """ Get object access list. Get the access list associated with the specified object. :param str catalog_identifier: Catalog identifier. :param str object_identifier: Object identifier. :param int limit: (optional) The maximum number of results to return. :param int offset: (optional) The number of results to skip before returning values. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `ObjectAccessListResult` object """ if catalog_identifier is None: raise ValueError('catalog_identifier must be provided') if object_identifier is None: raise ValueError('object_identifier must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='get_object_access_list' ) headers.update(sdk_headers) params = {'limit': limit, 'offset': offset} if 'headers' in kwargs: headers.update(kwargs.get('headers')) headers['Accept'] = 'application/json' path_param_keys = ['catalog_identifier', 'object_identifier'] path_param_values = self.encode_path_vars(catalog_identifier, object_identifier) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/catalogs/{catalog_identifier}/objects/{object_identifier}/access'.format(**path_param_dict) request = self.prepare_request(method='GET', url=url, headers=headers, params=params) response = self.send(request, **kwargs) return response
(self, catalog_identifier: str, object_identifier: str, *, limit: Optional[int] = None, offset: Optional[int] = None, **kwargs) -> ibm_cloud_sdk_core.detailed_response.DetailedResponse
719,370
ibm_platform_services.catalog_management_v1
get_object_audit
Get catalog object audit log. Get the audit log associated with a specific catalog object. :param str catalog_identifier: Catalog identifier. :param str object_identifier: Object identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `AuditLog` object
def get_object_audit(self, catalog_identifier: str, object_identifier: str, **kwargs) -> DetailedResponse: """ Get catalog object audit log. Get the audit log associated with a specific catalog object. :param str catalog_identifier: Catalog identifier. :param str object_identifier: Object identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `AuditLog` object """ if catalog_identifier is None: raise ValueError('catalog_identifier must be provided') if object_identifier is None: raise ValueError('object_identifier must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='get_object_audit' ) headers.update(sdk_headers) if 'headers' in kwargs: headers.update(kwargs.get('headers')) headers['Accept'] = 'application/json' path_param_keys = ['catalog_identifier', 'object_identifier'] path_param_values = self.encode_path_vars(catalog_identifier, object_identifier) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/catalogs/{catalog_identifier}/objects/{object_identifier}/audit'.format(**path_param_dict) request = self.prepare_request(method='GET', url=url, headers=headers) response = self.send(request, **kwargs) return response
(self, catalog_identifier: str, object_identifier: str, **kwargs) -> ibm_cloud_sdk_core.detailed_response.DetailedResponse
719,371
ibm_platform_services.catalog_management_v1
get_offering
Get offering. Get an offering. This can be used by an unauthenticated user for publicly available offerings. :param str catalog_identifier: Catalog identifier. :param str offering_id: Offering identification. :param str type: (optional) Offering Parameter Type. Valid values are 'name' or 'id'. Default is 'id'. :param bool digest: (optional) Return the digest format of the specified offering. Default is false. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `Offering` object
def get_offering( self, catalog_identifier: str, offering_id: str, *, type: str = None, digest: bool = None, **kwargs ) -> DetailedResponse: """ Get offering. Get an offering. This can be used by an unauthenticated user for publicly available offerings. :param str catalog_identifier: Catalog identifier. :param str offering_id: Offering identification. :param str type: (optional) Offering Parameter Type. Valid values are 'name' or 'id'. Default is 'id'. :param bool digest: (optional) Return the digest format of the specified offering. Default is false. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `Offering` object """ if catalog_identifier is None: raise ValueError('catalog_identifier must be provided') if offering_id is None: raise ValueError('offering_id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='get_offering' ) headers.update(sdk_headers) params = {'type': type, 'digest': digest} if 'headers' in kwargs: headers.update(kwargs.get('headers')) headers['Accept'] = 'application/json' path_param_keys = ['catalog_identifier', 'offering_id'] path_param_values = self.encode_path_vars(catalog_identifier, offering_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/catalogs/{catalog_identifier}/offerings/{offering_id}'.format(**path_param_dict) request = self.prepare_request(method='GET', url=url, headers=headers, params=params) response = self.send(request, **kwargs) return response
(self, catalog_identifier: str, offering_id: str, *, type: Optional[str] = None, digest: Optional[bool] = None, **kwargs) -> ibm_cloud_sdk_core.detailed_response.DetailedResponse
719,372
ibm_platform_services.catalog_management_v1
get_offering_about
Get version about information. Get the about information, in markdown, for the current version. :param str version_loc_id: A dotted value of `catalogID`.`versionID`. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `str` result
def get_offering_about(self, version_loc_id: str, **kwargs) -> DetailedResponse: """ Get version about information. Get the about information, in markdown, for the current version. :param str version_loc_id: A dotted value of `catalogID`.`versionID`. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `str` result """ if version_loc_id is None: raise ValueError('version_loc_id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='get_offering_about' ) headers.update(sdk_headers) if 'headers' in kwargs: headers.update(kwargs.get('headers')) headers['Accept'] = 'text/markdown' path_param_keys = ['version_loc_id'] path_param_values = self.encode_path_vars(version_loc_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/versions/{version_loc_id}/about'.format(**path_param_dict) request = self.prepare_request(method='GET', url=url, headers=headers) response = self.send(request, **kwargs) return response
(self, version_loc_id: str, **kwargs) -> ibm_cloud_sdk_core.detailed_response.DetailedResponse
719,373
ibm_platform_services.catalog_management_v1
get_offering_audit
Get offering audit log. Get the audit log associated with an offering. :param str catalog_identifier: Catalog identifier. :param str offering_id: Offering identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `AuditLog` object
def get_offering_audit(self, catalog_identifier: str, offering_id: str, **kwargs) -> DetailedResponse: """ Get offering audit log. Get the audit log associated with an offering. :param str catalog_identifier: Catalog identifier. :param str offering_id: Offering identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `AuditLog` object """ if catalog_identifier is None: raise ValueError('catalog_identifier must be provided') if offering_id is None: raise ValueError('offering_id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='get_offering_audit' ) headers.update(sdk_headers) if 'headers' in kwargs: headers.update(kwargs.get('headers')) headers['Accept'] = 'application/json' path_param_keys = ['catalog_identifier', 'offering_id'] path_param_values = self.encode_path_vars(catalog_identifier, offering_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/catalogs/{catalog_identifier}/offerings/{offering_id}/audit'.format(**path_param_dict) request = self.prepare_request(method='GET', url=url, headers=headers) response = self.send(request, **kwargs) return response
(self, catalog_identifier: str, offering_id: str, **kwargs) -> ibm_cloud_sdk_core.detailed_response.DetailedResponse
719,374
ibm_platform_services.catalog_management_v1
get_offering_container_images
Get version's container images. Get the list of container images associated with the specified version. The "image_manifest_url" property of the version should be the URL for the image manifest, and the operation will return that content. :param str version_loc_id: A dotted value of `catalogID`.`versionID`. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `ImageManifest` object
def get_offering_container_images(self, version_loc_id: str, **kwargs) -> DetailedResponse: """ Get version's container images. Get the list of container images associated with the specified version. The "image_manifest_url" property of the version should be the URL for the image manifest, and the operation will return that content. :param str version_loc_id: A dotted value of `catalogID`.`versionID`. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `ImageManifest` object """ if version_loc_id is None: raise ValueError('version_loc_id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='get_offering_container_images' ) headers.update(sdk_headers) if 'headers' in kwargs: headers.update(kwargs.get('headers')) headers['Accept'] = 'application/json' path_param_keys = ['version_loc_id'] path_param_values = self.encode_path_vars(version_loc_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/versions/{version_loc_id}/containerImages'.format(**path_param_dict) request = self.prepare_request(method='GET', url=url, headers=headers) response = self.send(request, **kwargs) return response
(self, version_loc_id: str, **kwargs) -> ibm_cloud_sdk_core.detailed_response.DetailedResponse
719,375
ibm_platform_services.catalog_management_v1
get_offering_instance
Get Offering Instance. Get the resource associated with an installed offering instance. :param str instance_identifier: Version Instance identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `OfferingInstance` object
def get_offering_instance(self, instance_identifier: str, **kwargs) -> DetailedResponse: """ Get Offering Instance. Get the resource associated with an installed offering instance. :param str instance_identifier: Version Instance identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `OfferingInstance` object """ if instance_identifier is None: raise ValueError('instance_identifier must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='get_offering_instance' ) headers.update(sdk_headers) if 'headers' in kwargs: headers.update(kwargs.get('headers')) headers['Accept'] = 'application/json' path_param_keys = ['instance_identifier'] path_param_values = self.encode_path_vars(instance_identifier) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/instances/offerings/{instance_identifier}'.format(**path_param_dict) request = self.prepare_request(method='GET', url=url, headers=headers) response = self.send(request, **kwargs) return response
(self, instance_identifier: str, **kwargs) -> ibm_cloud_sdk_core.detailed_response.DetailedResponse
719,376
ibm_platform_services.catalog_management_v1
get_offering_license
Get version license content. Get the license content for the specified license ID in the specified version. :param str version_loc_id: A dotted value of `catalogID`.`versionID`. :param str license_id: The ID of the license, which maps to the file name in the 'licenses' directory of this verions tgz file. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `str` result
def get_offering_license(self, version_loc_id: str, license_id: str, **kwargs) -> DetailedResponse: """ Get version license content. Get the license content for the specified license ID in the specified version. :param str version_loc_id: A dotted value of `catalogID`.`versionID`. :param str license_id: The ID of the license, which maps to the file name in the 'licenses' directory of this verions tgz file. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `str` result """ if version_loc_id is None: raise ValueError('version_loc_id must be provided') if license_id is None: raise ValueError('license_id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='get_offering_license' ) headers.update(sdk_headers) if 'headers' in kwargs: headers.update(kwargs.get('headers')) headers['Accept'] = 'text/plain' path_param_keys = ['version_loc_id', 'license_id'] path_param_values = self.encode_path_vars(version_loc_id, license_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/versions/{version_loc_id}/licenses/{license_id}'.format(**path_param_dict) request = self.prepare_request(method='GET', url=url, headers=headers) response = self.send(request, **kwargs) return response
(self, version_loc_id: str, license_id: str, **kwargs) -> ibm_cloud_sdk_core.detailed_response.DetailedResponse
719,377
ibm_platform_services.catalog_management_v1
get_offering_source
Get offering source. Get an offering's source. This request requires authorization, even for public offerings. :param str version: The version being requested. :param str accept: (optional) The type of the response: application/yaml, application/json, or application/x-gzip. :param str catalog_id: (optional) Catlaog ID. If not specified, this value will default to the public catalog. :param str name: (optional) Offering name. An offering name or ID must be specified. :param str id: (optional) Offering id. An offering name or ID must be specified. :param str kind: (optional) The kind of offering (e.g. helm, ova, terraform...). :param str channel: (optional) The channel value of the specified version. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `BinaryIO` result
def get_offering_source( self, version: str, *, accept: str = None, catalog_id: str = None, name: str = None, id: str = None, kind: str = None, channel: str = None, **kwargs ) -> DetailedResponse: """ Get offering source. Get an offering's source. This request requires authorization, even for public offerings. :param str version: The version being requested. :param str accept: (optional) The type of the response: application/yaml, application/json, or application/x-gzip. :param str catalog_id: (optional) Catlaog ID. If not specified, this value will default to the public catalog. :param str name: (optional) Offering name. An offering name or ID must be specified. :param str id: (optional) Offering id. An offering name or ID must be specified. :param str kind: (optional) The kind of offering (e.g. helm, ova, terraform...). :param str channel: (optional) The channel value of the specified version. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `BinaryIO` result """ if version is None: raise ValueError('version must be provided') headers = {'Accept': accept} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='get_offering_source' ) headers.update(sdk_headers) params = {'version': version, 'catalogID': catalog_id, 'name': name, 'id': id, 'kind': kind, 'channel': channel} if 'headers' in kwargs: headers.update(kwargs.get('headers')) url = '/offering/source' request = self.prepare_request(method='GET', url=url, headers=headers, params=params) response = self.send(request, **kwargs) return response
(self, version: str, *, accept: Optional[str] = None, catalog_id: Optional[str] = None, name: Optional[str] = None, id: Optional[str] = None, kind: Optional[str] = None, channel: Optional[str] = None, **kwargs) -> ibm_cloud_sdk_core.detailed_response.DetailedResponse
719,378
ibm_platform_services.catalog_management_v1
get_offering_updates
Get version updates. Get available updates for the specified version. :param str catalog_identifier: Catalog identifier. :param str offering_id: Offering identification. :param str kind: The kind of offering (e.g, helm, ova, terraform ...). :param str x_auth_refresh_token: IAM Refresh token. :param str target: (optional) The target kind of the currently installed version (e.g. iks, roks, etc). :param str version: (optional) optionaly provide an existing version to check updates for if one is not given, all version will be returned. :param str cluster_id: (optional) The id of the cluster where this version was installed. :param str region: (optional) The region of the cluster where this version was installed. :param str resource_group_id: (optional) The resource group id of the cluster where this version was installed. :param str namespace: (optional) The namespace of the cluster where this version was installed. :param str sha: (optional) The sha value of the currently installed version. :param str channel: (optional) Optionally provide the channel value of the currently installed version. :param List[str] namespaces: (optional) Optionally provide a list of namespaces used for the currently installed version. :param bool all_namespaces: (optional) Optionally indicate that the current version was installed in all namespaces. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `List[VersionUpdateDescriptor]` result
def get_offering_updates( self, catalog_identifier: str, offering_id: str, kind: str, x_auth_refresh_token: str, *, target: str = None, version: str = None, cluster_id: str = None, region: str = None, resource_group_id: str = None, namespace: str = None, sha: str = None, channel: str = None, namespaces: List[str] = None, all_namespaces: bool = None, **kwargs ) -> DetailedResponse: """ Get version updates. Get available updates for the specified version. :param str catalog_identifier: Catalog identifier. :param str offering_id: Offering identification. :param str kind: The kind of offering (e.g, helm, ova, terraform ...). :param str x_auth_refresh_token: IAM Refresh token. :param str target: (optional) The target kind of the currently installed version (e.g. iks, roks, etc). :param str version: (optional) optionaly provide an existing version to check updates for if one is not given, all version will be returned. :param str cluster_id: (optional) The id of the cluster where this version was installed. :param str region: (optional) The region of the cluster where this version was installed. :param str resource_group_id: (optional) The resource group id of the cluster where this version was installed. :param str namespace: (optional) The namespace of the cluster where this version was installed. :param str sha: (optional) The sha value of the currently installed version. :param str channel: (optional) Optionally provide the channel value of the currently installed version. :param List[str] namespaces: (optional) Optionally provide a list of namespaces used for the currently installed version. :param bool all_namespaces: (optional) Optionally indicate that the current version was installed in all namespaces. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `List[VersionUpdateDescriptor]` result """ if catalog_identifier is None: raise ValueError('catalog_identifier must be provided') if offering_id is None: raise ValueError('offering_id must be provided') if kind is None: raise ValueError('kind must be provided') if x_auth_refresh_token is None: raise ValueError('x_auth_refresh_token must be provided') headers = {'X-Auth-Refresh-Token': x_auth_refresh_token} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='get_offering_updates' ) headers.update(sdk_headers) params = { 'kind': kind, 'target': target, 'version': version, 'cluster_id': cluster_id, 'region': region, 'resource_group_id': resource_group_id, 'namespace': namespace, 'sha': sha, 'channel': channel, 'namespaces': convert_list(namespaces), 'all_namespaces': all_namespaces, } if 'headers' in kwargs: headers.update(kwargs.get('headers')) headers['Accept'] = 'application/json' path_param_keys = ['catalog_identifier', 'offering_id'] path_param_values = self.encode_path_vars(catalog_identifier, offering_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/catalogs/{catalog_identifier}/offerings/{offering_id}/updates'.format(**path_param_dict) request = self.prepare_request(method='GET', url=url, headers=headers, params=params) response = self.send(request, **kwargs) return response
(self, catalog_identifier: str, offering_id: str, kind: str, x_auth_refresh_token: str, *, target: Optional[str] = None, version: Optional[str] = None, cluster_id: Optional[str] = None, region: Optional[str] = None, resource_group_id: Optional[str] = None, namespace: Optional[str] = None, sha: Optional[str] = None, channel: Optional[str] = None, namespaces: Optional[List[str]] = None, all_namespaces: Optional[bool] = None, **kwargs) -> ibm_cloud_sdk_core.detailed_response.DetailedResponse
719,379
ibm_platform_services.catalog_management_v1
get_offering_working_copy
Create working copy of version. Create a working copy of the specified version. :param str version_loc_id: A dotted value of `catalogID`.`versionID`. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `Version` object
def get_offering_working_copy(self, version_loc_id: str, **kwargs) -> DetailedResponse: """ Create working copy of version. Create a working copy of the specified version. :param str version_loc_id: A dotted value of `catalogID`.`versionID`. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `Version` object """ if version_loc_id is None: raise ValueError('version_loc_id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='get_offering_working_copy' ) headers.update(sdk_headers) if 'headers' in kwargs: headers.update(kwargs.get('headers')) headers['Accept'] = 'application/json' path_param_keys = ['version_loc_id'] path_param_values = self.encode_path_vars(version_loc_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/versions/{version_loc_id}/workingcopy'.format(**path_param_dict) request = self.prepare_request(method='POST', url=url, headers=headers) response = self.send(request, **kwargs) return response
(self, version_loc_id: str, **kwargs) -> ibm_cloud_sdk_core.detailed_response.DetailedResponse
719,380
ibm_platform_services.catalog_management_v1
get_override_values
Get override values. Returns the override values that were used to validate the specified offering version. :param str version_loc_id: A dotted value of `catalogID`.`versionID`. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result
def get_override_values(self, version_loc_id: str, **kwargs) -> DetailedResponse: """ Get override values. Returns the override values that were used to validate the specified offering version. :param str version_loc_id: A dotted value of `catalogID`.`versionID`. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result """ if version_loc_id is None: raise ValueError('version_loc_id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='get_override_values' ) headers.update(sdk_headers) if 'headers' in kwargs: headers.update(kwargs.get('headers')) headers['Accept'] = 'application/json' path_param_keys = ['version_loc_id'] path_param_values = self.encode_path_vars(version_loc_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/versions/{version_loc_id}/validation/overridevalues'.format(**path_param_dict) request = self.prepare_request(method='GET', url=url, headers=headers) response = self.send(request, **kwargs) return response
(self, version_loc_id: str, **kwargs) -> ibm_cloud_sdk_core.detailed_response.DetailedResponse
719,381
ibm_platform_services.catalog_management_v1
get_preinstall
Get version pre-install status. Get the pre-install status for the specified version. :param str version_loc_id: A dotted value of `catalogID`.`versionID`. :param str x_auth_refresh_token: IAM Refresh token. :param str cluster_id: (optional) ID of the cluster. :param str region: (optional) Cluster region. :param str namespace: (optional) Required if the version's pre-install scope is `namespace`. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `InstallStatus` object
def get_preinstall( self, version_loc_id: str, x_auth_refresh_token: str, *, cluster_id: str = None, region: str = None, namespace: str = None, **kwargs ) -> DetailedResponse: """ Get version pre-install status. Get the pre-install status for the specified version. :param str version_loc_id: A dotted value of `catalogID`.`versionID`. :param str x_auth_refresh_token: IAM Refresh token. :param str cluster_id: (optional) ID of the cluster. :param str region: (optional) Cluster region. :param str namespace: (optional) Required if the version's pre-install scope is `namespace`. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `InstallStatus` object """ if version_loc_id is None: raise ValueError('version_loc_id must be provided') if x_auth_refresh_token is None: raise ValueError('x_auth_refresh_token must be provided') headers = {'X-Auth-Refresh-Token': x_auth_refresh_token} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='get_preinstall' ) headers.update(sdk_headers) params = {'cluster_id': cluster_id, 'region': region, 'namespace': namespace} if 'headers' in kwargs: headers.update(kwargs.get('headers')) headers['Accept'] = 'application/json' path_param_keys = ['version_loc_id'] path_param_values = self.encode_path_vars(version_loc_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/versions/{version_loc_id}/preinstall'.format(**path_param_dict) request = self.prepare_request(method='GET', url=url, headers=headers, params=params) response = self.send(request, **kwargs) return response
(self, version_loc_id: str, x_auth_refresh_token: str, *, cluster_id: Optional[str] = None, region: Optional[str] = None, namespace: Optional[str] = None, **kwargs) -> ibm_cloud_sdk_core.detailed_response.DetailedResponse
719,382
ibm_platform_services.catalog_management_v1
get_validation_status
Get offering install status. Returns the install status for the specified offering version. :param str version_loc_id: A dotted value of `catalogID`.`versionID`. :param str x_auth_refresh_token: IAM Refresh token. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `Validation` object
def get_validation_status(self, version_loc_id: str, x_auth_refresh_token: str, **kwargs) -> DetailedResponse: """ Get offering install status. Returns the install status for the specified offering version. :param str version_loc_id: A dotted value of `catalogID`.`versionID`. :param str x_auth_refresh_token: IAM Refresh token. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `Validation` object """ if version_loc_id is None: raise ValueError('version_loc_id must be provided') if x_auth_refresh_token is None: raise ValueError('x_auth_refresh_token must be provided') headers = {'X-Auth-Refresh-Token': x_auth_refresh_token} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='get_validation_status' ) headers.update(sdk_headers) if 'headers' in kwargs: headers.update(kwargs.get('headers')) headers['Accept'] = 'application/json' path_param_keys = ['version_loc_id'] path_param_values = self.encode_path_vars(version_loc_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/versions/{version_loc_id}/validation/install'.format(**path_param_dict) request = self.prepare_request(method='GET', url=url, headers=headers) response = self.send(request, **kwargs) return response
(self, version_loc_id: str, x_auth_refresh_token: str, **kwargs) -> ibm_cloud_sdk_core.detailed_response.DetailedResponse
719,383
ibm_platform_services.catalog_management_v1
get_version
Get offering/kind/version 'branch'. Get the Offering/Kind/Version 'branch' for the specified locator ID. :param str version_loc_id: A dotted value of `catalogID`.`versionID`. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `Offering` object
def get_version(self, version_loc_id: str, **kwargs) -> DetailedResponse: """ Get offering/kind/version 'branch'. Get the Offering/Kind/Version 'branch' for the specified locator ID. :param str version_loc_id: A dotted value of `catalogID`.`versionID`. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse with `dict` result representing a `Offering` object """ if version_loc_id is None: raise ValueError('version_loc_id must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='get_version' ) headers.update(sdk_headers) if 'headers' in kwargs: headers.update(kwargs.get('headers')) headers['Accept'] = 'application/json' path_param_keys = ['version_loc_id'] path_param_values = self.encode_path_vars(version_loc_id) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/versions/{version_loc_id}'.format(**path_param_dict) request = self.prepare_request(method='GET', url=url, headers=headers) response = self.send(request, **kwargs) return response
(self, version_loc_id: str, **kwargs) -> ibm_cloud_sdk_core.detailed_response.DetailedResponse
719,384
ibm_platform_services.catalog_management_v1
ibm_publish_object
Publish object to share with IBMers. Publish the specified object so that it is visible to IBMers in the public catalog. :param str catalog_identifier: Catalog identifier. :param str object_identifier: Object identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse
def ibm_publish_object(self, catalog_identifier: str, object_identifier: str, **kwargs) -> DetailedResponse: """ Publish object to share with IBMers. Publish the specified object so that it is visible to IBMers in the public catalog. :param str catalog_identifier: Catalog identifier. :param str object_identifier: Object identifier. :param dict headers: A `dict` containing the request headers :return: A `DetailedResponse` containing the result, headers and HTTP status code. :rtype: DetailedResponse """ if catalog_identifier is None: raise ValueError('catalog_identifier must be provided') if object_identifier is None: raise ValueError('object_identifier must be provided') headers = {} sdk_headers = get_sdk_headers( service_name=self.DEFAULT_SERVICE_NAME, service_version='V1', operation_id='ibm_publish_object' ) headers.update(sdk_headers) if 'headers' in kwargs: headers.update(kwargs.get('headers')) path_param_keys = ['catalog_identifier', 'object_identifier'] path_param_values = self.encode_path_vars(catalog_identifier, object_identifier) path_param_dict = dict(zip(path_param_keys, path_param_values)) url = '/catalogs/{catalog_identifier}/objects/{object_identifier}/ibm-publish'.format(**path_param_dict) request = self.prepare_request(method='POST', url=url, headers=headers) response = self.send(request, **kwargs) return response
(self, catalog_identifier: str, object_identifier: str, **kwargs) -> ibm_cloud_sdk_core.detailed_response.DetailedResponse