Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 28 additions & 12 deletions ucloud/services/ufile/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ def create_bucket(
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
- **BucketName** (str) - (Required) 待创建Bucket的名称,具有全局唯一性
- **FakeRegion** (str) - bucket的可用区
- **Tag** (str) - Bucket所属业务组,默认为default
- **Type** (str) - Bucket访问类型,public或private; 默认为private

Expand Down Expand Up @@ -228,6 +229,7 @@ def create_ufile_token(
- **AllowedPrefixes** (list) - 令牌允许操作的key前缀,默认*表示全部
- **BlackIPList** (list) - 令牌黑名单,支持ipv4,ipv6格式。
- **ExpireTime** (int) - Unix 时间戳,精确到秒,为令牌过期时间点。默认过期时间为一天(即当前Unix时间戳+86400);注意:过期时间不能超过 4102416000
- **FakeRegion** (str) - bucket的可用区
- **WhiteIPList** (list) - 令牌白名单,支持ipv4,ipv6格式。

**Response**
Expand Down Expand Up @@ -440,9 +442,10 @@ def delete_ufile_token(

**Request**

- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list.html>`_
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html>`_
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
- **TokenId** (str) - (Required) 令牌ID
- **FakeRegion** (str) - bucket的可用区

**Response**

Expand All @@ -469,6 +472,7 @@ def describe_bucket(
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
- **Region** (str) - (Config) 如果提供此参数,则获取相应地域下所有空间的空间名称(只返回空间名称信息)
- **BucketName** (str) - 待获取Bucket的名称,若不提供,则获取所有Bucket
- **FakeRegion** (str) - bucket可用区
- **Limit** (int) - 获取所有Bucket列表的限制数目,默认为20
- **Offset** (int) - 获取所有Bucket列表的偏移数目,默认为0

Expand Down Expand Up @@ -794,9 +798,10 @@ def describe_ufile_token(

**Request**

- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list.html>`_
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html>`_
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
- **Display** (int) - 0表示显示部分token信息;不传递和其他情况表示显示全部token信息
- **FakeRegion** (str) - bucket的可用区
- **TokenId** (str) - 令牌ID,只返回指定ID信息,否则拉取所有令牌
- **TokenName** (str) - 令牌名称,只返回指定令牌名称信息,否则拉取所有令牌

Expand All @@ -808,8 +813,9 @@ def describe_ufile_token(

**UFileTokenSet**
- **AllowedBuckets** (list) - 令牌允许操作的bucket
- **AllowedOps** (list) - 令牌允许执行的操作,[ TOKEN_ALLOW_NONE , TOKEN_ALLOW_READ , TOKEN_ALLOW_WRITE , TOKEN_ALLOW_DELETE , TOKEN_ALLOW_LIST, TOKEN_ALLOW_IOP , TOKEN_ALLOW_DP ]
- **AllowedOps** (list) - 令牌允许执行的操作,[ TOKEN_ALLOW_NONE 没有权限, TOKEN_ALLOW_READ 下载权限, TOKEN_ALLOW_WRITE 上传权限, TOKEN_ALLOW_DELETE 删除权限, TOKEN_ALLOW_LIST 列表权限, TOKEN_ALLOW_IOP 图片处理权限]
- **AllowedPrefixes** (list) - 令牌允许操作的key前缀
- **BlackIPList** (list) - 令牌黑名单
- **CreateTime** (int) - 创建时间
- **ExpireTime** (int) - 令牌的超时时间点
- **ModifyTime** (int) - 修改时间
Expand All @@ -818,6 +824,7 @@ def describe_ufile_token(
- **Region** (str) - 所属地区
- **TokenId** (str) - 令牌ID
- **TokenName** (str) - 令牌名称
- **WhiteIPList** (list) - 令牌白名单


"""
Expand Down Expand Up @@ -930,6 +937,7 @@ def get_project_region_quota(

- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
- **FakeRegion** (str) - bucket可用区
- **Zone** (str) - 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_

**Response**
Expand Down Expand Up @@ -962,6 +970,7 @@ def get_ufile_daily_bill(
- **EndTime** (int) - (Required) 查询结束时间;unix时间戳,单位s
- **StartTime** (int) - (Required) 查询开始时间;unix时间戳,单位s
- **BucketName** (str) - 空间名称。此字段不为空,返回此Bucket日账单,否则,返回这个项目的日账单
- **FakeRegion** (str) - bucket的可用区

**Response**

Expand Down Expand Up @@ -1029,6 +1038,7 @@ def get_ufile_daily_report(
- **EndTime** (int) - (Required) 查询结束时间;unix时间戳,单位s
- **StartTime** (int) - (Required) 查询开始时间;unix时间戳,单位s
- **BucketName** (str) - 空间名称。此字段不为空,返回此Bucket日使用量;否则,返回这个项目的日使用量
- **FakeRegion** (str) - bucket可用区

**Response**

Expand Down Expand Up @@ -1093,6 +1103,7 @@ def get_ufile_monthly_bill(
- **EndMonth** (str) - (Required) 查询结束时间;例如"1994-07"
- **StartMonth** (str) - (Required) 查询开始月份;例如"1994-07"
- **BucketName** (str) - 空间名称。此字段不为空,返回此Bucket日账单,否则,返回这个项目的日账单
- **FakeRegion** (str) - bucket可用区

**Response**

Expand Down Expand Up @@ -1282,10 +1293,11 @@ def get_ufile_report(

**Request**

- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list.html>`_
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html>`_
- **EndTime** (int) - (Required) 查询结束时间
- **StartTime** (int) - (Required) 查询开始时间
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
- **EndTime** (int) - (Required) 查询结束时间, 单位 s
- **StartTime** (int) - (Required) 查询开始时间,单位 s
- **FakeRegion** (str) - bucket的可用区

**Response**

Expand Down Expand Up @@ -1378,6 +1390,7 @@ def set_project_region_quota(
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
- **QuotaLimit** (int) - (Required) 配额数目(单位是Byte)
- **FakeRegion** (str) - bucket的可用区
- **Zone** (str) - 可用区。参见 `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_

**Response**
Expand Down Expand Up @@ -1590,14 +1603,17 @@ def update_ufile_token(

**Request**

- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list.html>`_
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html>`_
- **ProjectId** (str) - (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考 `GetProjectList接口 <https://docs.ucloud.cn/api/summary/get_project_list>`_
- **Region** (str) - (Config) 地域。 参见 `地域和可用区列表 <https://docs.ucloud.cn/api/summary/regionlist>`_
- **TokenId** (str) - (Required) 令牌ID
- **AllowedBuckets** (list) - 令牌允许操作的bucket
- **AllowedOps** (list) - 令牌允许执行的操作,[ TOKEN_ALLOW_NONE , TOKEN_ALLOW_READ , TOKEN_ALLOW_WRITE , TOKEN_ALLOW_DELETE , TOKEN_ALLOW_LIST, TOKEN_ALLOW_IOP , TOKEN_ALLOW_DP ]
- **AllowedOps** (list) - 令牌允许执行的操作,[ TOKEN_ALLOW_NONE , TOKEN_ALLOW_READ , TOKEN_ALLOW_WRITE , TOKEN_ALLOW_DELETE , TOKEN_ALLOW_LIST, TOKEN_ALLOW_IOP , TOKEN_ALLOW_DP ,TOKEN_DENY_UPDATE]
- **AllowedPrefixes** (list) - 令牌允许操作的key前缀
- **BlackIPList** (list) - 令牌黑名单,支持ipv4,ipv6格式。
- **ExpireTime** (int) - 令牌的超时时间点(时间戳);注意:过期时间不能超过 4102416000
- **FakeRegion** (str) - bucket的可用区
- **TokenName** (str) - 令牌名称
- **WhiteIPList** (list) - 令牌黑名单,支持ipv4,ipv6格式。

**Response**

Expand Down
18 changes: 16 additions & 2 deletions ucloud/services/ufile/schemas/apis.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ class CreateBucketRequestSchema(schema.RequestSchema):

fields = {
"BucketName": fields.Str(required=True, dump_to="BucketName"),
"FakeRegion": fields.Str(required=False, dump_to="FakeRegion"),
"ProjectId": fields.Str(required=False, dump_to="ProjectId"),
"Region": fields.Str(required=True, dump_to="Region"),
"Tag": fields.Str(required=False, dump_to="Tag"),
Expand Down Expand Up @@ -205,6 +206,7 @@ class CreateUFileTokenRequestSchema(schema.RequestSchema):
"AllowedPrefixes": fields.List(fields.Str()),
"BlackIPList": fields.List(fields.Str()),
"ExpireTime": fields.Int(required=False, dump_to="ExpireTime"),
"FakeRegion": fields.Str(required=False, dump_to="FakeRegion"),
"ProjectId": fields.Str(required=False, dump_to="ProjectId"),
"Region": fields.Str(required=False, dump_to="Region"),
"TokenName": fields.Str(required=True, dump_to="TokenName"),
Expand Down Expand Up @@ -387,7 +389,8 @@ class DeleteUFileTokenRequestSchema(schema.RequestSchema):
"""DeleteUFileToken - 删除令牌"""

fields = {
"ProjectId": fields.Str(required=True, dump_to="ProjectId"),
"FakeRegion": fields.Str(required=False, dump_to="FakeRegion"),
"ProjectId": fields.Str(required=False, dump_to="ProjectId"),
"Region": fields.Str(required=True, dump_to="Region"),
"TokenId": fields.Str(required=True, dump_to="TokenId"),
}
Expand All @@ -411,6 +414,7 @@ class DescribeBucketRequestSchema(schema.RequestSchema):

fields = {
"BucketName": fields.Str(required=False, dump_to="BucketName"),
"FakeRegion": fields.Str(required=False, dump_to="FakeRegion"),
"Limit": fields.Int(required=False, dump_to="Limit"),
"Offset": fields.Int(required=False, dump_to="Offset"),
"ProjectId": fields.Str(required=False, dump_to="ProjectId"),
Expand Down Expand Up @@ -646,6 +650,7 @@ class DescribeUFileTokenRequestSchema(schema.RequestSchema):

fields = {
"Display": fields.Int(required=False, dump_to="Display"),
"FakeRegion": fields.Str(required=False, dump_to="FakeRegion"),
"ProjectId": fields.Str(required=False, dump_to="ProjectId"),
"Region": fields.Str(required=False, dump_to="Region"),
"TokenId": fields.Str(required=False, dump_to="TokenId"),
Expand Down Expand Up @@ -753,6 +758,7 @@ class GetProjectRegionQuotaRequestSchema(schema.RequestSchema):
"""GetProjectRegionQuota - 获取项目地域配额"""

fields = {
"FakeRegion": fields.Str(required=False, dump_to="FakeRegion"),
"ProjectId": fields.Str(required=True, dump_to="ProjectId"),
"Region": fields.Str(required=True, dump_to="Region"),
"Zone": fields.Str(required=False, dump_to="Zone"),
Expand Down Expand Up @@ -782,6 +788,7 @@ class GetUFileDailyBillRequestSchema(schema.RequestSchema):
fields = {
"BucketName": fields.Str(required=False, dump_to="BucketName"),
"EndTime": fields.Int(required=True, dump_to="EndTime"),
"FakeRegion": fields.Str(required=False, dump_to="FakeRegion"),
"ProjectId": fields.Str(required=False, dump_to="ProjectId"),
"Region": fields.Str(required=True, dump_to="Region"),
"StartTime": fields.Int(required=True, dump_to="StartTime"),
Expand Down Expand Up @@ -811,6 +818,7 @@ class GetUFileDailyReportRequestSchema(schema.RequestSchema):
fields = {
"BucketName": fields.Str(required=False, dump_to="BucketName"),
"EndTime": fields.Int(required=True, dump_to="EndTime"),
"FakeRegion": fields.Str(required=False, dump_to="FakeRegion"),
"ProjectId": fields.Str(required=False, dump_to="ProjectId"),
"Region": fields.Str(required=True, dump_to="Region"),
"StartTime": fields.Int(required=True, dump_to="StartTime"),
Expand Down Expand Up @@ -840,6 +848,7 @@ class GetUFileMonthlyBillRequestSchema(schema.RequestSchema):
fields = {
"BucketName": fields.Str(required=False, dump_to="BucketName"),
"EndMonth": fields.Str(required=True, dump_to="EndMonth"),
"FakeRegion": fields.Str(required=False, dump_to="FakeRegion"),
"ProjectId": fields.Str(required=False, dump_to="ProjectId"),
"Region": fields.Str(required=True, dump_to="Region"),
"StartMonth": fields.Str(required=True, dump_to="StartMonth"),
Expand Down Expand Up @@ -983,6 +992,7 @@ class GetUFileReportRequestSchema(schema.RequestSchema):

fields = {
"EndTime": fields.Int(required=True, dump_to="EndTime"),
"FakeRegion": fields.Str(required=False, dump_to="FakeRegion"),
"ProjectId": fields.Str(required=False, dump_to="ProjectId"),
"Region": fields.Str(required=True, dump_to="Region"),
"StartTime": fields.Int(required=True, dump_to="StartTime"),
Expand Down Expand Up @@ -1061,6 +1071,7 @@ class SetProjectRegionQuotaRequestSchema(schema.RequestSchema):
"""SetProjectRegionQuota - 设置项目地域配额"""

fields = {
"FakeRegion": fields.Str(required=False, dump_to="FakeRegion"),
"ProjectId": fields.Str(required=True, dump_to="ProjectId"),
"QuotaLimit": fields.Int(required=True, dump_to="QuotaLimit"),
"Region": fields.Str(required=True, dump_to="Region"),
Expand Down Expand Up @@ -1272,11 +1283,14 @@ class UpdateUFileTokenRequestSchema(schema.RequestSchema):
"AllowedBuckets": fields.List(fields.Str()),
"AllowedOps": fields.List(fields.Str()),
"AllowedPrefixes": fields.List(fields.Str()),
"BlackIPList": fields.List(fields.Str()),
"ExpireTime": fields.Int(required=False, dump_to="ExpireTime"),
"ProjectId": fields.Str(required=True, dump_to="ProjectId"),
"FakeRegion": fields.Str(required=False, dump_to="FakeRegion"),
"ProjectId": fields.Str(required=False, dump_to="ProjectId"),
"Region": fields.Str(required=False, dump_to="Region"),
"TokenId": fields.Str(required=True, dump_to="TokenId"),
"TokenName": fields.Str(required=False, dump_to="TokenName"),
"WhiteIPList": fields.List(fields.Str()),
}


Expand Down
2 changes: 2 additions & 0 deletions ucloud/services/ufile/schemas/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class UFileTokenSetSchema(schema.ResponseSchema):
"AllowedBuckets": fields.List(fields.Str()),
"AllowedOps": fields.List(fields.Str()),
"AllowedPrefixes": fields.List(fields.Str()),
"BlackIPList": fields.List(fields.Str()),
"CreateTime": fields.Int(required=True, load_from="CreateTime"),
"ExpireTime": fields.Int(required=True, load_from="ExpireTime"),
"ModifyTime": fields.Int(required=True, load_from="ModifyTime"),
Expand All @@ -18,6 +19,7 @@ class UFileTokenSetSchema(schema.ResponseSchema):
"Region": fields.Str(required=True, load_from="Region"),
"TokenId": fields.Str(required=True, load_from="TokenId"),
"TokenName": fields.Str(required=True, load_from="TokenName"),
"WhiteIPList": fields.List(fields.Str()),
}


Expand Down
2 changes: 1 addition & 1 deletion ucloud/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version = "0.11.158"
version = "0.11.159"
Loading