CliQr is now part of Cisco Learn More About Cisco

jobs-get

Command Structure

rerun cliqr: jobs-get --job -id job-id --number numberOfItemsToReturn --status filterJobsByStatus

Command Description

Retrieves a list of available jobs or just the jobs specified by the Jobs ID or other criteria (numeric or alphanumeric IDs or error states).

Options

Option

Required?

Default

Description

job-id

Yes

None

The ID of the job.

number

No

None

The number of items to return in response to this command. The two latest records are displayed.

status

No

None

Filter response based on the job status.

The job status options are Running, Finished, Error, Cancelled, Error, Stopped, Suspended, Submitted, Scaling, Migrating, and Migration Error.

Guidelines

If you do not specify any option, this command returns all available jobs and corresponding details.

CloudCenter Release

Introduced in CloudCenter 3.2.6.5

Sample Command and Response

$ rerun cliqr: jobs-get 

{ 
"id": "33",
"resource": "https://<HOST>:<PORT>/v1/jobs/33",
"name": "JenkinsDmg_1_run_1",
"status": "Error",
"appId": "66",
"appVersion": "3.0",
"appName": "Jenkins_dmg",
"cloud": "Openstack-one",
"instance": null,
"depInitiatingUserId": "2",
"environmentId": "1",
"environment": "LongDeploymentEnvironmentToTestLongDeplo",
"environmentApprovalStatus": null,
"startTime": "2015-04-29 04:31:09.0",
"endTime": "2015-04-29 04:35:03.0"
}
{
"id": "31",
"resource": "https://<HOST>:<PORT>/v1/jobs/31",
"name": "JenkinsZip_1_run_1",
"status": "Stopped",
"appId": "66",
"appVersion": "2.0",
"appName": "Jenkins_dmg",
"cloud": "Openstack-one",
"instance": null,
"depInitiatingUserId": "2",
"environmentId": "1",
"environment": "LongDeploymentEnvironmentToTestLongDeplo",
"environmentApprovalStatus": null,
"startTime": "2015-04-29 04:30:04.0",
"endTime": "2015-04-30 00:19:15.0"
}
{
"id": "28",
"resource": "https://<HOST>:<PORT>/v1/jobs/28",
"name": "Sleep10Sec_2",
"status": "Canceled",
"appId": "65",
"appVersion": "0.0.0.0.0..0.0..0..0..00.",
"appName": "SleepJob",
"cloud": "Openstack-one",
"instance": null,
"depInitiatingUserId": "2",
"environmentId": "1",
"environment": "LongDeploymentEnvironmentToTestLongDeplo",
"environmentApprovalStatus": null,
"startTime": "2015-04-29 02:49:49.0",
"endTime": "2015-04-29 02:59:19.0"
}
{
"id": "25",
"resource": "https://<HOST>:<PORT>/v1/jobs/25",
"name": "Apache_R1_run_1",
"status": "Running",
"appId": "63",
"appVersion": "1",
"appName": "Apache",
"cloud": "Openstack-one",
"instance": null,
"depInitiatingUserId": "2",
"environmentId": "1",
"environment": "LongDeploymentEnvironmentToTestLongDeplo",
"environmentApprovalStatus": null,
"startTime": "2015-04-28 23:48:45.0",
"endTime": "N/A"
}

 

$ rerun cliqr: jobs-get --job-id 3 

{ 
"id": "3",
"resource": "https://<HOST>:<PORT>/v1/jobs/3",
"perms": [
"authorize",
"execute",
"approve",
"write",
"delete",
"read",
"move_out",
"manage",
"move_in",
"administration"
],
"name": "Run2_run_1",
"desc": "",
"status": "JobStopped",
"statusMsg": null,
"serviceTierId": "Jenkins-38",
"appId": "38",
"appName": "Jenkins",
"appVersion": "1.0",
"depInitiatingUserId": "2",
"environmentId": "1",
"environment": "LongDeploymentEnvironmentToTestLongDeplo",
"environmentApprovalStatus": "NOT_APPLICABLE",
"keepExistingDeploymentAfterPromote": null,
"startTime": "2015-04-24 23:27:09.0",
"endTime": "2015-04-24 23:39:40.0",
"preventTermination": false,
"accessLink": "",
"parameters": {
"appParams": [
{
"name": "launchUserName",
"value": "cliqradmin"
},
{
"name": "cliqrUseCustomCert",
"value": "0"
},
{
"name": "cliqrWebappAccessLink",
"value": ""
},

{
"name": "cliqrNonStandardPort",
"value": ""
}
],
"cloudParams": {
"cloud": "Openstack-one",
"instance": "00487266-7ba9-4652-8ad9-f57c78c2b073",
"rootVolumeSize": null,
"storage": null,
"cloudProperties": []
}
},
"virtualMachines": [],
"nics": [],
"metadatas": [],
"tags": [],
"policies": [],
"volumeInfos": [],
"jobs": [
{
"id": "4",
"resource": "https://<HOST>:<PORT>/v1/jobs/4",
"perms": [
"authorize",
"execute",
"approve",
"write",
"delete",
"read",
"move_out",
"manage",
"move_in",
"administration"
],
"name": "tomcat6_0",
"desc": null,
"status": "JobStopped",
"statusMsg": null,
"serviceTierId": "tomcat6-39",
"appId": "39",
"appName": "tomcat6_0",
"appVersion": "1.0",
"depInitiatingUserId": null,
"environmentId": "1",
"environment": "LongDeploymentEnvironmentToTestLongDeplo",
"environmentApprovalStatus": null,
"keepExistingDeploymentAfterPromote": null,
"startTime": "2015-04-24 23:27:09.0",
"endTime": "2015-04-24 23:39:39.0",
"preventTermination": false,
"accessLink": null,
"parameters": {
"appParams": [
{
"name": "minAppClusterSize",
"value": "1"
},
{
"name": "cliqrSSLCert",
"value": ""
},

{
"name": "attachPublicIP",
"value": "false"
},
{
"name": "numNICs",
"value": "1"
}
]
}
},
"virtualMachines": [
{
"id": "c7f04a7c-d99b-45b8-bc25-e2de8e7e3f47",
"resource": "https://<HOST>:<PORT>/v1/virtualmachines/c7f04a7c-d99b-45b8-bc25-e2de8e7e3f47/metrics?jobId=4",
"perms": [],
"publicIp": "",
"privateIp": "10.0.0.30",
"hostName": "cqjw-bbe367842",
"status": "NodeTerminated",
"startTime": "2015-04-24 23:28:51.0",
"endTime": "2015-04-24 23:39:39.0"
}
],
"nics": [],
"metadatas": [],
"tags": [],
"policies": [],
"volumeInfos": [],
"jobs": []
}
]
}

$ rerun cliqr: jobs-get --job-status Running

{ 
 "id": "25",
 "resource": "https://<HOST>:<PORT>/v1/jobs/25",
 "name": "Apache_R1_run_1",
 "status": "Running",
 "appId": "63",
 "appVersion": "1",
 "appName": "Apache",
 "cloud": "Openstack-one",
 "instance": null,
 "depInitiatingUserId": "2",
 "environmentId": "1",
 "environment": "LongDeploymentEnvironmentToTestLongDeplo",
 "environmentApprovalStatus": null,
 "startTime": "2015-04-28 23:48:45.0",
 "endTime": "N/A"
 }
 {
 "id": "21",
 "resource": "https://10.110.13.100/v1/jobs/21",
 "name": "WP_Run1_run_1",
 "status": "Running",
 "appId": "59",
 "appVersion": "1.0",
 "appName": "WP",
 "cloud": "Openstack-one",
 "instance": null,
 "depInitiatingUserId": "2",
 "environmentId": "1",
 "environment": "LongDeploymentEnvironmentToTestLongDeplo",
 "environmentApprovalStatus": null,
 "startTime": "2015-04-28 23:18:12.0",
 "endTime": "N/A"
 }
 {
 "id": "18",
 "resource": "https://<HOST>:<PORT>/v1/jobs/18",
 "name": "Migrate1_run_1",
 "status": "Running",
 "appId": "43",
 "appVersion": "1.6",
 "appName": "Jenkins_T7",
 "cloud": "Openstack-one",
 "instance": null,
 "depInitiatingUserId": "2",
 "environmentId": "1",
 "environment": "LongDeploymentEnvironmentToTestLongDeplo",
 "environmentApprovalStatus": null,
 "startTime": "2015-04-28 05:35:48.0",
 "endTime": "N/A"
 }

$ rerun cliqr: jobs-get --number 2

{ 
 "id": "33",
 "resource": "https://<HOST>:<PORT>/v1/jobs/33",
 "name": "JenkinsDmg_1_run_1",
 "status": "Error",
 "appId": "66",
 "appVersion": "3.0",
 "appName": "Jenkins_dmg",
 "cloud": "Openstack-one",
 "instance": null,
 "depInitiatingUserId": "2",
 "environmentId": "1",
 "environment": "LongDeploymentEnvironmentToTestLongDeplo",
 "environmentApprovalStatus": null,
 "startTime": "2015-04-29 04:31:09.0",
 "endTime": "2015-04-29 04:35:03.0"
 }
 {
 "id": "31",
 "resource": "https://<HOST>:<PORT>/v1/jobs/31",
 "name": "JenkinsZip_1_run_1",
 "status": "Stopped",
 "appId": "66",
 "appVersion": "2.0",
 "appName": "Jenkins_dmg",
 "cloud": "Openstack-one",
 "instance": null,
 "depInitiatingUserId": "2",
 "environmentId": "1",
 "environment": "LongDeploymentEnvironmentToTestLongDeplo",
 "environmentApprovalStatus": null,
 "startTime": "2015-04-29 04:30:04.0",
 "endTime": "2015-04-30 00:19:15.0"
 }
  • No labels