Before you can add products, you first set up your system by adding a required password to your locker, adding a data center, and adding a vCenter to the data center. Adding the vCenter requires the locker password.

Prerequisites

Procedure

  1. Create a password in a password store.
    curl -X POST \
      '$url/lcm/locker/api/v2/passwords' \
      -H 'Authorization: Basic YWRtaW5AbG9jYWw6VGhpc0lzUGFzc3dvcmQ=' \
      -H 'Content-Type: application/json'
      -d '{
        "alias": "VC-password",
        "password": "ExampleLockerPassword",
        "passwordDescription": "",
        "principal": "",
        "transactionId": "",
        "userName": "",
    }' | jq "."
  2. Create a data center.
    curl -X POST \
      '$url/lcm/lcops/api/v2/datacenters' \
      -H 'Authorization: Basic YWRtaW5AbG9jYWw6VGhpc0lzUGFzc3dvcmQ=' \
      -H 'Content-Type: application/json' \
      -d '{
        "dataCenterName": "BLR",
        "primaryLocation": "Bangalore;Karnataka;IN;12.97194;77.59369"
    }' | jq "."
  3. Get all data centers.
    curl -X GET \
      '$url/lcm/lcops/api/v2/datacenters' \
      -H 'Accept: application/json' \
      -H 'Authorization: Basic YWRtaW5AbG9jYWw6VGhpc0lzUGFzc3dvcmQ=' | jq "."
    A snippet of the response shows the ID of the data center you created.
      {
        "dataCenterVmid": "ee6ce426-ca13-4e56-ad9e-c34a4d3d90c2",
        "dataCenterName": "BLR",
        "primaryLocation": "Bangalore;Karnataka;IN;12.97194;77.59369"
      },
      {
        "dataCenterVmid": "e76c15f4-0285-4801-ba4c-6032ff63f9f8",
        "dataCenterName": "SingaporeDC",
        "primaryLocation": "Singapore;;SG;1.28967;103.85007"
      }
  4. Assign the VM ID of the data center to a variable name.
    dataCenterVMid = '<datacenter_VM_ID>'
  5. Add a vCenter to the data center.
    curl -X POST \
      '$url/lcm/lcops/api/v2/datacenters/$dataCenterVMid/vcenters' \
      -H 'Accept: application/json' \
      -H 'Authorization: Basic YWRtaW5AbG9jYWw6VGhpc0lzUGFzc3dvcmQ=' \
      -H 'Content-Type: application/json' \
      -d '{
        "vCenterName": "VC1",
        "vCenterHost": "lcm-vc2.sqa.local",
        "vcUsername": "[email protected]",
        "vcPassword": "MyExamplePassword",
        "vcUsedAs": "MANAGEMENT"
    }' | jq "."
     

What to do next

You are ready to create an environment and install products in your system. Or if you have already created your environment, you can import products.