Halaman ini belum tersedia dalam bahasa lokal Anda. Kami berusaha keras untuk menambahkan lebih banyak versi bahasa. Terima kasih atas dukungan Anda.

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

Updating a Service

Updated on 2024-04-23 GMT+08:00

Function

This API is used to update a service.

NOTE:

Only the platinum edition supports service-related functions.

URI

PUT /v2/{project_id}/edgemgr/services/{service_id}

Table 1 Path parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID.

service_id

Yes

String

Service ID.

Request

Table 2 Parameters in the request header

Parameter

Mandatory

Type

Description

Content-Type

Yes

String

Message body type (format).

The default value application/json is recommended.

X-Auth-Token

Yes

String

User token. The token can be obtained by calling the IAM API used to obtain a user token. The value of X-Subject-Token in the response header is the user token.

Table 3 Parameters in the request body

Parameter

Mandatory

Type

Description

service

No

ServiceReqDetail object

Service details.

Table 4 ServiceReqDetail

Parameter

Mandatory

Type

Description

meta_data

Yes

SvcMetadata object

Static properties of the service.

spec

Yes

SvcSpec object

Dynamic properties of the service.

Table 5 SvcMetadata

Parameter

Mandatory

Type

Description

labels

No

Map<String,String>

List of customized labels.

name

Yes

String

Service name. The name contains a maximum of 64 characters starting with a letter and ending with a letter or digit. Only lowercase letters, digits, and hyphens (-) are allowed.

Table 6 SvcSpec

Parameter

Mandatory

Type

Description

cluster_ip

No

String

Virtual service IP address.

external_ips

No

Array of strings

List of external IP addresses. This parameter is not supported currently.

external_name

No

String

External domain name. This parameter is not supported currently.

ports

No

Array of SvcPort objects

List of service ports to be exposed.

selector

Yes

Map<String,String>

Label selector, which is used to select the pods with the specified labels for management.

type

No

String

Service type.

Table 7 SvcPort

Parameter

Mandatory

Type

Description

name

No

String

The service port must be named in the {protocol}-{suffix} format, where {protocol} can be tcp or http. IEF provides routing capabilities based on protocols defined on ports. For example, name:http-0 and name:tcp-0 are valid port names, while name:http2forecast is invalid.

node_port

No

String

Port number mapped to the physical machine when spec.type is set to NodePort.

port

No

String

Port on which the service listens.

protocol

No

String

Protocol, for example, TCP.

target_port

No

String

Port number of the backend pod to which requests are forwarded.

Response

When the status code is 200, the response parameters are as follows:

Table 8 Parameters in the response body

Parameter

Type

Description

service

ServiceRespDetail object

Service details.

Table 9 ServiceRespDetail

Parameter

Type

Description

created_at

String

Creation time.

id

String

Service ID.

meta_data

SvcMetadata object

Static properties of the service.

project_id

String

Tenant ID.

spec

SvcSpec object

Dynamic properties of the service.

updated_at

String

Update time.

Table 10 SvcMetadata

Parameter

Type

Description

labels

Map<String,String>

List of customized labels.

name

String

Service name. The name contains a maximum of 64 characters starting with a letter and ending with a letter or digit. Only lowercase letters, digits, and hyphens (-) are allowed.

Table 11 SvcSpec

Parameter

Type

Description

cluster_ip

String

Virtual service IP address.

external_ips

Array of strings

List of external IP addresses. This parameter is not supported currently.

external_name

String

External domain name. This parameter is not supported currently.

ports

Array of SvcPort objects

List of service ports to be exposed.

selector

Map<String,String>

Label selector, which is used to select the pods with the specified labels for management.

type

String

Service type.

Table 12 SvcPort

Parameter

Type

Description

name

String

The service port must be named in the {protocol}-{suffix} format, where {protocol} can be tcp or http. IEF provides routing capabilities based on protocols defined on ports. For example, name:http-0 and name:tcp-0 are valid port names, while name:http2forecast is invalid.

node_port

String

Port number mapped to the physical machine when spec.type is set to NodePort.

port

String

Port on which the service listens.

protocol

String

Protocol, for example, TCP.

target_port

String

Port number of the backend pod to which requests are forwarded.

When the status code is 400, the response parameters are as follows:

Table 13 Parameters in the response body

Parameter

Type

Description

error_code

String

Error code.

error_message

String

Error message.

When the status code is 500, the response parameters are as follows:

Table 14 Parameters in the response body

Parameter

Type

Description

error_code

String

Error code.

error_message

String

Error message.

Example Request

{
  "service" : {
    "meta_data" : {
      "name" : "service-example",
      "labels" : { }
    },
    "spec" : {
      "cluster_ip" : "None",
      "external_ips" : [ ],
      "external_name" : "",
      "ports" : [ {
        "name" : "http-0",
        "port" : "8888",
        "target_port" : "80",
        "protocol" : "TCP",
        "node_port" : ""
      } ],
      "selector" : {
        "app" : "ief-nginx"
      },
      "type" : ""
    }
  }
}

Example Response

Example response with status code 200:

{
  "service" : {
    "id" : "81acf9ff-de6d-4736-8d1a-f43bb058e79d",
    "project_id" : "e78acc02d9d141eda5ca8e88fa35f6f8",
    "meta_data" : {
      "name" : "service-example"
    },
    "spec" : {
      "selector" : {
        "app" : "ief-nginx"
      },
      "ports" : [ {
        "name" : "http-0",
        "protocol" : "TCP",
        "port" : "8888",
        "target_port" : "80"
      } ],
      "cluster_ip" : "None"
    },
    "created_at" : "2020-07-08 01:23:25.845332209 +0000 UTC",
    "updated_at" : "2020-07-08 01:23:25.845332209 +0000 UTC"
  }
}

Status Code

Status Code

Description

200

Update succeeded.

400

Error response.

500

Error response.

Error Codes

For details, see Error Codes.

Kami menggunakan cookie untuk meningkatkan kualitas situs kami dan pengalaman Anda. Dengan melanjutkan penelusuran di situs kami berarti Anda menerima kebijakan cookie kami. Cari tahu selengkapnya

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback