هذه الصفحة غير متوفرة حاليًا بلغتك المحلية. نحن نعمل جاهدين على إضافة المزيد من اللغات. شاكرين تفهمك ودعمك المستمر لنا.

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
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

Developing a Python Script

Updated on 2023-06-14 GMT+08:00

This section describes how to develop and execute a Python script using DataArts Factory.

Preparing the Environment

  • An ECS named ecs-dgc has been created.
    NOTE:

    In this example, the ECS uses the CentOS 8.0 64bit with ARM (40 GB) public image and the Python environment. You can log in to the ECS and run the python command to check the Python environment.

  • You have enabled the DataArts Migration incremental package and created a CDM cluster named cdm-dlfpyhthon. The cluster provides an agent for the DataArts Factory module to communicate with the ECS.
  • Ensure that the ECS can communicate with the CDM cluster, which depends on the following conditions:
    • If the CDM cluster and the ECS are in the same region, VPC, subnet, and security group, they can communicate with each other by default. If they are in the same VPC but in different subnets or security groups, you must configure routing rules and security group rules. For details about how to configure routing rules, see Adding Routes in Virtual Private Cloud (VPC) Usage Guide. For details about how to configure security group rules, see Security Group > Adding a Security Group Rule in Virtual Private Cloud (VPC) Usage Guide.
    • If the CDM cluster and the ECS are in different regions, a public network or a dedicated connection is required for enabling communication between the CDM cluster and the cloud service. If the Internet is used for communication, ensure that an EIP has been bound to the CDM cluster, the host where the data source is located can access the Internet, and the port has been enabled in the firewall rules.
    • The ECS and the CDM cluster belong to the same enterprise project. If they do not, you can modify the enterprise project of the workspace.

Constraints

  • Python scripts do not support script parameters or job parameters.

Creating an ECS Data Connection

Before developing a Python script, you need to create a connection to the ECS.

  1. On the DataArts Studio console, locate a workspace and click Management Center.

    Figure 1 Management Center

  2. In the navigation pane, choose Manage Data Connections.

    Figure 2 Creating a data connection

  3. Click Create Data Connection.

    Figure 3 Creating a data connection

  4. Configure parameters by referring to Table 1 and create a data connection named python_test.

    Table 1 Host connection parameters

    Parameter

    Mandatory

    Description

    Data Connection Name

    Yes

    Name of the host connection. The value can contain only letters, digits, hyphens (-), and underscores (_).

    Host Address

    Yes

    IP address of the host.

    For details, see section "Viewing Details About an ECS" in Elastic Cloud Server User Guide.

    Agent

    Yes

    Agents provided by the CDM cluster.

    Port

    Yes

    SSH port number of the host.

    Username

    Yes

    Username of the host

    Login Mode

    Yes

    Selects the login mode of the host.

    • Key pair
    • Password

    Key pair

    Yes

    If Key Pair is the login mode of the host, the user needs to obtain the private key file, upload it to OBS, and select an OBS path. This parameter is available only when Login Mode is set to Key Pair.

    NOTE:

    The uploaded private key file must be in PEM format, and the uploaded private key file and the public key configured on the host must be in the same key pair.

    Key Pair Password

    No

    If no password is set for the key pair, you do not need to set this parameter.

    Password

    Yes

    If the login mode of the host is to use a password, enter a login password.

    Host Connection Description

    No

    Descriptive information about the host connection.

    NOTE:

    The key parameters are as follows:

    • Host Address: Enter the IP address of the ECS.
    • Agent: Select the CDM cluster.

  5. Click Test to test connectivity of the data connection. If the test fails, the data connection fails to be created.
  6. After the test is successful, click OK. The system will create the data connection for you.

Developing a Python Script

  1. Choose DataArts Factory > Develop Script and create a Python script named python_test.
  2. Edit the Python statement in the editor, select the host connection, and click Submit and Unlock..
  3. Click Execute to execute the Python statement.
  4. View the script execution result.

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