Search Uploads

post

/serviceapi/logan.uploads/searches

Returns a list of uploads that satisfy the specified criteria, restricted by offset and limit.

Request

Supported Media Types
Query Parameters
Body ()
Filter that identifies uploads that should be returned. Required, but can be an empty JSON {}. JSON format for input: { "filter":{ "filters":[ { "name": oneOf("uploadName", "uploadUser"), "operator": oneOf("isEqual", "contains"), "values": [""] } ] }
Root Schema : schema
Type: array
Back to Top

Response

Supported Media Types

200 Response

Operation succeeded.

400 Response

Bad request. See response body for explanation.
Body ()
Root Schema : InternalErrorResponse
Type: object
Show Source
Nested Schema : messages
Type: array
Show Source
Nested Schema : violations
Type: array
Show Source
Nested Schema : ParserViolation
Type: object
Show Source

403 Response

Forbidden. User does not have required privileges.

500 Response

Internal server error. See response body for explanation.
Body ()
Root Schema : InternalErrorResponse
Type: object
Show Source
Nested Schema : messages
Type: array
Show Source
Nested Schema : violations
Type: array
Show Source
Nested Schema : ParserViolation
Type: object
Show Source
Back to Top

Examples

The following example shows how retrieve the list of uploads whose name contains "SR" by submitting a POST request on the REST resource using cURL.

  1. Create a JSON file called test.json and copy the following:
    {
       "filter":{
          "filters":[
             {
                "name":"uploadName",
                "operator":"contains",
                "values":["SR"]
             }
          ]
       }
    }
  2. Run the following command to retrieve the list of uploads whose name contains "SR":

    curl -u "OMC_USERNAME" -X POST -H "Content-Type:application/json" "https://{OMC_URL}/serviceapi/logan.uploads/searches" -d "@test.json"

Example of Response

The following shows an example of the response body.

{
   "count":23,
   "hasMore":false,
   "items":[
      {
         "uploadId":1100,
         "uploadName":"SR_1234",
         "uploadUser":"adminuser",
         "createdOn":"2016-04-06T07:19:33.701Z",
         "modifiedOn":"2016-04-06T07:19:33.701Z",
         "earliestLogTime":"2016-04-06T07:19:33.701Z",         
         "latestLogTime":"2016-04-06T07:19:33.701Z",       
         "statusSummary":{
            "successful":1
         },
         "canonicalLink":"v1/logdata/uploads/1100"
      },
      {
         "uploadId":1000,
         "uploadName":"SR_5678",
         "uploadUser":"adminuser",
         "createdOn":"2016-04-01T21:54:56.911Z",
         "modifiedOn":""2016-04-01T21:54:56.911Z",
         "earliestLogTime":""2016-04-01T21:54:56.911Z",    
         "latestLogTime":""2016-04-01T21:54:56.911Z",      
         "statusSummary":{
            "successful":1
         },
         "canonicalLink":"v1/logdata/uploads/1000"
      },
      ...
   ],
   "canonicalLink":"v1/logdata/uploads"
}

Example 2: Delete a File

Run the following command to delete the file with uploadName=SyslogUpload and fileName=sys.log:

curl -u "OMC_USERNAME" -X DELETE -H "Content-Type:application/json" "https://{OMC_URL}/serviceapi/logan.uploads?uploadName=SyslogUpload&fileName=sys.log"

Example of Response

The following shows an example of the response body.

{
  "uploadUser" : "user",
  "uploadName" : "SyslogUpload",
  "fileName" : "sys.log",
  "deletedLogCount" : 102,
  "deletedLogFiles" : 1
}
Back to Top