All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.aliyun.sdk.service.ecs20140526.models.CreateImageRequest Maven / Gradle / Ivy

There is a newer version: 5.0.29
Show newest version
// This file is auto-generated, don't edit it. Thanks.
package com.aliyun.sdk.service.ecs20140526.models;

import darabonba.core.RequestModel;
import darabonba.core.TeaModel;
import com.aliyun.sdk.gateway.pop.models.*;

/**
 * 
 * {@link CreateImageRequest} extends {@link RequestModel}
 *
 * 

CreateImageRequest

*/ public class CreateImageRequest extends Request { @com.aliyun.core.annotation.Host @com.aliyun.core.annotation.NameInMap("SourceRegionId") private String sourceRegionId; @com.aliyun.core.annotation.Query @com.aliyun.core.annotation.NameInMap("Architecture") private String architecture; @com.aliyun.core.annotation.Query @com.aliyun.core.annotation.NameInMap("BootMode") private String bootMode; @com.aliyun.core.annotation.Query @com.aliyun.core.annotation.NameInMap("ClientToken") private String clientToken; @com.aliyun.core.annotation.Query @com.aliyun.core.annotation.NameInMap("Description") private String description; @com.aliyun.core.annotation.Query @com.aliyun.core.annotation.NameInMap("DetectionStrategy") private String detectionStrategy; @com.aliyun.core.annotation.Query @com.aliyun.core.annotation.NameInMap("DiskDeviceMapping") private java.util.List < DiskDeviceMapping> diskDeviceMapping; @com.aliyun.core.annotation.Query @com.aliyun.core.annotation.NameInMap("ImageFamily") private String imageFamily; @com.aliyun.core.annotation.Query @com.aliyun.core.annotation.NameInMap("ImageName") private String imageName; @com.aliyun.core.annotation.Query @com.aliyun.core.annotation.NameInMap("ImageVersion") private String imageVersion; @com.aliyun.core.annotation.Query @com.aliyun.core.annotation.NameInMap("InstanceId") private String instanceId; @com.aliyun.core.annotation.Query @com.aliyun.core.annotation.NameInMap("OwnerAccount") private String ownerAccount; @com.aliyun.core.annotation.Query @com.aliyun.core.annotation.NameInMap("OwnerId") private Long ownerId; @com.aliyun.core.annotation.Query @com.aliyun.core.annotation.NameInMap("Platform") private String platform; @com.aliyun.core.annotation.Query @com.aliyun.core.annotation.NameInMap("RegionId") @com.aliyun.core.annotation.Validation(required = true) private String regionId; @com.aliyun.core.annotation.Query @com.aliyun.core.annotation.NameInMap("ResourceGroupId") private String resourceGroupId; @com.aliyun.core.annotation.Query @com.aliyun.core.annotation.NameInMap("ResourceOwnerAccount") private String resourceOwnerAccount; @com.aliyun.core.annotation.Query @com.aliyun.core.annotation.NameInMap("ResourceOwnerId") private Long resourceOwnerId; @com.aliyun.core.annotation.Query @com.aliyun.core.annotation.NameInMap("SnapshotId") private String snapshotId; @com.aliyun.core.annotation.Query @com.aliyun.core.annotation.NameInMap("Tag") private java.util.List < Tag> tag; private CreateImageRequest(Builder builder) { super(builder); this.sourceRegionId = builder.sourceRegionId; this.architecture = builder.architecture; this.bootMode = builder.bootMode; this.clientToken = builder.clientToken; this.description = builder.description; this.detectionStrategy = builder.detectionStrategy; this.diskDeviceMapping = builder.diskDeviceMapping; this.imageFamily = builder.imageFamily; this.imageName = builder.imageName; this.imageVersion = builder.imageVersion; this.instanceId = builder.instanceId; this.ownerAccount = builder.ownerAccount; this.ownerId = builder.ownerId; this.platform = builder.platform; this.regionId = builder.regionId; this.resourceGroupId = builder.resourceGroupId; this.resourceOwnerAccount = builder.resourceOwnerAccount; this.resourceOwnerId = builder.resourceOwnerId; this.snapshotId = builder.snapshotId; this.tag = builder.tag; } public static Builder builder() { return new Builder(); } public static CreateImageRequest create() { return builder().build(); } @Override public Builder toBuilder() { return new Builder(this); } /** * @return sourceRegionId */ public String getSourceRegionId() { return this.sourceRegionId; } /** * @return architecture */ public String getArchitecture() { return this.architecture; } /** * @return bootMode */ public String getBootMode() { return this.bootMode; } /** * @return clientToken */ public String getClientToken() { return this.clientToken; } /** * @return description */ public String getDescription() { return this.description; } /** * @return detectionStrategy */ public String getDetectionStrategy() { return this.detectionStrategy; } /** * @return diskDeviceMapping */ public java.util.List < DiskDeviceMapping> getDiskDeviceMapping() { return this.diskDeviceMapping; } /** * @return imageFamily */ public String getImageFamily() { return this.imageFamily; } /** * @return imageName */ public String getImageName() { return this.imageName; } /** * @return imageVersion */ public String getImageVersion() { return this.imageVersion; } /** * @return instanceId */ public String getInstanceId() { return this.instanceId; } /** * @return ownerAccount */ public String getOwnerAccount() { return this.ownerAccount; } /** * @return ownerId */ public Long getOwnerId() { return this.ownerId; } /** * @return platform */ public String getPlatform() { return this.platform; } /** * @return regionId */ public String getRegionId() { return this.regionId; } /** * @return resourceGroupId */ public String getResourceGroupId() { return this.resourceGroupId; } /** * @return resourceOwnerAccount */ public String getResourceOwnerAccount() { return this.resourceOwnerAccount; } /** * @return resourceOwnerId */ public Long getResourceOwnerId() { return this.resourceOwnerId; } /** * @return snapshotId */ public String getSnapshotId() { return this.snapshotId; } /** * @return tag */ public java.util.List < Tag> getTag() { return this.tag; } public static final class Builder extends Request.Builder { private String sourceRegionId; private String architecture; private String bootMode; private String clientToken; private String description; private String detectionStrategy; private java.util.List < DiskDeviceMapping> diskDeviceMapping; private String imageFamily; private String imageName; private String imageVersion; private String instanceId; private String ownerAccount; private Long ownerId; private String platform; private String regionId; private String resourceGroupId; private String resourceOwnerAccount; private Long resourceOwnerId; private String snapshotId; private java.util.List < Tag> tag; private Builder() { super(); } private Builder(CreateImageRequest request) { super(request); this.sourceRegionId = request.sourceRegionId; this.architecture = request.architecture; this.bootMode = request.bootMode; this.clientToken = request.clientToken; this.description = request.description; this.detectionStrategy = request.detectionStrategy; this.diskDeviceMapping = request.diskDeviceMapping; this.imageFamily = request.imageFamily; this.imageName = request.imageName; this.imageVersion = request.imageVersion; this.instanceId = request.instanceId; this.ownerAccount = request.ownerAccount; this.ownerId = request.ownerId; this.platform = request.platform; this.regionId = request.regionId; this.resourceGroupId = request.resourceGroupId; this.resourceOwnerAccount = request.resourceOwnerAccount; this.resourceOwnerId = request.resourceOwnerId; this.snapshotId = request.snapshotId; this.tag = request.tag; } /** * SourceRegionId. */ public Builder sourceRegionId(String sourceRegionId) { this.putHostParameter("SourceRegionId", sourceRegionId); this.sourceRegionId = sourceRegionId; return this; } /** *

The system architecture of the system disk. If you specify a data disk snapshot to create the system disk of the custom image, you must use Architecture to specify the system architecture of the system disk. Valid values:

*
    *
  • i386
  • *
  • x86_64
  • *
  • arm64
  • *
*

Default value: x86_64.

* * example: *

x86_64

*/ public Builder architecture(String architecture) { this.putQueryParameter("Architecture", architecture); this.architecture = architecture; return this; } /** *

The boot mode of the image. Valid values:

*
    *
  • BIOS: Basic Input/Output System (BIOS)
  • *
  • UEFI: Unified Extensible Firmware Interface (UEFI)
  • *
  • UEFI-Preferred: BIOS and UEFI
  • *
*
*

Before you change the boot mode of an image, we recommend that you get familiar with the boot modes supported by the image to ensure that instances created from the image can start as expected. If you do not know which boot modes are supported by the image, we recommend that you use the image check feature to perform a check. For information about the image check feature, see Overview of image check.

*
*
*

For information about the UEFI-Preferred boot mode, see Best practices for ECS instance boot modes.

*
* * example: *

BIOS

*/ public Builder bootMode(String bootMode) { this.putQueryParameter("BootMode", bootMode); this.bootMode = bootMode; return this; } /** *

The client token that is used to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The value of ClientToken can contain only ASCII characters and cannot exceed 64 characters in length. For more information, see How to ensure idempotence.

* * example: *

123e4567-e89b-12d3-a456-426655440000

*/ public Builder clientToken(String clientToken) { this.putQueryParameter("ClientToken", clientToken); this.clientToken = clientToken; return this; } /** *

The image description. The description must be 2 to 256 characters in length and cannot start with http:// or https://.

* * example: *

ImageTestDescription

*/ public Builder description(String description) { this.putQueryParameter("Description", description); this.description = description; return this; } /** *

The mode in which to check the custom image. If you do not specify this parameter, the image is not checked. Only the standard check mode is supported.

*
*

This parameter is supported for most Linux and Windows operating system versions. For information about image check items and operating system limits for image check, see Overview of image check and Operating system limits for image check.

*
* * example: *

Standard

*/ public Builder detectionStrategy(String detectionStrategy) { this.putQueryParameter("DetectionStrategy", detectionStrategy); this.detectionStrategy = detectionStrategy; return this; } /** *

The information about the custom image.

*/ public Builder diskDeviceMapping(java.util.List < DiskDeviceMapping> diskDeviceMapping) { this.putQueryParameter("DiskDeviceMapping", diskDeviceMapping); this.diskDeviceMapping = diskDeviceMapping; return this; } /** *

The name of the image family. The name must be 2 to 128 characters in length. The name must start with a letter and cannot start with acs: or aliyun. The name cannot contain http:// or https://. The name can contain letters, digits, colons (:), underscores (_), and hyphens (-).

* * example: *

hangzhou-daily-update

*/ public Builder imageFamily(String imageFamily) { this.putQueryParameter("ImageFamily", imageFamily); this.imageFamily = imageFamily; return this; } /** *

The name of the custom image. The name must be 2 to 128 characters in length. The name must start with a letter and cannot start with http:// or https://. The name can contain letters, digits, colons (:), underscores (_), and hyphens (-).

* * example: *

TestCentOS

*/ public Builder imageName(String imageName) { this.putQueryParameter("ImageName", imageName); this.imageName = imageName; return this; } /** *

The image version.

*
*

If you specify an instance by configuring InstanceId, and the instance uses an Alibaba Cloud Marketplace image or a custom image that is created from an Alibaba Cloud Marketplace image, you must leave this parameter empty or set this parameter to the value of ImageVersion of the instance.

*
* * example: *

2017011017

*/ public Builder imageVersion(String imageVersion) { this.putQueryParameter("ImageVersion", imageVersion); this.imageVersion = imageVersion; return this; } /** *

The instance ID.

* * example: *

i-bp1g6zv0ce8oghu7****

*/ public Builder instanceId(String instanceId) { this.putQueryParameter("InstanceId", instanceId); this.instanceId = instanceId; return this; } /** * OwnerAccount. */ public Builder ownerAccount(String ownerAccount) { this.putQueryParameter("OwnerAccount", ownerAccount); this.ownerAccount = ownerAccount; return this; } /** * OwnerId. */ public Builder ownerId(Long ownerId) { this.putQueryParameter("OwnerId", ownerId); this.ownerId = ownerId; return this; } /** *

The operating system distribution for the system disk in the custom image. If you specify a data disk snapshot to create the system disk of the custom image, use Platform to specify the operating system distribution for the system disk. Valid values:

*
    *
  • Aliyun
  • *
  • Anolis
  • *
  • CentOS
  • *
  • Ubuntu
  • *
  • CoreOS
  • *
  • SUSE
  • *
  • Debian
  • *
  • OpenSUSE
  • *
  • FreeBSD
  • *
  • RedHat
  • *
  • Kylin
  • *
  • UOS
  • *
  • Fedora
  • *
  • Fedora CoreOS
  • *
  • CentOS Stream
  • *
  • AlmaLinux
  • *
  • Rocky Linux
  • *
  • Gentoo
  • *
  • Customized Linux
  • *
  • Others Linux
  • *
  • Windows Server 2022
  • *
  • Windows Server 2019
  • *
  • Windows Server 2016
  • *
  • Windows Server 2012
  • *
  • Windows Server 2008
  • *
  • Windows Server 2003
  • *
*

Default value: Others Linux.

* * example: *

CentOS

*/ public Builder platform(String platform) { this.putQueryParameter("Platform", platform); this.platform = platform; return this; } /** *

The region ID of the custom image that you want to create. You can call the DescribeRegions operation to query the most recent list of regions.

*

This parameter is required.

* * example: *

cn-hangzhou

*/ public Builder regionId(String regionId) { this.putQueryParameter("RegionId", regionId); this.regionId = regionId; return this; } /** *

The ID of the resource group to which to assign the custom image. If you do not specify this parameter, the image is assigned to the default resource group.

*
*

If you call the CreateImage operation as a Resource Access Management (RAM) user who does not have the permissions to manage the default resource group and do not specify ResourceGroupId, the Forbbiden: User not authorized to operate on the specified resource error message is returned. You must specify the ID of a resource group that the RAM user has the permissions to manage or grant the RAM user the permissions to manage the default resource group before you call the CreateImage operation again.

*
* * example: *

rg-bp67acfmxazb4p****

*/ public Builder resourceGroupId(String resourceGroupId) { this.putQueryParameter("ResourceGroupId", resourceGroupId); this.resourceGroupId = resourceGroupId; return this; } /** * ResourceOwnerAccount. */ public Builder resourceOwnerAccount(String resourceOwnerAccount) { this.putQueryParameter("ResourceOwnerAccount", resourceOwnerAccount); this.resourceOwnerAccount = resourceOwnerAccount; return this; } /** * ResourceOwnerId. */ public Builder resourceOwnerId(Long resourceOwnerId) { this.putQueryParameter("ResourceOwnerId", resourceOwnerId); this.resourceOwnerId = resourceOwnerId; return this; } /** *

The ID of the snapshot that you want to use to create the custom image.

* * example: *

s-bp17441ohwkdca0****

*/ public Builder snapshotId(String snapshotId) { this.putQueryParameter("SnapshotId", snapshotId); this.snapshotId = snapshotId; return this; } /** *

The tags.

*/ public Builder tag(java.util.List < Tag> tag) { this.putQueryParameter("Tag", tag); this.tag = tag; return this; } @Override public CreateImageRequest build() { return new CreateImageRequest(this); } } /** * * {@link CreateImageRequest} extends {@link TeaModel} * *

CreateImageRequest

*/ public static class DiskDeviceMapping extends TeaModel { @com.aliyun.core.annotation.NameInMap("Device") private String device; @com.aliyun.core.annotation.NameInMap("DiskType") private String diskType; @com.aliyun.core.annotation.NameInMap("Size") private Integer size; @com.aliyun.core.annotation.NameInMap("SnapshotId") private String snapshotId; private DiskDeviceMapping(Builder builder) { this.device = builder.device; this.diskType = builder.diskType; this.size = builder.size; this.snapshotId = builder.snapshotId; } public static Builder builder() { return new Builder(); } public static DiskDeviceMapping create() { return builder().build(); } /** * @return device */ public String getDevice() { return this.device; } /** * @return diskType */ public String getDiskType() { return this.diskType; } /** * @return size */ public Integer getSize() { return this.size; } /** * @return snapshotId */ public String getSnapshotId() { return this.snapshotId; } public static final class Builder { private String device; private String diskType; private Integer size; private String snapshotId; /** *

The device name of disk N in the custom image. Valid values:

*
    *
  • For disks other than basic disks, such as standard SSDs, ultra disks, and enhanced SSDs (ESSDs), the valid values range from /dev/vda to /dev/vdz in alphabetical order.
  • *
  • For basic disks, the valid values range from /dev/xvda to /dev/xvdz in alphabetical order.
  • *
* * example: *

/dev/vdb

*/ public Builder device(String device) { this.device = device; return this; } /** *

The type of disk N in the custom image. You can specify this parameter to create the system disk of the custom image from a data disk snapshot. If you do not specify this parameter, the disk type is determined by the corresponding snapshot. Valid values:

*
    *
  • system: system disk. You can specify only one snapshot to use to create the system disk in the custom image.
  • *
  • data: data disk. You can specify up to 16 snapshots to use to create data disks in the custom image.
  • *
* * example: *

system

*/ public Builder diskType(String diskType) { this.diskType = diskType; return this; } /** *

The size of disk N in the custom image. Unit: GiB. The valid values and default value of DiskDeviceMapping.N.Size vary based on the value of DiskDeviceMapping.N.SnapshotId.

*
    *
  • If no corresponding snapshot IDs are specified in the value of DiskDeviceMapping.N.SnapshotId, DiskDeviceMapping.N.Size has the following valid values and default values:

    *
      *
    • For basic disks, the valid values range from 5 to 2000, and the default value is 5.
    • *
    • For other disks, the valid values range from 20 to 32768, and the default value is 20.
    • *
    *
  • *
  • If a corresponding snapshot ID is specified in the value of DiskDeviceMapping.N.SnapshotId, the value of DiskDeviceMapping.N.Size must be greater than or equal to the size of the specified snapshot. The default value of DiskDeviceMapping.N.Size is the size of the specified snapshot.

    *
  • *
* * example: *

2000

*/ public Builder size(Integer size) { this.size = size; return this; } /** *

The ID of snapshot N to use to create the custom image.

* * example: *

s-bp17441ohwkdca0****

*/ public Builder snapshotId(String snapshotId) { this.snapshotId = snapshotId; return this; } public DiskDeviceMapping build() { return new DiskDeviceMapping(this); } } } /** * * {@link CreateImageRequest} extends {@link TeaModel} * *

CreateImageRequest

*/ public static class Tag extends TeaModel { @com.aliyun.core.annotation.NameInMap("Key") private String key; @com.aliyun.core.annotation.NameInMap("Value") private String value; private Tag(Builder builder) { this.key = builder.key; this.value = builder.value; } public static Builder builder() { return new Builder(); } public static Tag create() { return builder().build(); } /** * @return key */ public String getKey() { return this.key; } /** * @return value */ public String getValue() { return this.value; } public static final class Builder { private String key; private String value; /** *

The key of tag N of the custom image. Valid values of N: 1 to 20. The tag key cannot be an empty string. The tag key can be up to 128 characters in length and cannot start with aliyun or acs:. The tag key cannot contain http:// or https://.

* * example: *

KeyTest

*/ public Builder key(String key) { this.key = key; return this; } /** *

The value of tag N of the custom image. Valid values of N: 1 to 20. The tag value can be an empty string. The tag value can be up to 128 characters in length and cannot start with acs:. The tag value cannot contain http:// or https://.

* * example: *

ValueTest

*/ public Builder value(String value) { this.value = value; return this; } public Tag build() { return new Tag(this); } } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy