License Keys APIs

License Keys APIs

APIs for managing License Keys

Table of Contents

1. Add a License Key

  • This API is used to add a license key.

  • Adding a license key which is already added , will give an error.

Tip : Refer to: Get a License Key to check if a license key is already present.

  • Adding an incorrect (key size and format) or an invalid license key (invalid or expired), will give an error.

1.1. Prerequisites

The following data is required

  • License key

  • Product type

  • License key description

1.2. Steps

  • Invoke the API

cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/license-keys' -i -X POST \
    -H 'Content-Type: application/json' \
    -H 'Accept: application/json' \
    -H 'Authorization: Bearer etYWRta....' \
    -d '{
  "key" : "XX0XX-XX0XX-XX0XX-XX0XX-XX0XX",
  "productType" : "NSXT",
  "description" : "NSXT license key"
}'

HTTP Request

POST /v1/license-keys HTTP/1.1
Content-Type: application/json
Accept: application/json
Content-Length: 109
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

{
  "key" : "XX0XX-XX0XX-XX0XX-XX0XX-XX0XX",
  "productType" : "NSXT",
  "description" : "NSXT license key"
}

HTTP Response

HTTP/1.1 201 Created
Location: /v1/license-keys/XX0XX-XX0XX-XX0XX-XX0XX-XX0XX

2. Get the License Keys

  • This API is used to get all the license keys.

  • This also gives the license key metrics like usage and validity of a license key.

  • License keys can be filtered based on product type and/or license key status.

2.1. Prerequisites

None
Get All License Keys

2.2. Steps

  • Invoke the API.

cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/license-keys' -i -X GET \
    -H 'Accept: application/json' \
    -H 'Authorization: Bearer etYWRta....'

HTTP Request

GET /v1/license-keys HTTP/1.1
Accept: application/json
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

HTTP Response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 912

{
  "elements" : [ {
    "id" : "2771f247-4278-4670-abc2-72ea899bf377",
    "key" : "XX0XX-XX0XX-XX0XX-XX0XX-XX0XX",
    "productType" : "VCENTER",
    "description" : "vCenter license key",
    "isUnlimited" : false,
    "licenseKeyUsage" : {
      "total" : 5,
      "remaining" : 4,
      "used" : 1,
      "licenseUnit" : "INSTANCE"
    },
    "licenseKeyValidity" : {
      "licenseKeyStatus" : "ACTIVE",
      "expiryDate" : "2029-05-23T16:12:53.001Z"
    }
  }, {
    "id" : "dd0cd6dc-0b65-4b3c-8af4-98b1efe596f7",
    "key" : "XX0XX-XX0XX-XX0XX-XX0XX-XX0XX",
    "productType" : "NSXT",
    "description" : "NSX-T license key",
    "isUnlimited" : false,
    "licenseKeyUsage" : {
      "total" : 15,
      "remaining" : 14,
      "used" : 1,
      "licenseUnit" : "VM"
    },
    "licenseKeyValidity" : {
      "licenseKeyStatus" : "ACTIVE",
      "expiryDate" : "2029-05-23T16:12:53.001Z"
    }
  } ]
}

Get License Keys By Product Type

2.3. Steps

  • Invoke the API by specifying the _"productType".

cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/license-keys?productType=VCENTER,ESXI' -i -X GET \
    -H 'Accept: application/json' \
    -H 'Authorization: Bearer etYWRta....'

HTTP Request

GET /v1/license-keys?productType=VCENTER,ESXI HTTP/1.1
Accept: application/json
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

HTTP Response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 471

{
  "elements" : [ {
    "id" : "d8a312b2-ce4d-477b-ae97-50d634cde22f",
    "key" : "XX0XX-XX0XX-XX0XX-XX0XX-XX0XX",
    "productType" : "VCENTER",
    "description" : "vCenter license key",
    "isUnlimited" : false,
    "licenseKeyUsage" : {
      "total" : 5,
      "remaining" : 4,
      "used" : 1,
      "licenseUnit" : "INSTANCE"
    },
    "licenseKeyValidity" : {
      "licenseKeyStatus" : "ACTIVE",
      "expiryDate" : "2029-05-23T16:12:53.001Z"
    }
  } ]
}

Get License Keys By Status Of The License Key

2.4. Steps

  • Invoke the API by specifying the _"licenseKeyStatus".

cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/license-keys?licenseKeyStatus=ACTIVE,NEVER_EXPIRES' -i -X GET \
    -H 'Accept: application/json' \
    -H 'Authorization: Bearer etYWRta....'

HTTP Request

GET /v1/license-keys?licenseKeyStatus=ACTIVE,NEVER_EXPIRES HTTP/1.1
Accept: application/json
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

HTTP Response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 471

{
  "elements" : [ {
    "id" : "99da72a2-ce2d-4d83-9203-42f919ba668e",
    "key" : "XX0XX-XX0XX-XX0XX-XX0XX-XX0XX",
    "productType" : "VCENTER",
    "description" : "vCenter license key",
    "isUnlimited" : false,
    "licenseKeyUsage" : {
      "total" : 5,
      "remaining" : 4,
      "used" : 1,
      "licenseUnit" : "INSTANCE"
    },
    "licenseKeyValidity" : {
      "licenseKeyStatus" : "ACTIVE",
      "expiryDate" : "2029-05-23T16:12:53.001Z"
    }
  } ]
}

3. Get a License Key

  • This API is used to get the license key metrics like usage and validity of a license key.

  • If the license key does not exist, you will get an error.

3.1. Prerequisites

The following data is required

  • License key

3.2. Steps

  • Invoke the API

cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/license-keys/XX0XX-XX0XX-XX0XX-XX0XX-XX0XX' -i -X GET \
    -H 'Accept: application/json' \
    -H 'Authorization: Bearer etYWRta....'

HTTP Request

GET /v1/license-keys/XX0XX-XX0XX-XX0XX-XX0XX-XX0XX HTTP/1.1
Accept: application/json
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

HTTP Response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 416

{
  "id" : "9dd720ed-facc-4497-a6be-3a7c82f5cbff",
  "key" : "XX0XX-XX0XX-XX0XX-XX0XX-XX0XX",
  "productType" : "VCENTER",
  "description" : "vCenter license key",
  "isUnlimited" : false,
  "licenseKeyUsage" : {
    "total" : 5,
    "remaining" : 4,
    "used" : 1,
    "licenseUnit" : "INSTANCE"
  },
  "licenseKeyValidity" : {
    "licenseKeyStatus" : "ACTIVE",
    "expiryDate" : "2029-05-23T16:12:53.001Z"
  }
}

4. Delete a License Key

  • This API is used to delete a license key.

Warning : Deleting a license key which is in use, will give an error.

4.1. Prerequisites

The following data is required

  • License key

4.2. Steps

  • Invoke the API

cURL Request

$ curl 'https://sfo-vcf01.rainpole.io/v1/license-keys/XX0XX-XX0XX-XX0XX-XX0XX-XX0XX' -i -X DELETE \
    -H 'Accept: application/json' \
    -H 'Authorization: Bearer etYWRta....'

HTTP Request

DELETE /v1/license-keys/XX0XX-XX0XX-XX0XX-XX0XX-XX0XX HTTP/1.1
Accept: application/json
Host: sfo-vcf01.rainpole.io
Authorization: Bearer etYWRta....

HTTP Response

HTTP/1.1 204 No Content

Last updated 2023-04-27 11:11:38 PDT

Operations
POST
Add License Key
Add a License Key
DELETE
Delete License Key
Delete a License Key
GET
Get License Key
Get a License Key by key
GET
Get License Keys
Get the License Keys
GET
Get Licensing Info
Get the Licensing information