Exemple #1
0
    def create_udisk_snapshot(self,
                              req: typing.Optional[dict] = None,
                              **kwargs) -> dict:
        """CreateUDiskSnapshot - 创建snapshot快照

        **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>`_
        - **Name** (str) - (Required) 快照名称
        - **UDiskId** (str) - (Required) 快照的UDisk的Id
        - **Zone** (str) - (Required) 可用区。参见  `可用区列表 <https://docs.ucloud.cn/api/summary/regionlist.html>`_
        - **ChargeType** (str) - Year , Month, Dynamic 默认: Dynamic  (已废弃)
        - **Comment** (str) - 快照描述
        - **Quantity** (int) - 购买时长 默认: 1  (已废弃)

        **Response**

        - **SnapshotId** (list) - 快照Id

        """
        # build request
        d = {
            "ProjectId": self.config.project_id,
            "Region": self.config.region,
        }
        req and d.update(req)
        d = apis.CreateUDiskSnapshotRequestSchema().dumps(d)

        # build options
        kwargs["max_retries"] = 0  # ignore retry when api is not idempotent

        resp = self.invoke("CreateUDiskSnapshot", d, **kwargs)
        return apis.CreateUDiskSnapshotResponseSchema().loads(resp)
Exemple #2
0
    def create_udisk_snapshot(self, req=None, **kwargs):
        """ CreateUDiskSnapshot - 创建snapshot快照

        :param ProjectId: (Config) 项目ID。不填写为默认项目,子帐号必须填写。 请参考[GetProjectList接口](../summary/get_project_list.html)
        :param Region: (Config) 地域。 参见 [地域和可用区列表](../summary/regionlist.html)
        :param Name: (Required) 快照名称
        :param UDiskId: (Required) 快照的UDisk的Id
        :param Zone: (Required) 可用区。参见 [可用区列表](../summary/regionlist.html)
        :param ChargeType: (Optional) Year , Month, Dynamic 默认: Dynamic
        :param Comment: (Optional) 快照描述
        :param Quantity: (Optional) 购买时长 默认: 1
        """
        d = {"ProjectId": self.config.project_id, "Region": self.config.region}
        req and d.update(req)
        d = apis.CreateUDiskSnapshotRequestSchema().dumps(d)
        kwargs["max_retries"] = 0
        resp = self.invoke("CreateUDiskSnapshot", d, **kwargs)
        return apis.CreateUDiskSnapshotResponseSchema().loads(resp)