From fa83dac9b5aa502c1f5c4ed4944fc6d908bc5225 Mon Sep 17 00:00:00 2001 From: ucloud-bot Date: Mon, 31 Aug 2026 10:02:25 +0000 Subject: [PATCH] sdk: rolling update for 0.11.127 --- ucloud/services/ukms/client.py | 22 ++++++++++++---------- ucloud/services/ukms/schemas/apis.py | 6 +++--- ucloud/services/ukms/schemas/models.py | 3 ++- ucloud/version.py | 2 +- 4 files changed, 18 insertions(+), 15 deletions(-) diff --git a/ucloud/services/ukms/client.py b/ucloud/services/ukms/client.py index f0c5072..2dc49c9 100644 --- a/ucloud/services/ukms/client.py +++ b/ucloud/services/ukms/client.py @@ -106,11 +106,11 @@ def create_key(self, req: typing.Optional[dict] = None, **kwargs) -> dict: - **Region** (str) - (Config) 地域。参见地域和可用区列表。 - **ResourceId** (str) - (Required) UKMS 实例资源 ID。 - **Alias** (str) - 可选密钥别名,格式为 alias/name。 - - **DeletionProtection** (str) - 是否开启删除保护。可选值:true、false;默认 false。 + - **DeletionProtection** (bool) - 是否开启删除保护。可选值:true、false;默认 false。 - **Description** (str) - 密钥描述,最多 8192 字符。 - **KeySpec** (str) - 密钥规格,默认 SYMMETRIC_DEFAULT(AES_256)。可选值:SYMMETRIC_DEFAULT(AES_256)、RSA_2048、RSA_3072、RSA_4096、ECC_NIST_P256、ECC_NIST_P384、ECC_NIST_P521、HMAC_256、HMAC_384、HMAC_512。 - **KeyUsage** (str) - 密钥用途 - - **Origin** (str) - 密钥材料来源,默认 UCLOUD_KMS。当前仅支持 UCLOUD_KMS;EXTERNAL 为 BYOK 规划值,当前传入会返回 100660。 + - **Origin** (str) - 密钥材料来源,默认 UCLOUD_KMS。当前仅支持 UCLOUD_KMS;EXTERNAL 为 BYOK 规划值,当前传入会返回 1230。 **Response** @@ -139,7 +139,7 @@ def decrypt(self, req: typing.Optional[dict] = None, **kwargs) -> dict: - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子账号必须填写。 - **Region** (str) - (Config) 地域。参见地域和可用区列表。 - **CiphertextBlob** (str) - (Required) 待解密密文。 - - **EncryptionAlgorithm** (str) - 解密算法。可选值:SYMMETRIC_DEFAULT、RSAES_OAEP_SHA_1、RSAES_OAEP_SHA_256;非对称密钥解密时必填或使用默认 RSAES_OAEP_SHA_256。 + - **EncryptionAlgorithm** (str) - 解密算法。可选值:SYMMETRIC_DEFAULT、RSAES_OAEP_SHA_1、RSAES_OAEP_SHA_256;非对称密钥解密时必填。 - **EncryptionContext** (str) - 加密上下文,JSON Object。该参数内容会记录在日志中,请勿传入密码、密钥、令牌等敏感信息。 - **KeyId** (str) - 主密钥 KeyId;对称密钥可空,从 CiphertextBlob 自动识别;非对称必填。 - **ResourceId** (str) - UKMS 实例资源 ID。 @@ -204,6 +204,7 @@ def describe_key(self, req: typing.Optional[dict] = None, **kwargs) -> dict: **Response Model** **KeyMetadata** + - **Arn** (str) - ucs:ukms:{Region}:{CompanyId}:key/{KeyId} - **CreationDate** (int) - 创建时间,Unix 时间戳。 - **DeletionDate** (int) - 计划删除时间,Unix 时间戳。 - **DeletionProtection** (bool) - 是否开启删除保护。取值:true、false。 @@ -214,8 +215,9 @@ def describe_key(self, req: typing.Optional[dict] = None, **kwargs) -> dict: - **KeyState** (str) - 密钥对外状态。取值:Enabled、Disabled、PendingDeletion、PendingImport、Unavailable。 - **KeyUsage** (list) - 密钥用途。取值:ENCRYPT_DECRYPT、SIGN_VERIFY、GENERATE_VERIFY_MAC、KEY_AGREEMENT。 - **KeyVersion** (int) - 当前密钥版本。 + - **OrganizationId** (int) - 所属组织数字 ID - **Origin** (str) - 密钥材料来源。取值:UCLOUD_KMS、EXTERNAL;当前 CreateKey 仅支持 UCLOUD_KMS。 - - **ProjectId** (str) - 密钥所属项目的对外别名,格式为 org-xxx。该值由项目数字 ID 解析得到,可能因项目别名查询失败而为空。 + - **ProjectId** (str) - 密钥所属项目ID。 - **ResourceId** (str) - 密钥所属的 UKMS 实例资源 ID。 @@ -238,7 +240,7 @@ def disable_key(self, req: typing.Optional[dict] = None, **kwargs) -> dict: - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子账号必须填写。 - **Region** (str) - (Config) 地域。参见地域和可用区列表。 - - **KeyId** (str) - (Required) 密钥 DB 数字 ID。 + - **KeyId** (str) - (Required) 密钥资源长 ID - **ResourceId** (str) - UKMS 实例资源 ID。 **Response** @@ -266,7 +268,7 @@ def disable_key_rotation( - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子账号必须填写。 - **Region** (str) - (Config) 地域。参见地域和可用区列表。 - **KeyId** (str) - (Required) 密钥 ID、ARN 或别名。 - - **ResourceId** (str) - UKMS 实例资源 ID。 + - **ResourceId** (str) - (Required) UKMS 实例资源 ID。 **Response** @@ -290,7 +292,7 @@ def enable_key(self, req: typing.Optional[dict] = None, **kwargs) -> dict: - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子账号必须填写。 - **Region** (str) - (Config) 地域。参见地域和可用区列表。 - - **KeyId** (str) - (Required) 密钥 DB 数字 ID。 + - **KeyId** (str) - (Required) 密钥资源长 ID - **ResourceId** (str) - UKMS 实例资源 ID。 **Response** @@ -706,7 +708,7 @@ def list_keys(self, req: typing.Optional[dict] = None, **kwargs) -> dict: - **KeyUsage** (list) - 按 KeySpec 派生的密钥用途。取值:ENCRYPT_DECRYPT、SIGN_VERIFY、GENERATE_VERIFY_MAC、KEY_AGREEMENT。 - **NextRotationDate** (int) - 下次自动轮转时间(Unix 时间戳,秒);仅在已开启自动轮转时返回。 - **OrganizationId** (int) - 密钥所属组织的数字 ID,来源于密钥关联的资源交易记录。 - - **Origin** (str) - 密钥来源,由 Origin 派生。取值:ucloud、import。当前 CreateKey 仅支持 ucloud。 + - **Origin** (str) - 密钥来源,由 Origin 派生。取值:UCLOUD_KMS、EXTERNAL。当前 CreateKey 仅支持 UCLOUD_KMS。 - **PlanDeleteTime** (int) - 计划删除时间,Unix 时间戳。 - **ProjectId** (str) - 密钥所属项目的对外别名,格式为 org-xxx。该值由项目数字 ID 解析得到,可能因项目别名查询失败而为空。 - **ResourceId** (str) - 密钥所属的 UKMS 实例资源 ID。 @@ -789,7 +791,7 @@ def rotate_key_on_demand( - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子账号必须填写。 - **Region** (str) - (Config) 地域。参见地域和可用区列表。 - **KeyId** (str) - (Required) 密钥 ID、ARN 或别名。 - - **ResourceId** (str) - UKMS 实例资源 ID。 + - **ResourceId** (str) - (Required) UKMS 实例资源 ID。 **Response** @@ -816,7 +818,7 @@ def schedule_key_deletion( - **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子账号必须填写。 - **Region** (str) - (Config) 地域。参见地域和可用区列表。 - - **KeyId** (str) - (Required) 密钥 DB 数字 ID。 + - **KeyId** (str) - (Required) 密钥资源长 ID - **DeleteDay** (int) - 删除等待天数,取值范围为 7~30 天;未填写时默认为 30 天。 - **ResourceId** (str) - UKMS 实例资源 ID。 diff --git a/ucloud/services/ukms/schemas/apis.py b/ucloud/services/ukms/schemas/apis.py index 2c122d4..ff12359 100644 --- a/ucloud/services/ukms/schemas/apis.py +++ b/ucloud/services/ukms/schemas/apis.py @@ -91,7 +91,7 @@ class CreateKeyRequestSchema(schema.RequestSchema): fields = { "Alias": fields.Str(required=False, dump_to="Alias"), - "DeletionProtection": fields.Str( + "DeletionProtection": fields.Bool( required=False, dump_to="DeletionProtection" ), "Description": fields.Str(required=False, dump_to="Description"), @@ -237,7 +237,7 @@ class DisableKeyRotationRequestSchema(schema.RequestSchema): "KeyId": fields.Str(required=True, dump_to="KeyId"), "ProjectId": fields.Str(required=False, dump_to="ProjectId"), "Region": fields.Str(required=True, dump_to="Region"), - "ResourceId": fields.Str(required=False, dump_to="ResourceId"), + "ResourceId": fields.Str(required=True, dump_to="ResourceId"), } @@ -711,7 +711,7 @@ class RotateKeyOnDemandRequestSchema(schema.RequestSchema): "KeyId": fields.Str(required=True, dump_to="KeyId"), "ProjectId": fields.Str(required=False, dump_to="ProjectId"), "Region": fields.Str(required=True, dump_to="Region"), - "ResourceId": fields.Str(required=False, dump_to="ResourceId"), + "ResourceId": fields.Str(required=True, dump_to="ResourceId"), } diff --git a/ucloud/services/ukms/schemas/models.py b/ucloud/services/ukms/schemas/models.py index b9accc0..36b6c26 100644 --- a/ucloud/services/ukms/schemas/models.py +++ b/ucloud/services/ukms/schemas/models.py @@ -7,6 +7,7 @@ class KeyMetadataSchema(schema.ResponseSchema): """KeyMetadata - DescribeKey 返回的密钥元数据""" fields = { + "Arn": fields.Str(required=False, load_from="Arn"), "CreationDate": fields.Int(required=True, load_from="CreationDate"), "DeletionDate": fields.Int(required=False, load_from="DeletionDate"), "DeletionProtection": fields.Bool( @@ -21,7 +22,7 @@ class KeyMetadataSchema(schema.ResponseSchema): "KeyVersion": fields.Int(required=True, load_from="KeyVersion"), "OrganizationId": fields.Int( required=False, load_from="OrganizationId" - ), # Deprecated, will be removed at 1.0 + ), "Origin": fields.Str(required=True, load_from="Origin"), "ProjectId": fields.Str(required=False, load_from="ProjectId"), "ResourceId": fields.Str(required=True, load_from="ResourceId"), diff --git a/ucloud/version.py b/ucloud/version.py index 46694c6..401130c 100644 --- a/ucloud/version.py +++ b/ucloud/version.py @@ -1 +1 @@ -version = "0.11.126" +version = "0.11.127"