Create a file object to use in a configuration

Overview

Files configured and used in file objects are managed as file objects in the BIG-IQ system.

Version Information

Version : BIG-IQ 6.0.0, 6.0.1

Prerequisites:

Users should have RBAC permissions to create a file object using LFO workers.

Actions:

To create a file object, perform the following steps.

  • Copy the file to the download location in the BIG-IQ system.
  • Initiate and monitor the “LFOWorker” task to create file object.

Copy the file to the download location in the BIG-IQ system::

Manually copy the file using SCP or any other file transfer tool to the following BIG-IQ location: “/var/config/rest/downloads/”.

Initiate, and monitor the “LFOWorker” task to create the file object.

Once the file is copied to the BIG-IQ system, create the fileObject as follows:

POST:  https://10.192.123.178/mgmt/shared/file-object-tasks/


post data for the LFO worker:

{
     fileType : "rec"
     lfoWorkerPath : "/cm/access/working-config/file-objects"
     localFileName : "nodesecret.rec"
     requestType : "LOCAL_SOURCE_FILE"
     sourceFilePath : "/var/config/rest/downloads/nodesecret.rec"
}


Response :
{
    "sourceFilePath":"/var/config/rest/downloads/nodesecret.rec",
    "fileType":"rec",
    "localFileName":"nodesecret.rec",
    "lfoWorkerPath":"/cm/access/working-config/file-objects",
    "requestType":"LOCAL_SOURCE_FILE","id":"7fce5bf3-7a89-4eb7-bea6-1b3768c34d1a",
    "status":"CREATED",
    "userReference":{
      "link":"https://localhost/mgmt/shared/authz/users/admin"
    },
    "identityReferences":[
        {
          "link":"https://localhost/mgmt/shared/authz/users/admin"
        }
    ],
    "ownerMachineId":"b4dfbfd1-02a6-47bb-8f0e-d09d1c08b383",
    "generation":1,
    "lastUpdateMicros":1519946754046791,
    "kind":"shared:file-object-tasks:fileobjecttaskstate",
    "selfLink":"https://localhost/mgmt/shared/file-object-tasks/7fce5bf3-7a89-4eb7-bea6-1b3768c34d1a"
}

After the task is complete, use the selfLink of the response to get the reference for the file object.

GET: https://10.192.123.178/mgmt/shared/file-object-tasks/7fce5bf3-7a89-4eb7-bea6-1b3768c34d1a


Response:
{
    "endDateTime":"2018-03-01T15:25:54.155-0800",
    "fileObjectStateReference":{
        "link":"https://localhost/mgmt/cm/access/working-config/file-objects/59fa69cf-3131-1111-8ad7-a3416ed521a1"
    },
    "fileType":"rec",
    "generation":6,
    "id":"7fce5bf3-7a89-4eb7-bea6-1b3768c34d1a",
    "identityReferences":[{"link":"https://localhost/mgmt/shared/authz/users/admin"}],
    "kind":"shared:file-object-tasks:fileobjecttaskstate",
    "lastUpdateMicros":1519946754156050,
    "lfoWorkerPath":"/cm/access/working-config/file-objects",
    "localFileName":"nodesecret.rec",
    "ownerMachineId":"b4dfbfd1-02a6-47bb-8f0e-d09d1c08b383",
    "requestType":"LOCAL_SOURCE_FILE","selfLink":"https://localhost/mgmt/shared/file-object-tasks/7fce5bf3-7a89-4eb7-bea6-1b3768c34d1a",
    "sourceFilePath":"/var/config/rest/downloads/nodesecret.rec",
    "startDateTime":"2018-03-01T15:25:54.096-0800",
    "status":"FINISHED",
    "userReference":{
        "link":"https://localhost/mgmt/shared/authz/users/admin"
    }
}

Using fileObjectStateReference, get details about the file. Use these details in the configuration object where the file is used.

GET: https://10.192.123.178/mgmt/cm/access/working-config/file-objects/59fa69cf-3131-1111-8ad7-a3416ed521a1


Response:

{
    "localFileName":"nodesecret.rec",
    "localFilePath":"/var/config/rest/fileobject/59fa69cf-3131-1111-8ad7-a3416ed521a1/nodesecret.rec",
    "fileType":"rec",
    "fileSize":528,
    "fileChecksum":"SHA1:528:0e403c3077469db4322b78df8a8609cbde031ade",
    "status":"ACTIVE",
    "id":"59fa69cf-3131-1111-8ad7-a3416ed521a1",
    "generation":1,
    "lastUpdateMicros":1519946754145645,
    "kind":"cm:access:working-config:file-objects:accessfileobjectstate",
    "selfLink":"https://localhost/mgmt/cm/access/working-config/file-objects/59fa69cf-3131-1111-8ad7-a3416ed521a1"
}