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
- application/json
Query Parameters
-
includeItems(optional): boolean
Indicates whether to include the items. If not specified items are included.
-
limit(optional): integer
Maximum number of results to return. Defaults to 50.
-
offset(optional): integer
First result to return. Defaults to 0.
-
orderBy(optional): string
Order in which results should be returned. The orderBy syntax is comma-separated list of fields along with an optional sort direction.
Valid fields include: uploadName, uploadUser, modifiedOn and createdOn.
Valid sort directions include: asc and desc.
Default: modifiedOn:desc.
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
Response
Supported Media Types
- application/json
200 Response
Operation succeeded.
400 Response
Bad request. See response body for explanation.
Root Schema : InternalErrorResponse
Type:
Show Source
object
-
messages(optional):
array messages
-
type(optional):
string
Allowed Values:
[ "PARSERERROR", "INVALIDPARAMETER", "UNSUPPORTEDSUBSYSTEM", "UNSUPPORTEDFILTER", "UNSUPPORTEDVERSION", "INVALIDJOBID", "INVALIDQUERYID", "FORBIDDEN", "INTERNALERROR", "JSONERROR", "INTERRUPTEDERROR", "EXECUTIONERROR", "COMPILATIONERROR", "SERVICEAVAILABILITYERROR" ]
-
violations(optional):
array violations
403 Response
Forbidden. User does not have required privileges.
500 Response
Internal server error. See response body for explanation.
Root Schema : InternalErrorResponse
Type:
Show Source
object
-
messages(optional):
array messages
-
type(optional):
string
Allowed Values:
[ "PARSERERROR", "INVALIDPARAMETER", "UNSUPPORTEDSUBSYSTEM", "UNSUPPORTEDFILTER", "UNSUPPORTEDVERSION", "INVALIDJOBID", "INVALIDQUERYID", "FORBIDDEN", "INTERNALERROR", "JSONERROR", "INTERRUPTEDERROR", "EXECUTIONERROR", "COMPILATIONERROR", "SERVICEAVAILABILITYERROR" ]
-
violations(optional):
array violations
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.
- Create a JSON file called test.json and copy the following:
{ "filter":{ "filters":[ { "name":"uploadName", "operator":"contains", "values":["SR"] } ] } }
-
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 }