Help Center/ Ubiquitous Cloud Native Service/ API Reference/ API/ Policy Management/ Obtaining the Job Related to a Specific Policy Instance
Updated on 2025-12-01 GMT+08:00

Obtaining the Job Related to a Specific Policy Instance

Function

This API is used to obtain the job related to a specific policy instance.

URI

GET /v1/policy/jobs/{jobid}

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

jobid

Yes

String

Job ID

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

No

String

Identity authentication information. Requests for calling an API can be authenticated using either a token or AK/SK. If token-based authentication is used, this parameter is mandatory and must be set to a user token.

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

kind

String

API type

apiVersion

String

API version

metadata

ObjectMeta object

Resource metadata

spec

UCSJobSpec object

Job specification

status

UCSJobStatus object

Current job status

Table 4 UCSJobSpec

Parameter

Type

Description

taskList

Array of UCSTask objects

Task list

domainID

String

Domain ID of a user

operation

String

Operation. The value can be create or retry.

waitTimeOut

Integer

Job waiting time, in seconds

type

String

Job type

relatedObjects

Map<String,String>

Related objects

extendParam

Map<String,Object>

Extended parameters

Table 5 UCSTask

Parameter

Type

Description

kind

String

API type

apiVersion

String

API version

metadata

ObjectMeta object

Task object metadata

spec

UCSTaskSpec object

Task configuration details

status

UCSTaskStatus object

Actual task status

Table 6 ObjectMeta

Parameter

Type

Description

uid

String

Resource ID

name

String

Resource name

generateName

String

If no name is provided, the server uses the prefix to generate a unique name.

namespace

String

Namespace

labels

Map<String,String>

Label

annotations

Map<String,String>

Annotation

creationTimestamp

String

Creation time

updateTimestamp

String

Update time

resourceVersion

String

Internal version of a resource

generation

String

Generation of the desired resource state

managedFields

Array of ManagedFieldsEntry objects

Fields managed by workflows

ownerReferences

Array of OwnerReference objects

Ownership, dependencies, and garbage collection mechanism of objects. It supports resource management by the controller.

Table 7 ManagedFieldsEntry

Parameter

Type

Description

manager

String

Manager name

operation

String

Operation type that causes this entry being created. The value can only be Apply or Update.

apiVersion

String

Resource API version used by a manager for defining fields

time

String

Timestamp when this entry was created or last updated

fieldsType

String

Field structure format. The value is fixed at "FieldsV1".

fieldsV1

Object

Information about the managed fields

Table 8 OwnerReference

Parameter

Type

Description

apiVersion

String

API version of the referent

kind

String

Type of the referent

name

String

Name of the referent

uid

String

UID of the referent

controller

Boolean

If the value is true, this reference points to the controller that manages the resource.

blockOwnerDeletion

Boolean

If the value is true and the owner has a finalizer named foregroundDeletion, the owner cannot be deleted until this reference is removed.

Table 9 UCSTaskSpec

Parameter

Type

Description

jobID

String

ID of the job that a task belongs to

target

String

Task target

targetType

String

Type of the target to be executed

waitTimeOut

Integer

How long a task waits before being executed, in seconds

type

String

Task type

runway

String

Task execution mode. The value can be parallel or serial.

Table 10 UCSTaskStatus

Parameter

Type

Description

status

String

Status

reason

String

Reason for the current status

startTime

String

Start time

finishTime

String

End time

Table 11 UCSJobStatus

Parameter

Type

Description

status

String

Job status. Options:

  • Running: The job is running.

  • TimedOut: The job execution timed out.

  • Succeeded: The job has been executed.

  • Failed: The job failed to be executed.

reason

String

Reason

startTime

String

Start time

finishTime

String

End time

Status code: 400

Table 12 Response body parameters

Parameter

Type

Description

-

String

-

Status code: 500

Table 13 Response body parameters

Parameter

Type

Description

-

String

-

Example Requests

None

Example Responses

Status code: 200

Information about the job related to a specific policy instance obtained

{
  "kind" : "job",
  "apiVersion" : "job.workflow.io/v1alpha1",
  "metadata" : {
    "name" : "UpdateConstraint_2ea2e874",
    "uid" : "c7678551-1f7e-4699-9ea1-3baa2d32f552",
    "creationTimestamp" : "2025-11-10 07:24:03.529155 +0000 UTC",
    "updateTimestamp" : "2025-11-10 07:24:08.526889 +0000 UTC"
  },
  "spec" : {
    "taskList" : [ {
      "kind" : "task",
      "apiVersion" : "task.workflow.io/v1alpha1",
      "metadata" : {
        "name" : "be72df63-7dfa-426d-acc9-6c426c4e979c",
        "uid" : "b387d7e9-b99f-4914-acf6-cd666b7473aa",
        "creationTimestamp" : "2025-11-10 07:24:03.536701 +0000 UTC",
        "updateTimestamp" : "2025-11-10 07:24:08.513561 +0000 UTC"
      },
      "spec" : {
        "jobID" : "c7678551-1f7e-4699-9ea1-3baa2d32f552",
        "target" : "be72df63-7dfa-426d-acc9-6c426c4e979c",
        "targetType" : "cluster",
        "type" : "UpdateConstraint",
        "runway" : "parallel",
        "waitTimeOut" : 3600
      },
      "status" : {
        "status" : "Succeeded",
        "startTime" : "2025-11-10T15:24:03.553733+08:00",
        "finishTime" : "2025-11-10T15:24:04.689462+08:00"
      }
    } ],
    "domainID" : "05495693d180d3c90f9ec0171879f760",
    "operation" : "create",
    "waitTimeOut" : 3600,
    "type" : "UpdateConstraint",
    "extendParam" : {
      "constraintID" : "eb6e4196-1508-49d3-98a5-ee656d146c4f"
    }
  },
  "status" : {
    "status" : "Succeeded",
    "startTime" : "2025-11-10T15:24:03.540316+08:00",
    "finishTime" : "2025-11-10T15:24:08.524767+08:00"
  }
}

Status Codes

Status Code

Description

200

Information about the job related to a specific policy instance obtained

400

Client request error. The server could not execute the request.

500

Internal server error

Error Codes

See Error Codes.