REST API - add

vcenter vm tags: add

Attaches tags to a virtual machine. Warning: This operation is part of a new feature in development. It may be changed at any time and may not have all supported functionality implemented.

Request:

HTTP request

POST https://{server}/rest/vcenter/vm/{vm}/tags?action=add

Path Parameters

Name Type Description
Required
vm string Identifier of the virtual machine to which the tags will be assigned.

Request Body Structure:

{
    "tags"[
        "obj-103",
        "obj-103"
    ]
}

Request Body Parameters:

Name Type Description
bold = required
tags string[] The set of identifiers of tags to be assigned.

Response:

HTTP Status Code: 200

Representation:

{
    "value"{
        "success"true,
        "error_messages"[
            {
                "args"[
                    "string",
                    "string"
                ],
                "default_message""string",
                "localized""string",
                "id""string",
                "params"[
                    {
                        "value"{
                            "dt""2015-01-01T22:13:05.651Z",
                            "s""string",
                            "d"1.5,
                            "precision"1,
                            "format""SHORT_DATE",
                            "i"1,
                            "l"{
                                "id""string",
                                "params"[
                                    {
                                        "value"{
                                            "dt""2015-01-01T22:13:05.651Z",
                                            "s""string",
                                            "d"1.5,
                                            "precision"1,
                                            "format""SHORT_DATE",
                                            "i"1,
                                            "l"{
                                                "id""string",
                                                "params"[
                                                    {
                                                        "key""string"
                                                    }
                                                ]
                                            }
                                        },
                                        "key""string"
                                    }
                                ]
                            }
                        },
                        "key""string"
                    }
                ]
            },
            {
                "args"[
                    "string",
                    "string"
                ],
                "default_message""string",
                "localized""string",
                "id""string",
                "params"[
                    {
                        "value"{
                            "dt""2015-01-01T22:13:05.651Z",
                            "s""string",
                            "d"1.5,
                            "precision"1,
                            "format""SHORT_DATE",
                            "i"1,
                            "l"{
                                "id""string",
                                "params"[
                                    {
                                        "value"{
                                            "dt""2015-01-01T22:13:05.651Z",
                                            "s""string",
                                            "d"1.5,
                                            "precision"1,
                                            "format""SHORT_DATE",
                                            "i"1,
                                            "l"{
                                                "id""string",
                                                "params"[
                                                    {
                                                        "key""string"
                                                    }
                                                ]
                                            }
                                        },
                                        "key""string"
                                    }
                                ]
                            }
                        },
                        "key""string"
                    }
                ]
            }
        ]
    }
}

Response Type:

Name Type Description
bold = required
value status For which tags this attachment succeeded or failed.
value.success boolean This is true if the complete operation succeeded without any errors. Otherwise it is false and all or some operations have failed. Warning: This attribute is part of a new feature in development. It may be changed at any time and may not have all supported functionality implemented.

value.error_messages localizable_message[] The array of error messages. Warning: This attribute is part of a new feature in development. It may be changed at any time and may not have all supported functionality implemented.

value.error_messages[].id string Unique identifier of the localizable string or message template.

This identifier is typically used to retrieve a locale-specific string or message template from a message catalog.

value.error_messages[].default_message string The value of this localizable string or message template in the en_US (English) locale. If vapi.std.localizable_message.id refers to a message template, the default message will contain the substituted arguments. This value can be used by clients that do not need to display strings and messages in the native language of the user. It could also be used as a fallback if a client is unable to access the appropriate message catalog.

value.error_messages[].args string[] Positional arguments to be substituted into the message template. This list will be empty if the message uses named arguments or has no arguments.

Errors:

HTTP Status Code Type Description
404 not_found if the virtual machine is not registered on this vCenter server.
403 unauthorized if the user doesn't have the required privileges.