Skip to main content
Solved

Killing Job using REST Api with reason

  • April 28, 2023
  • 8 replies
  • 167 views

Forum|alt.badge.img

Hi!

Can I somehow set a reason when killing jobs using POST http://mycommcell.com/webconsole/api/Job/123456/action/kill request?

Best answer by NikkyArt

additionals,

u can use POST request “MultiJob Operation” to set value “operationDescription” displayed in “Reason for job delay”

example

curl --location 'http://{hostname}}/webconsole/api/Jobs/MultiJobOperation' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authtoken: QSDK {token}} \
--data '{
"operationDescription": "Test Job KILL",
"message": " ALL_SELECTED_JOBS",
"jobOpReq": {
"operationType": "JOB_KILL",
"jobs": [
{
"jobId": {jobid}
}
]
}
}'

 

8 replies

christopherlecky
Explorer
Forum|alt.badge.img+16

Forum|alt.badge.img+2
  • Novice
  • May 1, 2023

 just send POST request

http://WebConsoleHostName/webconsole/api/Job/{{jobId}}/action/kill

example POST request over use CURL for killing job

curl --location --request POST 'http://WebConsoleHostName/webconsole/api/Job/433/action/kill' \
--header 'Accept: application/json' \
--header 'Authtoken: QSDK token would be auto set after POST Login is called.' \
--data ''

 


Forum|alt.badge.img+2
  • Novice
  • Answer
  • May 1, 2023

additionals,

u can use POST request “MultiJob Operation” to set value “operationDescription” displayed in “Reason for job delay”

example

curl --location 'http://{hostname}}/webconsole/api/Jobs/MultiJobOperation' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authtoken: QSDK {token}} \
--data '{
"operationDescription": "Test Job KILL",
"message": " ALL_SELECTED_JOBS",
"jobOpReq": {
"operationType": "JOB_KILL",
"jobs": [
{
"jobId": {jobid}
}
]
}
}'

 


christopherlecky
Explorer
Forum|alt.badge.img+16

additionals,

u can use POST request “MultiJob Operation” to set value “operationDescription” displayed in “Reason for job delay”

example

curl --location 'http://{hostname}}/webconsole/api/Jobs/MultiJobOperation' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authtoken: QSDK {token}} \
--data '{
"operationDescription": "Test Job KILL",
"message": " ALL_SELECTED_JOBS",
"jobOpReq": {
"operationType": "JOB_KILL",
"jobs": [
{
"jobId": {jobid}
}
]
}
}'

 

FYI Looks like this is identical to the qoperation request.

The XML in the qoperation is identical to 

<?xml version='1.0' encoding='UTF-8'?>
<JobManager_PerformMultiCellJobOpReq message="" operationDescription="">
<jobOpReq operationType="">
<jobs jobId="" />
<jobs jobId="" />
</jobOpReq>
</JobManager_PerformMultiCellJobOpReq>

The Json in the /MultiJoboperation api

{
"operationDescription": "Test Job KILL",
"message": " ALL_SELECTED_JOBS",
"jobOpReq": {
"operationType": "JOB_KILL",
"jobs": [
{
"jobId": ""
}
]
}
}

 

So the api is identical to the operation identifier “JobManager_PerformMultiCellJobOpReq”

 

It would be cool to get a map between the two.


Forum|alt.badge.img+2
  • Novice
  • May 1, 2023

additionals,

u can use POST request “MultiJob Operation” to set value “operationDescription” displayed in “Reason for job delay”

example

curl --location 'http://{hostname}}/webconsole/api/Jobs/MultiJobOperation' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authtoken: QSDK {token}} \
--data '{
"operationDescription": "Test Job KILL",
"message": " ALL_SELECTED_JOBS",
"jobOpReq": {
"operationType": "JOB_KILL",
"jobs": [
{
"jobId": {jobid}
}
]
}
}'

 

FYI Looks like this is identical to the qoperation request.

The XML in the qoperation is identical to 

<?xml version='1.0' encoding='UTF-8'?>
<JobManager_PerformMultiCellJobOpReq message="" operationDescription="">
<jobOpReq operationType="">
<jobs jobId="" />
<jobs jobId="" />
</jobOpReq>
</JobManager_PerformMultiCellJobOpReq>

The Json in the /MultiJoboperation api

{
"operationDescription": "Test Job KILL",
"message": " ALL_SELECTED_JOBS",
"jobOpReq": {
"operationType": "JOB_KILL",
"jobs": [
{
"jobId": ""
}
]
}
}

 

So the api is identical to the operation identifier “JobManager_PerformMultiCellJobOpReq”

 

It would be cool to get a map between the two.

 

yes, they are identical, but the question was about POST request via API ;)


christopherlecky
Explorer
Forum|alt.badge.img+16

The question was already answered. 
This was an observation on an implicit question.

The question being since api endpoints may or may not be defined for operation how does one determine if one already exists? 

And also if it doesn’t exist how do you accomplish unknown actions?

 

Not to worry. 
I will elaborate in a seperate post.


christopherlecky
Explorer
Forum|alt.badge.img+16

additionals,

u can use POST request “MultiJob Operation” to set value “operationDescription” displayed in “Reason for job delay”

example

curl --location 'http://{hostname}}/webconsole/api/Jobs/MultiJobOperation' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authtoken: QSDK {token}} \
--data '{
"operationDescription": "Test Job KILL",
"message": " ALL_SELECTED_JOBS",
"jobOpReq": {
"operationType": "JOB_KILL",
"jobs": [
{
"jobId": {jobid}
}
]
}
}'

 

FYI Looks like this is identical to the qoperation request.

The XML in the qoperation is identical to 

<?xml version='1.0' encoding='UTF-8'?>
<JobManager_PerformMultiCellJobOpReq message="" operationDescription="">
<jobOpReq operationType="">
<jobs jobId="" />
<jobs jobId="" />
</jobOpReq>
</JobManager_PerformMultiCellJobOpReq>

The Json in the /MultiJoboperation api

{
"operationDescription": "Test Job KILL",
"message": " ALL_SELECTED_JOBS",
"jobOpReq": {
"operationType": "JOB_KILL",
"jobs": [
{
"jobId": ""
}
]
}
}

 

So the api is identical to the operation identifier “JobManager_PerformMultiCellJobOpReq”

 

It would be cool to get a map between the two.

 

yes, they are identical, but the question was about POST request via API ;)

How did you find this api?

It’s not in Bol


Forum|alt.badge.img+2
  • Novice
  • May 1, 2023

additionals,

u can use POST request “MultiJob Operation” to set value “operationDescription” displayed in “Reason for job delay”

example

curl --location 'http://{hostname}}/webconsole/api/Jobs/MultiJobOperation' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authtoken: QSDK {token}} \
--data '{
"operationDescription": "Test Job KILL",
"message": " ALL_SELECTED_JOBS",
"jobOpReq": {
"operationType": "JOB_KILL",
"jobs": [
{
"jobId": {jobid}
}
]
}
}'

 

FYI Looks like this is identical to the qoperation request.

The XML in the qoperation is identical to 

<?xml version='1.0' encoding='UTF-8'?>
<JobManager_PerformMultiCellJobOpReq message="" operationDescription="">
<jobOpReq operationType="">
<jobs jobId="" />
<jobs jobId="" />
</jobOpReq>
</JobManager_PerformMultiCellJobOpReq>

The Json in the /MultiJoboperation api

{
"operationDescription": "Test Job KILL",
"message": " ALL_SELECTED_JOBS",
"jobOpReq": {
"operationType": "JOB_KILL",
"jobs": [
{
"jobId": ""
}
]
}
}

 

So the api is identical to the operation identifier “JobManager_PerformMultiCellJobOpReq”

 

It would be cool to get a map between the two.

 

yes, they are identical, but the question was about POST request via API ;)

How did you find this api?

It’s not in Bol


i have read the documentation - https://api.commvault.com