Skip to main content

Operation log

2.1.1 List operation logs​

API endpoint

GET /NSphere/api/operation-log/list

API description

List operation logs. Notes: category, categoryId, relatedCategory, and targetId may be combined. Common usage is category with targetId, or either used alone. New API added in E0930.

Request Content-Type

application/x-www-form-urlencoded

Response Content-Type

application/json

Request parameters

Parameter name

Description

Location

Required

Type

schema

targetId

Target object ID (e.g. VM, host).

query

false

integer(int64)

categoryId

ID of the target of the related task. categoryId requires both targetId and relatedCategory to be set. For example, to query VM action logs related to dynamic resource business expansion, set categoryId to the dynamic-resource-expansion ID, targetId to the related VM ID, and relatedCategory (operation category) to 50 (dynamic resource expansion).

query

false

integer(int64)

offset

Offset.

query

false

integer(int32)

limit

Number of records to return.

query

false

integer(int32)

sortDir

Sort type: 0 = no sort, 1 = ascending, 2 = descending. Defaults to no sort when sortField is not empty.

query

false

integer(int32)

sortField

Sort field. Supported: loginName, userName, operStartTime, operTime, address, category, targetName, result, level, event.

query

false

string

loginName

Login name.

query

false

string

userName

Operator name.

query

false

string

operTime_from

Start of the operation-completion time range. Format: YYYY-MM-DD, e.g. 2023-10-24.

query

false

string(date-time)

operTime_to

End of the operation-completion time range. Format: YYYY-MM-DD, e.g. 2023-10-24.

query

false

string(date-time)

operStartTime_from

Start of the operation-start time range. Format: YYYY-MM-DD, e.g. 2023-10-24.

query

false

string(date-time)

operStartTime_to

End of the operation-start time range. Format: YYYY-MM-DD, e.g. 2023-10-24.

query

false

string(date-time)

address

Login address.

query

false

string

category

Operation category. Enum: 0 = all actions, 1 = operator action, 2 = system configuration, 3 = cloud resource action, 4 = data center action, 5 = host action, 6 = storage action, 7 = network action, 8 = cluster action, 10 = VM action, 15 = template action, 16 = OVF template action, 21 = backup action, 22 = restore action, 50 = dynamic resource business expansion action, 60 = virtual storage action, 80 = alarm management action, 90 = resource pool scheduling action, 120 = site disaster recovery action, 130 = management platform action, 140 = storage adapter action, 150 = Cloud Rainbow action, 170 = command-line action, 180 = e-flow action, 194 = LAN-Free action, 196 = hot patch action, 197 = external cloud resource action, 198 = external cloud VM migration action, 199 = external cloud backup policy action, 200 = local disk action, 204 = bare metal action, 205 = component action, 206 = backup center action, 207 = host firewall action, 208 = upgrade management action, 209 = tag action, 211 = host profile action, 213 = crypto-evaluation configuration action, 217 = port group action, 218 = scheduled task action, 219 = resource analysis action, 220 = distributed firewall action, 221 = physical switch action, 222 = stretched domain action.

query

false

integer(int32)

relatedCategory

Category of the related task. Used together with categoryId and targetId. Enum values match category.

query

false

integer(int32)

result

Execution result. Enum: 0 = success, 1 = failure, 2 = partial success.

query

false

integer(int32)

description

Operation description (fuzzy match).

query

false

string

targetName

Target object (fuzzy match).

query

false

string

level

Risk level. Enum: 1000 = high, 2000 = medium, 3000 = low.

query

false

integer(int32)

event

Event type. Enum: 0 = all, 1001 = delete, 1002 = restore, 1003 = format, 1004 = convert, 1005 = migrate, 1006 = initialize, 1008 = mount, 1009 = unmount, 1010 = update signature, 2001 = add, 2002 = modify, 2003 = clone, 2004 = back up, 2005 = deploy, 2006 = enter maintenance, 2007 = exit maintenance, 2008 = copy, 2009 = import, 2010 = export, 2011 = distribute, 2012 = configure, 2013 = manage, 2014 = upgrade, 2015 = execute command, 2018 = install, 2019 = uninstall, 2020 = register, 2021 = enter isolation, 2022 = exit isolation, 3001 = start, 3002 = shut down, 3003 = reboot, 3004 = pause, 3005 = hibernate, 3006 = resume, 3007 = log in, 3008 = log out, 3009 = connect, 3010 = disconnect, 3011 = cancel, 3012 = scan, 3013 = refresh, 3014 = sync, 3019 = detect, 5003 = log file collection, 5004 = submit.

query

false

integer(int32)

Response status

Response code

Description

schema

200

OK

RpcPagingLoadResultApiOperationLogVO

Response parameters

Parameter name

Description

Type

schema

state

integer(int32)

integer(int32)

errorCode

integer(int32)

integer(int32)

successMessage

string

failureMessage

string

data

array

ApiOperationLogVO

id

Operation log ID.

integer(int64)

loginName

Login name.

string

userName

Operator name.

string

operStartTime

Start time.

string(date-time)

operTime

Completion time.

string(date-time)

address

Login address.

string

category

Operation category. Enum: 0 = all actions, 1 = operator action, 2 = system configuration, 3 = cloud resource action, 4 = data center action, 5 = host action, 6 = storage action, 7 = network action, 8 = cluster action, 10 = VM action, 15 = template action, 16 = OVF template action, 21 = backup action, 22 = restore action, 50 = dynamic resource business expansion action, 60 = virtual storage action, 80 = alarm management action, 90 = resource pool scheduling action, 120 = site disaster recovery action, 130 = management platform action, 140 = storage adapter action, 150 = Cloud Rainbow action, 170 = command-line action, 180 = e-flow action, 194 = LAN-Free action, 196 = hot patch action, 197 = external cloud resource action, 198 = external cloud VM migration action, 199 = external cloud backup policy action, 200 = local disk action, 204 = bare metal action, 205 = component action, 206 = backup center action, 207 = host firewall action, 208 = upgrade management action, 209 = tag action, 211 = host profile action, 213 = crypto-evaluation configuration action, 217 = port group action, 218 = scheduled task action, 219 = resource analysis action, 220 = distributed firewall action, 221 = physical switch action, 222 = stretched domain action.

integer(int32)

description

Operation description.

string

result

Execution result.

integer(int32)

progress

Progress.

integer(int32)

failureReason

Failure reason (returned only when the result is a failure).

string

targetName

Target object.

string

level

Risk level. Enum: 1000 = high, 2000 = medium, 3000 = low.

integer(int32)

event

Event type. Enum: 0 = all, 1001 = delete, 1002 = restore, 1003 = format, 1004 = convert, 1005 = migrate, 1006 = initialize, 1008 = mount, 1009 = unmount, 1010 = update signature, 2001 = add, 2002 = modify, 2003 = clone, 2004 = back up, 2005 = deploy, 2006 = enter maintenance, 2007 = exit maintenance, 2008 = copy, 2009 = import, 2010 = export, 2011 = distribute, 2012 = configure, 2013 = manage, 2014 = upgrade, 2015 = execute command, 2018 = install, 2019 = uninstall, 2020 = register, 2021 = enter isolation, 2022 = exit isolation, 3001 = start, 3002 = shut down, 3003 = reboot, 3004 = pause, 3005 = hibernate, 3006 = resume, 3007 = log in, 3008 = log out, 3009 = connect, 3010 = disconnect, 3011 = cancel, 3012 = scan, 3013 = refresh, 3014 = sync, 3019 = detect, 5003 = log file collection, 5004 = submit.

integer(int32)

offset

integer(int32)

integer(int32)

totalLength

integer(int32)

integer(int32)

success

boolean

partSuccess

boolean

Response example

{
"state": null,
"errorCode": null,
"successMessage": null,
"failureMessage": null,
"data": [
{
"id": null,
"loginName": null,
"userName": null,
"operStartTime": null,
"operTime": null,
"address": null,
"category": null,
"description": null,
"result": null,
"progress": null,
"failureReason": null,
"targetName": null,
"level": null,
"event": null
}
],
"offset": null,
"totalLength": null,
"success": true,
"partSuccess": true
}