Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Situation Awareness
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
Software Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

Importing a Job

Updated on 2024-11-06 GMT+08:00

Function

This API is used to import one or more job files from OBS to DLF.

NOTE:

Before using this API, store job files in OBS buckets.

URI

  • URI format

    POST /v1/{project_id}/jobs/import

  • Parameter description
    Table 1 URI parameter

    Parameter

    Mandatory

    Type

    Description

    project_id

    Yes

    String

    Project ID. For details about how to obtain a project ID, see Project ID and Account ID.

Request Parameters

Table 2 Request parameters

Parameter

Mandatory

Type

Description

path

Yes

String

If OBS is deployed, it refers to the OBS path for storing the job definition file. For the format of the job definition file, see the response message of the exported job, for example, obs://myBucket/jobs.zip.

params

No

Map<String,String>

Public job parameters

sameNamePolicy

No

String

Policy for specifying how to handle duplicate names. The options are as follows:

  • SKIP
  • OVERWRITE

Default value: SKIP

jobsParam

No

List<JobParam>

Job parameter. For details, see Table 3.

executeUser

No

String

User that executes the job

targetStatus

No

String

This parameter is required if the review function is enabled. It indicates the target status of the job. The value can be SAVED, SUBMITTED, or PRODUCTION.

  • SAVED indicates that the job is saved but cannot be scheduled or executed. It can be executed only after submitted and approved.
  • SUBMITTED indicates that the job is automatically submitted after it is saved and can be executed after it is approved.
  • PRODUCTION indicates that the job can be directly executed after it is created. Note: Only the workspace administrator can create jobs in the PRODUCTION state.

approvers

No

List<JobApprover>

Job approver. This parameter is required if the review function is enabled. For details, see Table 4.

For details about how to configure the review function, see Review Center.

resources

No

List<JobResourceInfo>

This parameter is mandatory for replacing a resource. You must set the name and type of the resource to be replaced, and the name of the resource used to replace the existing resource. For details, see Table 5.

Table 3 JobParam parameters

Parameter

Mandatory

Type

Description

name

Yes

String

Job name

params

No

Map<String,String>

Job parameters

Table 4 Approver attributes

Parameter

Mandatory

Type

Description

approverName

Yes

String

Approver name

Table 5 Resource table parameters

Parameter

Mandatory

Type

Description

name

Yes

String

Resource name

type

Yes

String

Resource type. The following resource types are supported:

DWS_CONNECTION, DIS_STREAM, CDM_CLUSTER, MRS_CLUSTER, MRS_HIVE_CONNECTION, MRS_SPARK_CONNECTION, GES_GRAPH, ROMA_INSTANCE, TICS_INSTANCE, and DRS_TASK

replace

No

String

Name of the resource used to replace the existing resource

Response

Table 6 Response parameter

Parameter

Mandatory

Type

Description

taskId

Yes

String

ID of the task. Used to call the API for querying system tasks to obtain the import status.

Example Request

Import jobs from OBS to DLF. If there are jobs and scripts with the same name, overwrite them. The definition file of the imported job is in the obs://aaaaa/job_batch.zip OBS path, and the job name is job_batch.
POST /v1/b384b9e9ab9b4ee8994c8633aabc9505/jobs/import
{
    "path": "obs://aaaaa/job_batch.zip",
    "jobsParam": [
        {
            "name": "job_batch"
        }
    ]
}
Import jobs from OBS to DLF when the review function is enabled. If there are jobs and scripts with the same name, overwrite them.
POST /v1/b384b9e9ab9b4ee8994c8633aabc9505/jobs/import
{
    "path": "obs://aaaaa/job_batch.zip",
    "jobsParam": [
        {
            "name": "job_batch"
        }
    ],
    "targetStatus": "SUBMITTED",
    "approvers": [
    {
      "approverName": "userName1"
    },
    {
      "approverName": "userName2"
    }
  ]
}

Example Response

  • Success response
    HTTP status code 200
    {
        "taskId":"008aae2e675933c7016759418e870000"
    }
  • Failure response

    HTTP status code 400

    {
        "error_code":"DLF.0815",
        "error_msg":"Fail to read OBS file."
    }

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback