调用GetJob可以获取作业实例的详细信息。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

请求头

该接口使用公共请求头,无特殊请求头。请参见公共请求参数文档。

名称 类型 是否必选 示例 描述
workspace String a14bd5d90a****

工作空间ID。

请求语法

GET /api/v2/namespaces/{namespace}/jobs/{jobId} HTTP/1.1

请求参数

名称 类型 位置 是否必选 示例值 描述
namespace String Path default-namespace

项目空间名称。

jobId String Path 5af678c0-7db0-4650-94c2-d2604f0a****

作业实例ID。

返回数据

名称 类型 示例值 描述
requestId String CBC799F0-AS7S-1D30-8A4F-882ED4DD****

请求ID。

success Boolean true

表示业务请求是否成功。

httpCode Integer 200

固定值200。

errorCode String ""
  • 当success为false,返回业务错误码;
  • 当success为true,返回空值。
errorMessage String ""
  • 当success为false,返回业务错误信息;
  • 当success为true,返回空值。
data Job
  • 当success为true,返回查询的实例信息;
  • 当success为false,返回空值。

示例

请求示例

GET /api/v2/namespaces/default-namespace/jobs/5af678c0-7db0-4650-94c2-d2604f0a**** HTTP/1.1
Host:ververica.aliyuncs.com
workspace:a14bd5d90a****
Content-Type:application/json

正常返回示例

XML格式

HTTP/1.1 200 OK
Content-Type:application/xml

<GetJobResponse>
    <requestId>CBC799F0-AS7S-1D30-8A4F-882ED4DD****</requestId>
    <success>true</success>
    <httpCode>200</httpCode>
    <errorCode>""</errorCode>
    <errorMessage>""</errorMessage>
    <data>
        <jobId>354dde66-a3ae-463e-967a-0b4107fd****</jobId>
        <deploymentId>354dde66-a3ae-463e-967a-0b4107fd****</deploymentId>
        <deploymentName>flinktest</deploymentName>
        <namespace>namespacetest</namespace>
        <executionMode>BATCH</executionMode>
        <startTime>1660190835</startTime>
        <endTime>1660277235</endTime>
        <engineVersion>vvr-4.0.14-flink-1.13</engineVersion>
        <status>
            <currentJobStatus>RUNNING</currentJobStatus>
            <running>
                <observedFlinkJobRestarts>4</observedFlinkJobRestarts>
                <observedFlinkJobStatus>RUNNING</observedFlinkJobStatus>
            </running>
        </status>
        <metric>
            <totalMemoryByte>4096</totalMemoryByte>
            <totalCpu>2</totalCpu>
        </metric>
        <sessionClusterName>preview</sessionClusterName>
        <artifact>
            <sqlArtifact>
                <sqlScript>CREATE TEMPORARY TABLE datagen_source(   name VARCHAR ) WITH (   'connector' = 'datagen' ); CREATE TEMPORARY TABLE blackhole_sink(   name  VARCHAR ) with (   'connector' = 'blackhole' ); INSERT INTO blackhole_sink SELECT name from datagen_source;</sqlScript>
            </sqlArtifact>
            <kind>SQLSCRIPT</kind>
        </artifact>
        <logging>
            <loggingProfile>oss</loggingProfile>
            <log4j2ConfigurationTemplate>xml格式文本</log4j2ConfigurationTemplate>
            <log4jLoggers>
                <loggerName>StdOutErrConsoleAppender</loggerName>
                <loggerLevel>ERROR</loggerLevel>
            </log4jLoggers>
            <logReservePolicy>
                <openHistory>true</openHistory>
                <expirationDays>7</expirationDays>
            </logReservePolicy>
        </logging>
        <batchResourceSetting>
            <maxSlot>10</maxSlot>
            <basicResourceSetting>
                <parallelism>4</parallelism>
                <jobmanagerResourceSettingSpec>
                    <cpu>2</cpu>
                    <memory>4Gi</memory>
                </jobmanagerResourceSettingSpec>
                <taskmanagerResourceSettingSpec>
                    <cpu>2</cpu>
                    <memory>4Gi</memory>
                </taskmanagerResourceSettingSpec>
            </basicResourceSetting>
        </batchResourceSetting>
        <restoreStrategy>
            <kind>LATEST_STATE</kind>
            <allowNonRestoredState>true</allowNonRestoredState>
            <jobStartTimeInMs>1660293803155</jobStartTimeInMs>
            <savepointId>354dde66-a3ae-463e-967a-0b4107fd****</savepointId>
        </restoreStrategy>
    </data>
</GetJobResponse>

JSON格式

HTTP/1.1 200 OK
Content-Type:application/json

{
  "requestId" : "CBC799F0-AS7S-1D30-8A4F-882ED4DD****",
  "success" : true,
  "httpCode" : 200,
  "errorCode" : "\"\"",
  "errorMessage" : "\"\"",
  "data" : {
    "jobId" : "354dde66-a3ae-463e-967a-0b4107fd****",
    "deploymentId" : "354dde66-a3ae-463e-967a-0b4107fd****",
    "deploymentName" : "flinktest",
    "namespace" : "namespacetest",
    "executionMode" : "BATCH",
    "startTime" : 1660190835,
    "endTime" : 1660277235,
    "engineVersion" : "vvr-4.0.14-flink-1.13",
    "status" : {
      "currentJobStatus" : "RUNNING",
      "running" : {
        "observedFlinkJobRestarts" : 4,
        "observedFlinkJobStatus" : "RUNNING"
      }
    },
    "metric" : {
      "totalMemoryByte" : 4096,
      "totalCpu" : 2
    },
    "sessionClusterName" : "preview",
    "artifact" : {
      "sqlArtifact" : {
        "sqlScript" : "CREATE TEMPORARY TABLE datagen_source(   name VARCHAR ) WITH (   'connector' = 'datagen' ); CREATE TEMPORARY TABLE blackhole_sink(   name  VARCHAR ) with (   'connector' = 'blackhole' ); INSERT INTO blackhole_sink SELECT name from datagen_source;",
        "additionalDependencies" : [ ]
      },
      "kind" : "SQLSCRIPT"
    },
    "logging" : {
      "loggingProfile" : "oss",
      "log4j2ConfigurationTemplate" : "xml格式文本",
      "log4jLoggers" : [ {
        "loggerName" : "StdOutErrConsoleAppender",
        "loggerLevel" : "ERROR"
      } ],
      "logReservePolicy" : {
        "openHistory" : true,
        "expirationDays" : 7
      }
    },
    "batchResourceSetting" : {
      "maxSlot" : 10,
      "basicResourceSetting" : {
        "parallelism" : 4,
        "jobmanagerResourceSettingSpec" : {
          "cpu" : 2,
          "memory" : "4Gi"
        },
        "taskmanagerResourceSettingSpec" : {
          "cpu" : 2,
          "memory" : "4Gi"
        }
      }
    },
    "restoreStrategy" : {
      "kind" : "LATEST_STATE",
      "allowNonRestoredState" : true,
      "jobStartTimeInMs" : 1660293803155,
      "savepointId" : "354dde66-a3ae-463e-967a-0b4107fd****"
    }
  }
}