@@ -598,6 +598,44 @@ def unlock_resource_instance(self,
598
598
response = self .send (request )
599
599
return response
600
600
601
+ def cancel_lastop_resource_instance (self ,
602
+ id : str ,
603
+ ** kwargs
604
+ ) -> DetailedResponse :
605
+ """
606
+ Cancel the in progress last operation of the resource instance.
607
+
608
+ Cancel the in progress last operation of the resource instance. After successful
609
+ cancellation, the resource instance is removed.
610
+
611
+ :param str id: The resource instance URL-encoded CRN or GUID.
612
+ :param dict headers: A `dict` containing the request headers
613
+ :return: A `DetailedResponse` containing the result, headers and HTTP status code.
614
+ :rtype: DetailedResponse with `dict` result representing a `ResourceInstance` object
615
+ """
616
+
617
+ if id is None :
618
+ raise ValueError ('id must be provided' )
619
+ headers = {}
620
+ sdk_headers = get_sdk_headers (service_name = self .DEFAULT_SERVICE_NAME ,
621
+ service_version = 'V2' ,
622
+ operation_id = 'cancel_lastop_resource_instance' )
623
+ headers .update (sdk_headers )
624
+
625
+ if 'headers' in kwargs :
626
+ headers .update (kwargs .get ('headers' ))
627
+ headers ['Accept' ] = 'application/json'
628
+
629
+ path_param_keys = ['id' ]
630
+ path_param_values = self .encode_path_vars (id )
631
+ path_param_dict = dict (zip (path_param_keys , path_param_values ))
632
+ url = '/v2/resource_instances/{id}/last_operation' .format (** path_param_dict )
633
+ request = self .prepare_request (method = 'DELETE' ,
634
+ url = url ,
635
+ headers = headers )
636
+
637
+ response = self .send (request )
638
+ return response
601
639
#########################
602
640
# Resource Keys
603
641
#########################
@@ -1592,6 +1630,11 @@ class Credentials():
1592
1630
"""
1593
1631
The credentials for a resource.
1594
1632
1633
+ :attr str redacted: (optional) If present, the user doesn't have the correct
1634
+ access to view the credentials and the details are redacted. The string value
1635
+ identifies the level of access that's required to view the credential. For
1636
+ additional information, see [viewing a
1637
+ credential](https://cloud.ibm.com/docs/account?topic=account-service_credentials&interface=ui#viewing-credentials-ui).
1595
1638
:attr str apikey: (optional) The API key for the credentials.
1596
1639
:attr str iam_apikey_description: (optional) The optional description of the API
1597
1640
key.
@@ -1603,10 +1646,11 @@ class Credentials():
1603
1646
"""
1604
1647
1605
1648
# The set of defined properties for the class
1606
- _properties = frozenset (['apikey' , 'iam_apikey_description' , 'iam_apikey_name' , 'iam_role_crn' , 'iam_serviceid_crn' ])
1649
+ _properties = frozenset (['REDACTED' , ' apikey' , 'iam_apikey_description' , 'iam_apikey_name' , 'iam_role_crn' , 'iam_serviceid_crn' ])
1607
1650
1608
1651
def __init__ (self ,
1609
1652
* ,
1653
+ redacted : str = None ,
1610
1654
apikey : str = None ,
1611
1655
iam_apikey_description : str = None ,
1612
1656
iam_apikey_name : str = None ,
@@ -1616,6 +1660,11 @@ def __init__(self,
1616
1660
"""
1617
1661
Initialize a Credentials object.
1618
1662
1663
+ :param str redacted: (optional) If present, the user doesn't have the
1664
+ correct access to view the credentials and the details are redacted. The
1665
+ string value identifies the level of access that's required to view the
1666
+ credential. For additional information, see [viewing a
1667
+ credential](https://cloud.ibm.com/docs/account?topic=account-service_credentials&interface=ui#viewing-credentials-ui).
1619
1668
:param str apikey: (optional) The API key for the credentials.
1620
1669
:param str iam_apikey_description: (optional) The optional description of
1621
1670
the API key.
@@ -1626,6 +1675,7 @@ def __init__(self,
1626
1675
service ID of the credentials.
1627
1676
:param **kwargs: (optional) Any additional properties.
1628
1677
"""
1678
+ self .redacted = redacted
1629
1679
self .apikey = apikey
1630
1680
self .iam_apikey_description = iam_apikey_description
1631
1681
self .iam_apikey_name = iam_apikey_name
@@ -1638,6 +1688,8 @@ def __init__(self,
1638
1688
def from_dict (cls , _dict : Dict ) -> 'Credentials' :
1639
1689
"""Initialize a Credentials object from a json dictionary."""
1640
1690
args = {}
1691
+ if 'REDACTED' in _dict :
1692
+ args ['redacted' ] = _dict .get ('REDACTED' )
1641
1693
if 'apikey' in _dict :
1642
1694
args ['apikey' ] = _dict .get ('apikey' )
1643
1695
if 'iam_apikey_description' in _dict :
@@ -1659,6 +1711,8 @@ def _from_dict(cls, _dict):
1659
1711
def to_dict (self ) -> Dict :
1660
1712
"""Return a json dictionary representing this model."""
1661
1713
_dict = {}
1714
+ if hasattr (self , 'redacted' ) and self .redacted is not None :
1715
+ _dict ['REDACTED' ] = self .redacted
1662
1716
if hasattr (self , 'apikey' ) and self .apikey is not None :
1663
1717
_dict ['apikey' ] = self .apikey
1664
1718
if hasattr (self , 'iam_apikey_description' ) and self .iam_apikey_description is not None :
0 commit comments