POST Licenses

POST Licenses

Add a new license to the collection. A UUID will be generated to represent the license, and can be used for deletion. The license summary cannot be set, and is derived from the license key. In addition, a single license key cannot be updated in-place. Instead, the old license keys should be deleted after the new license is added.

Request
URI
POST
https://{api_host}/api/v2/licenses
COPY
Request Body
licenses.post.request of type(s) application/json
Optional
{
    "key": "M502V-XXXXX-XXXXX-XXXXX-XXXXX"
}
Authentication
This operation uses the following authentication methods.
Responses
201

Created a new license with the provided license key.

Returns licenses.post.response of type(s) application/json
{
    "license": {
        "id": "abcdef12-3456-7890-ba36-123456789012",
        "status": "Active",
        "error": "",
        "configuration": "1 Operating System Instance (OSI)",
        "licenseKey": "M502V-XXXXX-XXXXX-XXXXX-XXXXX",
        "infinite": true,
        "count": 0,
        "typeEnum": "OSI",
        "expirationDate": -14400000,
        "createdDate": 1498731659310
    }
}

400

Error when trying to upload an invalid license key

{
    "errorMessage": "Invalid serial number"
}
string
errorMessage
Optional

errorMessage


401
Operation doesn't return any data structure

409

Error when trying to upload the license key which already exists

{
    "errorMessage": "License already exists."
}
string
errorMessage
Optional

errorMessage


440
Operation doesn't return any data structure

500

Internal error while processing the client request

Returns error of type(s) application/json
{
    "errorMessage": "The operation failed due to an internal error."
}
string
errorMessage
Required

A message describing the error.

string
errorCode
Optional

A code representing the type of error.

Possible values are : LIMIT_ERROR, FIELD_ERROR, TEST_ERROR, JSON_FORMAT_ERROR, LICENSE_ERROR, VSPHERE_INTEGRATION_ERROR, VROPS_INTEGRATION_ERROR, UPGRADE_ERROR, SEARCH_ERROR, AGENT_ERROR, RBAC_COMMON_ERROR, RBAC_USERS_ERROR, RBAC_GROUPS_ERROR, RBAC_ADGROUPS_ERROR, RBAC_DATASETS_ERROR, RBAC_VIDM_GROUPS_ERROR, RBAC_VIDB_GROUPS_ERROR, SECURITY_ERROR, DEPLOYMENT_ERROR, SUPPORT_BUNDLE_ERROR, LOAD_BALANCER_ERROR, VIDM_ERROR, VIDB_ERROR, QUERY_ERROR, SSL_CERTIFICATE_ERROR, PROXY_ERROR,
object
errorDetails
Optional

Dynamic error details, where the field name can vary depending on the request field and error code.


Code Samples
COPY
                    curl -X POST -H 'Authorization: <value>' -H 'Content-Type: application/json' -d '[{}]' https://{api_host}/api/v2/licenses