磁盘专属集群
更新时间:2024-07-02
创建磁盘专属集群
使用以下代码可以根据实例ID批量查询实例列表:
def test_create_volume_cluster(self):
"""
test case for create_volume_cluster
"""
client_token = generate_client_token()
cluster_size_in_gb = 97280
create_response = self.client.create_volume_cluster(cluster_size_in_gb=cluster_size_in_gb, zone_name='cn-bj-a')
print(create_response)
self.assertEqual(
type(create_response),
baidubce.bce_response.BceResponse)
磁盘专属集群列表
使用以下代码可以根据实例ID批量查询实例列表:
def test_list_volume_cluster(self):
"""
test case for list_volume_cluster
"""
create_response = self.client.list_volume_cluster()
print(create_response)
self.assertEqual(
type(create_response),
baidubce.bce_response.BceResponse)
磁盘专属集群详情
使用以下代码可以根据实例ID批量查询磁盘专属集群详情:
def test_get_volume_cluster(self):
"""
test case for get_volume_cluster
"""
create_response = self.client.get_volume_cluster(cluster_id='DC-yWfhpUbN')
print(create_response)
self.assertEqual(
type(create_response),
baidubce.bce_response.BceResponse)
磁盘专属集群扩容
使用以下代码可以给磁盘专属集群扩容:
def test_resize_volume_cluster(self):
"""
test case for resize_volume_cluster
"""
create_response = self.client.resize_volume_cluster(cluster_id='DC-yWfhpUbN', new_cluster_size=107520)
print(create_response)
self.assertEqual(
type(create_response),
baidubce.bce_response.BceResponse)
磁盘专属集群续费
使用以下代码可以给专属集群续费:
def test_renew_volume_cluster(self):
"""
test case for renew_volume_cluster
"""
create_response = self.client.renew_volume_cluster(cluster_id='DC-yWfhpUbN')
print(create_response)
self.assertEqual(
type(create_response),
baidubce.bce_response.BceResponse)
磁盘专属集群自动续费
使用以下代码可以给专属集群设置自动续费:
def test_autoRenew_volume_cluster(self):
"""
test case for autoRenew_volume_cluster
"""
create_response = self.client.autoRenew_volume_cluster(cluster_id='DC-yWfhpUbN')
print(create_response)
self.assertEqual(
type(create_response),
baidubce.bce_response.BceResponse)
磁盘专属集群取消自动续费
使用以下代码可以取消磁盘专属集群自动续费:
def test_cancel_autoRenew_volume_cluster(self):
"""
test case for cancel_autoRenew_volume_cluster
"""
create_response = self.client.cancel_autoRenew_volume_cluster(cluster_id='DC-yWfhpUbN')
print(create_response)
self.assertEqual(
type(create_response),
baidubce.bce_response.BceResponse)