Configuring a CLWizard/CLAPI site/BOX using CLAPI and CLWizard
These steps are for configuring a CLWizard/CLAPI site/BOX using CLAPI and CLWizard.
-
Create the BOX site.
-
- On the Project page, select the site to open.
- On Project home, click Save As Template.
- On the Save Project As Template page, specify the template name and click Save. Wait until the new BOX is created.
- 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. - Request
URL:
-
-
Export and download the BOX to your local machine.
- 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": "" }
- Request
URL:
- 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
- Export a BOX to a directory under HICROOT using an API:
-
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
-
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": "" }
- Request URL:
-
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": "" }
- Request URL:
- Request URL: