24
24
`service` tags cannot be attached to IMS resources. `service` tags must be in the form
25
25
`service_prefix:tag_label` where `service_prefix` identifies the Service owning the tag.
26
26
`access` tags cannot be attached to IMS and Cloud Foundry resources. They must be in the
27
- form `key:value`.
27
+ form `key:value`. You can replace all resource's tags using the `replace` query parameter
28
+ in the attach operation. You can update the `value` of a resource's tag in the format
29
+ `key:value`, using the `update` query parameter in the attach operation.
28
30
29
31
API Version: 1.2.0
30
32
"""
@@ -460,6 +462,7 @@ def attach_tag(
460
462
account_id : Optional [str ] = None ,
461
463
tag_type : Optional [str ] = None ,
462
464
replace : Optional [bool ] = None ,
465
+ update : Optional [bool ] = None ,
463
466
** kwargs ,
464
467
) -> DetailedResponse :
465
468
"""
@@ -497,8 +500,17 @@ def attach_tag(
497
500
`user`, `service` and `access`. `service` and `access` are not supported
498
501
for IMS resources.
499
502
:param bool replace: (optional) Flag to request replacement of all attached
500
- tags. Set 'true' if you want to replace all the list of tags attached to
501
- the resource. Default value is false.
503
+ tags. Set `true` if you want to replace all tags attached to the resource
504
+ with the current ones. Default value is false.
505
+ :param bool update: (optional) Flag to request update of attached tags in
506
+ the format `key:value`. Here's how it works for each tag in the request
507
+ body: If the tag to attach is in the format `key:value`, the System will
508
+ atomically detach all existing tags starting with `key:` and attach the new
509
+ `key:value` tag. If no such tags exist, a new `key:value` tag will be
510
+ attached. If the tag is not in the `key:value` format (e.g., a simple
511
+ label), the System will attach the label as usual. The update query
512
+ parameter is available for user and access management tags, but not for
513
+ service tags.
502
514
:param dict headers: A `dict` containing the request headers
503
515
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
504
516
:rtype: DetailedResponse with `dict` result representing a `TagResults` object
@@ -522,6 +534,7 @@ def attach_tag(
522
534
'account_id' : account_id ,
523
535
'tag_type' : tag_type ,
524
536
'replace' : replace ,
537
+ 'update' : update ,
525
538
}
526
539
527
540
data = {
0 commit comments