Esta página ainda não está disponível no idioma selecionado. Estamos trabalhando para adicionar mais opções de idiomas. Agradecemos sua compreensão.

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

Creating Image Metadata (Native OpenStack API)

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

Function

This API is used to create image metadata.

After the API is successfully invoked, the image metadata is created, but the image file does not exist yet.

URI

POST /v2/images

Request

  • Request parameters

    Parameter

    Mandatory

    Type

    Description

    __os_version

    No

    String

    Specifies the image OS version. For the value range, see Values of Related Parameters.

    If this parameter is not specified, the value Other Linux(64 bit) will be used. In that case, the ECS creation using this image may fail, and the ECS created using this image may fail to run properly.

    visibility

    No

    String

    Specifies whether the image is available to other tenants.

    The default value is private. When creating image metadata, the value of visibility can be set to private only.

    name

    No

    String

    Specifies the image name. If this parameter is not specified, its value is empty by default. In that case, ECS creation using this image will fail. The name contains 1 to 255 characters. For detailed description, see Image Attributes. This parameter is left blank by default.

    protected

    No

    Boolean

    Specifies whether the image is protected. A protected image cannot be deleted. The default value is false.

    container_format

    No

    String

    Specifies the container format.

    The default value is bare.

    disk_format

    No

    String

    Specifies the image format. The value can be zvhd2, vhd, raw, iso, or qcow2. The default value is zvhd2 for a non-ISO image.

    tags

    No

    Array of strings

    Lists the image tags. The tag contains 1 to 255 characters. The value is left blank by default.

    NOTE:

    The tag is a key-value pair. Example:

    "tagkey=tagvalue"

    min_ram

    No

    Integer

    Specifies the minimum memory size (MB) required for running the image. The parameter value depends on ECS specifications. The default value is 0.

    min_disk

    No

    Integer

    Specifies the minimum disk space (GB) required for running the image. The value ranges from 40 GB to 255 GB.

    The value of this parameter must be greater than the image system disk capacity. Otherwise, the ECS creation may fail.

Example Request

POST https://{Endpoint}/v2/images
{
    "__os_version": "Ubuntu 14.04 server 64bit",
    "container_format": "bare",
    "disk_format": "vhd",
    "min_disk": 100,
    "min_ram": 1024,
    "name": "test",
    "tags": [
        "test=testvalue",
        "image=imagevalue"
    ],
    "visibility": "private",
    "protected": false
}

Response

  • Response parameters

    Parameter

    Type

    Description

    visibility

    String

    Specifies whether the image is available to other tenants. The value is private.

    name

    String

    Specifies the image name. If this parameter is not specified, its value is empty by default. In that case, ECS creation using this image will fail. The name contains 1 to 128 characters. For detailed description, see Image Attributes.

    protected

    Boolean

    Specifies whether the image is protected. A protected image cannot be deleted. The value is false.

    container_format

    String

    Specifies the container format.

    The value is bare.

    disk_format

    String

    Specifies the image format. The value can be zvhd2, vhd, raw, iso, or qcow2. The default value is zvhd2 for a non-ISO image.

    tags

    Array of strings

    Lists the image tags. The tag contains 1 to 255 characters.

    min_ram

    Integer

    Specifies the minimum memory size (MB) required for running the image. The parameter value depends on the ECS specifications limit. The value is generally set to 0.

    min_disk

    Integer

    Specifies the minimum disk space (GB) required for running the image. It must be greater than the system disk capacity in the image. Otherwise, the ECS creation will fail. The value ranges from 40 GB to 255 GB.

    status

    String

    Specifies the image status. The value can be one of the following:

    • queued: indicates that the image metadata has already been created, and it is ready for the image file to upload.
    • saving: indicates that the image file is being uploaded to the backend storage.
    • deleted: indicates that the image has been deleted.
    • killed: indicates that an error occurs on the image uploading.
    • active: indicates that the image is available for use.

    created_at

    String

    Specifies the time when the image was created. The value is in UTC format.

    updated_at

    String

    Specifies the time when the image was updated. The value is in UTC format.

    self

    String

    Specifies the image URL.

    id

    String

    Specifies the image ID. After the image creation API is called, the image ID must be saved. The image ID is used to invoke the image uploading API and upload the image.

    file

    String

    Specifies the URL for uploading and downloading the image file.

    schema

    String

    Specifies the URL for accessing the schema.

    __image_source_type

    String

    Specifies the image backend storage type. Only UDS is supported currently.

    __image_size

    String

    Specifies the image size. The unit is byte.

    __isregistered

    String

    Specifies whether the image is registered. Only registered images can be queried on the portal. The value is true.

    __os_version

    String

    Specifies the image OS version. For the value range, see Values of Related Parameters.

    __os_type

    String

    Specifies the image OS type. The value of this parameter depends on that of __os_version. The value can be Windows, Linux, or other.

    __platform

    String

    Specifies the OS platform supported by the image. The value of this parameter depends on that of __os_version.

    __os_bit

    String

    Specifies the OS bit. The value of this parameter depends on that of __os_version. The value can be 32 or 64.

    __imagetype

    String

    Specifies the image type. private indicates a private image.

    virtual_env_type

    String

    Specifies the platform type.

    Specifies the environment where the image is used. The value can be FusionCompute, Ironic, DataImage, or IsoImage.

    • For an ECS image, the value is FusionCompute.
    • For an ECS data disk image, the value is DataImage.
    • For a BMS image, the value is Ironic.
    • For an ISO image, the value is IsoImage.

    owner

    String

    Specifies the ID of the project to which the image belongs.

    __root_origin

    String

    Specifies that the image is created from an external image file. Value: file

    checksum

    String

    Specifies the MD5 value of the image file.

    size

    Long

    This parameter is unavailable currently.

    virtual_size

    Integer

    Specifies the virtual size of the image. The unit is byte.

    properties

    Properties object

    Specifies a collection of image attributes instead of a specified attribute.

  • Example response
    STATUS CODE 201
    {
        "schema": "/v2/schemas/image",
        "min_disk": 100,
        "created_at": "2016-06-02T07:49:48Z",
        "__image_source_type": "uds",
        "container_format": "bare",
        "__image_size": "0",
        "file": "/v2/images/4ca46bf1-5c61-48ff-b4f3-0ad4e5e3ba86/file",
        "updated_at": "2016-06-02T07:49:49Z",
        "protected": false,
        "id": "4ca46bf1-5c61-48ff-b4f3-0ad4e5e3ba86",
        "__isregistered": "true",
        "min_ram": 1024,
        "owner": "b912fb4a4c464b568ecfca1071b21b10",
        "__os_type": "Linux",
        "__imagetype": "private",
        "visibility": "private",
        "virtual_env_type": "FusionCompute",
        "tags": [
            "test=testvalue",
            "image=imagevalue"
    
        ],
        "__platform": "Ubuntu",
        "__os_bit": "64",
        "__os_version": "Ubuntu 14.04 server 64bit",
        "name": "test",
        "self": "/v2/images/4ca46bf1-5c61-48ff-b4f3-0ad4e5e3ba86",
        "disk_format": "vhd",
        "status": "queued"
    }

Returned Values

  • Normal

    201

  • Abnormal

    Returned Value

    Description

    400 Bad Request

    Request error.

    401 Unauthorized

    Authentication failed.

    403 Forbidden

    You do not have the rights to perform the operation.

    404 Not Found

    The requested resource was not found.

    500 Internal Server Error

    Internal service error.

    503 Service Unavailable

    The service is unavailable.

Usamos cookies para aprimorar nosso site e sua experiência. Ao continuar a navegar em nosso site, você aceita nossa política de cookies. Saiba mais

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback