Configuring a CLWizard/CLAPI site/BOX using CLAPI and CLWizard

These steps are for configuring a CLWizard/CLAPI site/BOX using CLAPI and CLWizard.

  1. Create the BOX site.
      1. On the Project page, select the site to open.
      2. On Project home, click Save As Template.
      3. On the Save Project As Template page, specify the template name and click Save. Wait until the new BOX is created.
      4. On the Templates (BOXes) page, confirm that the newly created BOX is listed.
    • Using the API:
      POST: https://HostName:15057/clapi/api/command/hcibox?s=SiteName&boxname=BoxName
      • Request URL:
        https://localhost:15057/clapi/api/command/hcibox?s=helloworld&boxname=helloworldbox
      • Request headers:
        {
         "Accept": "*/*"
        }
      • Response body:
        {
         "status":0,
         "stdout": "The BOX 'helloworldbox' has been created successfully.\r\n",
         "stderr": ""
        } 
      Note: The Wizard does not support adding additional library files into the BOX. These are added using the IDE.
  2. Export and download the BOX to your local machine.
    1. Export a BOX to a directory under HICROOT using an API:
      POST: https://HostName:15057/clapi/api/command/hcibox?e=PathToExportBox&boxname=BoxName
      • Request URL:
        https://localhost:15057/clapi/api/command/hcibox?e=temp%2Fhelloworld&boxname=helloworldbox
      • Request headers:
        {
         "Accept": "*/*"
        }
      • Response body:
        {
         "status":0,
         "stdout": "The BOX 'helloworldbox' has been exported to 'temp/helloworldbox.box' successfully.\r\n",
         "stderr": ""
        } 
    2. Downloading the BOX zip package using an API:
      Note: For Infor Cloud Cloverleaf 19.1.2, the Wizard and API do not support binary file downloading.

      Beginning in CIS 20.1, there is a new CLAPI interface that supports downloading binary files that are under a site directory. To do this, use:

      GET: /clapi/api/root/site/SiteName/downloadfile?file=FilePath
  3. Upload the BOX from your local machine to Cloverleaf.

    Use this API to upload a BOX file to the HCIROOT/temp directory:

    POST: /api/root/uploadtempfile
    // curl to get CSRF token
    curl -G https://<HostName>:15057/clapi/api/security/csrf -k --header "Authorization:Basic Base64 Encoded UserName:Password" 
        -c cookieFile.out -v
    // curl to upload BOX to remote cloverleaf HCIROOT/temp directory
    curl https://HostName:15057/clapi/api/root/site/helloworld/uploadfile?"file=BoxName&append=false" 
        -k --header "Authorization:Basic Base64 Encoded UserName:Password" -H "Content-Type:multipart/form-data"
        -F "inbinfile=@FullPathOfTheBOXToUpload" --header "X-CSRF-TOKEN:CSRF Token" -b cookieFile.out -v
  4. Import the BOX, using:
    POST: https://HostName:15057/clapi/api/command/hcibox?i=BoxFileRelativePath&boxname=BoxName
    • Request URL:
      https://localhost:15057/clapi/api/command/hcibox?i=temp%2Fhelloworldbox.box&boxname=helloworldbox2
    • Request headers:
      {
       "Accept": "*/*"
      }
    • Response body:
      {
       "status":0,
       "stdout": "The BOX 'temp/helloworldbox.box' has been imported successfully.\r\n",
       "stderr": ""
      } 
  5. BOX deployment can be to an existing site or a new site.
    To deploy the BOX to an existing site:
    POST: https://HostName:15057/clapi/api/command/hcibox?d=SiteName&v=true&boxname=BoxName
    • Request URL:
      https://localhost:15057/clapi/api/command/hcibox?d=helloworld&v=true&boxname=helloworldbox2
    • Request headers:
      {
       "Accept": "*/*"
      }
    • Response body:
      {
       "status":0,
       "stdout": "Deploying BOX 'helloworldbox2' to site 'helloworld'\r\nCopying resources to box 'helloworldbox2'. . . . .
       "stderr": ""
      } 
    To deploy the BOX to a new site:
    • In CL Wizard, select the BOX on the Templates (BOXes) page and click Create New BOX.

      or

    • POST: https://HostName:15057/clapi/api/command/hcibox?c=NewSiteName&v=true&boxname=BoxName
      • Request URL:
        https://localhost:15057/clapi/api/command/hcibox?c=helloworld2&v=true&boxname=helloworldbox2
      • Request headers:
        {
         "Accept": "*/*"
        }
      • Response body:
        {
         "status":0,
         "stdout": "Deploying BOX 'helloworldbox2' to site 'helloworld2'\r\nCopying resources to box 'helloworldbox2' . . . . .
         "stderr": ""
        }