/// <summary>
        /// 删除告警规则
        /// </summary>
        public DeleteAlarmResponse DeleteAlarm(DeleteAlarmRequest deleteAlarmRequest)
        {
            Dictionary <string, string> urlParam = new Dictionary <string, string>();

            urlParam.Add("alarm_id", deleteAlarmRequest.AlarmId.ToString());
            string              urlPath  = HttpUtils.AddUrlPath("/V1.0/{project_id}/alarms/{alarm_id}", urlParam);
            SdkRequest          request  = HttpUtils.InitSdkRequest(urlPath, deleteAlarmRequest);
            HttpResponseMessage response = DoHttpRequestSync("DELETE", request);

            return(JsonUtils.DeSerializeNull <DeleteAlarmResponse>(response));
        }
Beispiel #2
0
        /// <summary>
        /// 采集Redis运行日志
        /// </summary>
        public CreateRedislogResponse CreateRedislog(CreateRedislogRequest createRedislogRequest)
        {
            Dictionary <string, string> urlParam = new Dictionary <string, string>();

            urlParam.Add("instance_id", createRedislogRequest.InstanceId.ToString());
            string              urlPath  = HttpUtils.AddUrlPath("/v2/{project_id}/instances/{instance_id}/redislog", urlParam);
            SdkRequest          request  = HttpUtils.InitSdkRequest(urlPath, "application/json", createRedislogRequest);
            HttpResponseMessage response = DoHttpRequestSync("POST", request);

            return(JsonUtils.DeSerializeNull <CreateRedislogResponse>(response));
        }
Beispiel #3
0
        /// <summary>
        /// 删除实例
        /// </summary>
        public DeleteSingleInstanceResponse DeleteSingleInstance(DeleteSingleInstanceRequest deleteSingleInstanceRequest)
        {
            Dictionary <string, string> urlParam = new Dictionary <string, string>();

            urlParam.Add("instance_id", deleteSingleInstanceRequest.InstanceId.ToString());
            string              urlPath  = HttpUtils.AddUrlPath("/v2/{project_id}/instances/{instance_id}", urlParam);
            SdkRequest          request  = HttpUtils.InitSdkRequest(urlPath, "application/json", deleteSingleInstanceRequest);
            HttpResponseMessage response = DoHttpRequestSync("DELETE", request);

            return(JsonUtils.DeSerializeNull <DeleteSingleInstanceResponse>(response));
        }
Beispiel #4
0
        /// <summary>
        /// 查询单个策略
        /// </summary>
        public ShowPolicyResponse ShowPolicy(ShowPolicyRequest showPolicyRequest)
        {
            Dictionary <string, string> urlParam = new Dictionary <string, string>();

            urlParam.Add("policy_id", showPolicyRequest.PolicyId.ToString());
            string              urlPath  = HttpUtils.AddUrlPath("/v3/{project_id}/policies/{policy_id}", urlParam);
            SdkRequest          request  = HttpUtils.InitSdkRequest(urlPath, "application/json", showPolicyRequest);
            HttpResponseMessage response = DoHttpRequestSync("GET", request);

            return(JsonUtils.DeSerialize <ShowPolicyResponse>(response));
        }
Beispiel #5
0
        /// <summary>
        /// 修改存储库
        /// </summary>
        public UpdateVaultResponse UpdateVault(UpdateVaultRequest updateVaultRequest)
        {
            Dictionary <string, string> urlParam = new Dictionary <string, string>();

            urlParam.Add("vault_id", updateVaultRequest.VaultId.ToString());
            string              urlPath  = HttpUtils.AddUrlPath("/v3/{project_id}/vaults/{vault_id}", urlParam);
            SdkRequest          request  = HttpUtils.InitSdkRequest(urlPath, "application/json;charset=UTF-8", updateVaultRequest);
            HttpResponseMessage response = DoHttpRequestSync("PUT", request);

            return(JsonUtils.DeSerialize <UpdateVaultResponse>(response));
        }
Beispiel #6
0
        /// <summary>
        /// 解除存储库策略
        /// </summary>
        public DisassociateVaultPolicyResponse DisassociateVaultPolicy(DisassociateVaultPolicyRequest disassociateVaultPolicyRequest)
        {
            Dictionary <string, string> urlParam = new Dictionary <string, string>();

            urlParam.Add("vault_id", disassociateVaultPolicyRequest.VaultId.ToString());
            string              urlPath  = HttpUtils.AddUrlPath("/v3/{project_id}/vaults/{vault_id}/dissociatepolicy", urlParam);
            SdkRequest          request  = HttpUtils.InitSdkRequest(urlPath, "application/json;charset=UTF-8", disassociateVaultPolicyRequest);
            HttpResponseMessage response = DoHttpRequestSync("POST", request);

            return(JsonUtils.DeSerialize <DisassociateVaultPolicyResponse>(response));
        }
Beispiel #7
0
        /// <summary>
        /// 获取备份成员列表
        /// </summary>
        public ShowMembersDetailResponse ShowMembersDetail(ShowMembersDetailRequest showMembersDetailRequest)
        {
            Dictionary <string, string> urlParam = new Dictionary <string, string>();

            urlParam.Add("backup_id", showMembersDetailRequest.BackupId.ToString());
            string              urlPath  = HttpUtils.AddUrlPath("/v3/{project_id}/backups/{backup_id}/members", urlParam);
            SdkRequest          request  = HttpUtils.InitSdkRequest(urlPath, "application/json", showMembersDetailRequest);
            HttpResponseMessage response = DoHttpRequestSync("GET", request);

            return(JsonUtils.DeSerialize <ShowMembersDetailResponse>(response));
        }
Beispiel #8
0
        /// <summary>
        /// 删除指定函数的所有触发器。
        /// </summary>
        public BatchDeleteFunctionTriggersResponse BatchDeleteFunctionTriggers(BatchDeleteFunctionTriggersRequest batchDeleteFunctionTriggersRequest)
        {
            Dictionary <string, string> urlParam = new Dictionary <string, string>();

            urlParam.Add("function_urn", batchDeleteFunctionTriggersRequest.FunctionUrn.ToString());
            string              urlPath  = HttpUtils.AddUrlPath("/v2/{project_id}/fgs/triggers/{function_urn}", urlParam);
            SdkRequest          request  = HttpUtils.InitSdkRequest(urlPath, "application/json", batchDeleteFunctionTriggersRequest);
            HttpResponseMessage response = DoHttpRequestSync("DELETE", request);

            return(JsonUtils.DeSerializeNull <BatchDeleteFunctionTriggersResponse>(response));
        }
Beispiel #9
0
        /// <summary>
        /// 发布函数版本。
        /// </summary>
        public CreateFunctionVersionResponse CreateFunctionVersion(CreateFunctionVersionRequest createFunctionVersionRequest)
        {
            Dictionary <string, string> urlParam = new Dictionary <string, string>();

            urlParam.Add("function_urn", createFunctionVersionRequest.FunctionUrn.ToString());
            string              urlPath  = HttpUtils.AddUrlPath("/v2/{project_id}/fgs/functions/{function_urn}/versions", urlParam);
            SdkRequest          request  = HttpUtils.InitSdkRequest(urlPath, "application/json", createFunctionVersionRequest);
            HttpResponseMessage response = DoHttpRequestSync("POST", request);

            return(JsonUtils.DeSerialize <CreateFunctionVersionResponse>(response));
        }
Beispiel #10
0
        /// <summary>
        /// 更新依赖包指定依赖包
        /// </summary>
        public UpdateDependencyResponse UpdateDependency(UpdateDependencyRequest updateDependencyRequest)
        {
            Dictionary <string, string> urlParam = new Dictionary <string, string>();

            urlParam.Add("depend_id", updateDependencyRequest.DependId.ToString());
            string              urlPath  = HttpUtils.AddUrlPath("/v2/{project_id}/fgs/dependencies/{depend_id}", urlParam);
            SdkRequest          request  = HttpUtils.InitSdkRequest(urlPath, "application/json", updateDependencyRequest);
            HttpResponseMessage response = DoHttpRequestSync("PUT", request);

            return(JsonUtils.DeSerialize <UpdateDependencyResponse>(response));
        }
Beispiel #11
0
        /// <summary>
        /// 更新函数预留实例个数
        /// </summary>
        public UpdateFunctionReservedInstancesResponse UpdateFunctionReservedInstances(UpdateFunctionReservedInstancesRequest updateFunctionReservedInstancesRequest)
        {
            Dictionary <string, string> urlParam = new Dictionary <string, string>();

            urlParam.Add("function_urn", updateFunctionReservedInstancesRequest.FunctionUrn.ToString());
            string              urlPath  = HttpUtils.AddUrlPath("/v2/{project_id}/fgs/functions/{function_urn}/reservedinstances", urlParam);
            SdkRequest          request  = HttpUtils.InitSdkRequest(urlPath, "application/json", updateFunctionReservedInstancesRequest);
            HttpResponseMessage response = DoHttpRequestSync("PUT", request);

            return(JsonUtils.DeSerialize <UpdateFunctionReservedInstancesResponse>(response));
        }
Beispiel #12
0
        /// <summary>
        /// 获取函数的metadata。
        /// </summary>
        public ShowFunctionConfigResponse ShowFunctionConfig(ShowFunctionConfigRequest showFunctionConfigRequest)
        {
            Dictionary <string, string> urlParam = new Dictionary <string, string>();

            urlParam.Add("function_urn", showFunctionConfigRequest.FunctionUrn.ToString());
            string              urlPath  = HttpUtils.AddUrlPath("/v2/{project_id}/fgs/functions/{function_urn}/config", urlParam);
            SdkRequest          request  = HttpUtils.InitSdkRequest(urlPath, "application/json", showFunctionConfigRequest);
            HttpResponseMessage response = DoHttpRequestSync("GET", request);

            return(JsonUtils.DeSerialize <ShowFunctionConfigResponse>(response));
        }
Beispiel #13
0
        /// <summary>
        /// 函数异步执行并返回预留实例ID。
        /// </summary>
        public AsyncInvokeReservedFunctionResponse AsyncInvokeReservedFunction(AsyncInvokeReservedFunctionRequest asyncInvokeReservedFunctionRequest)
        {
            Dictionary <string, string> urlParam = new Dictionary <string, string>();

            urlParam.Add("function_urn", asyncInvokeReservedFunctionRequest.FunctionUrn.ToString());
            string              urlPath  = HttpUtils.AddUrlPath("/v2/{project_id}/fgs/functions/{function_urn}/reserved-invocations", urlParam);
            SdkRequest          request  = HttpUtils.InitSdkRequest(urlPath, "application/json", asyncInvokeReservedFunctionRequest);
            HttpResponseMessage response = DoHttpRequestSync("POST", request);

            return(JsonUtils.DeSerialize <AsyncInvokeReservedFunctionResponse>(response));
        }
Beispiel #14
0
        /// <summary>
        /// 获取函数异步配置列表
        /// </summary>
        public ListFunctionAsyncInvokeConfigResponse ListFunctionAsyncInvokeConfig(ListFunctionAsyncInvokeConfigRequest listFunctionAsyncInvokeConfigRequest)
        {
            Dictionary <string, string> urlParam = new Dictionary <string, string>();

            urlParam.Add("function_urn", listFunctionAsyncInvokeConfigRequest.FunctionUrn.ToString());
            string              urlPath  = HttpUtils.AddUrlPath("/v2/{project_id}/fgs/functions/{function_urn}/async-invoke-configs", urlParam);
            SdkRequest          request  = HttpUtils.InitSdkRequest(urlPath, "application/json", listFunctionAsyncInvokeConfigRequest);
            HttpResponseMessage response = DoHttpRequestSync("GET", request);

            return(JsonUtils.DeSerialize <ListFunctionAsyncInvokeConfigResponse>(response));
        }
Beispiel #15
0
        /// <summary>
        /// 添加存储库资源标签
        /// </summary>
        public CreateVaultTagsResponse CreateVaultTags(CreateVaultTagsRequest createVaultTagsRequest)
        {
            Dictionary <string, string> urlParam = new Dictionary <string, string>();

            urlParam.Add("vault_id", createVaultTagsRequest.VaultId.ToString());
            string              urlPath  = HttpUtils.AddUrlPath("/v3/{project_id}/vault/{vault_id}/tags", urlParam);
            SdkRequest          request  = HttpUtils.InitSdkRequest(urlPath, "application/json;charset=UTF-8", createVaultTagsRequest);
            HttpResponseMessage response = DoHttpRequestSync("POST", request);

            return(JsonUtils.DeSerializeNull <CreateVaultTagsResponse>(response));
        }
        /// <summary>
        /// 删除云硬盘
        /// </summary>
        public DeleteVolumeResponse DeleteVolume(DeleteVolumeRequest deleteVolumeRequest)
        {
            Dictionary <string, string> urlParam = new Dictionary <string, string>();

            urlParam.Add("volume_id", deleteVolumeRequest.VolumeId.ToString());
            string              urlPath  = HttpUtils.AddUrlPath("/v2/{project_id}/cloudvolumes/{volume_id}", urlParam);
            SdkRequest          request  = HttpUtils.InitSdkRequest(urlPath, deleteVolumeRequest);
            HttpResponseMessage response = DoHttpRequestSync("DELETE", request);

            return(JsonUtils.DeSerialize <DeleteVolumeResponse>(response));
        }
Beispiel #17
0
        /// <summary>
        /// 删除备份
        /// </summary>
        public DeleteBackupResponse DeleteBackup(DeleteBackupRequest deleteBackupRequest)
        {
            Dictionary <string, string> urlParam = new Dictionary <string, string>();

            urlParam.Add("backup_id", deleteBackupRequest.BackupId.ToString());
            string              urlPath  = HttpUtils.AddUrlPath("/v3/{project_id}/backups/{backup_id}", urlParam);
            SdkRequest          request  = HttpUtils.InitSdkRequest(urlPath, "application/json", deleteBackupRequest);
            HttpResponseMessage response = DoHttpRequestSync("DELETE", request);

            return(JsonUtils.DeSerializeNull <DeleteBackupResponse>(response));
        }
        /// <summary>
        /// 回滚快照到云硬盘
        /// </summary>
        public RollbackSnapshotResponse RollbackSnapshot(RollbackSnapshotRequest rollbackSnapshotRequest)
        {
            Dictionary <string, string> urlParam = new Dictionary <string, string>();

            urlParam.Add("snapshot_id", rollbackSnapshotRequest.SnapshotId.ToString());
            string              urlPath  = HttpUtils.AddUrlPath("/v2/{project_id}/cloudsnapshots/{snapshot_id}/rollback", urlParam);
            SdkRequest          request  = HttpUtils.InitSdkRequest(urlPath, "application/json;charset=UTF-8", rollbackSnapshotRequest);
            HttpResponseMessage response = DoHttpRequestSync("POST", request);

            return(JsonUtils.DeSerialize <RollbackSnapshotResponse>(response));
        }
Beispiel #19
0
        /// <summary>
        /// 查询可保护资源
        /// </summary>
        public ListProtectableResponse ListProtectable(ListProtectableRequest listProtectableRequest)
        {
            Dictionary <string, string> urlParam = new Dictionary <string, string>();

            urlParam.Add("protectable_type", listProtectableRequest.ProtectableType.ToString());
            string              urlPath  = HttpUtils.AddUrlPath("/v3/{project_id}/protectables/{protectable_type}/instances", urlParam);
            SdkRequest          request  = HttpUtils.InitSdkRequest(urlPath, "application/json", listProtectableRequest);
            HttpResponseMessage response = DoHttpRequestSync("GET", request);

            return(JsonUtils.DeSerialize <ListProtectableResponse>(response));
        }
        /// <summary>
        /// 查询job的状态
        /// </summary>
        public ShowJobResponse ShowJob(ShowJobRequest showJobRequest)
        {
            Dictionary <string, string> urlParam = new Dictionary <string, string>();

            urlParam.Add("job_id", showJobRequest.JobId.ToString());
            string              urlPath  = HttpUtils.AddUrlPath("/v1/{project_id}/jobs/{job_id}", urlParam);
            SdkRequest          request  = HttpUtils.InitSdkRequest(urlPath, showJobRequest);
            HttpResponseMessage response = DoHttpRequestSync("GET", request);

            return(JsonUtils.DeSerialize <ShowJobResponse>(response));
        }
Beispiel #21
0
        /// <summary>
        /// 查询单个任务
        /// </summary>
        public ShowOpLogResponse ShowOpLog(ShowOpLogRequest showOpLogRequest)
        {
            Dictionary <string, string> urlParam = new Dictionary <string, string>();

            urlParam.Add("operation_log_id", showOpLogRequest.OperationLogId.ToString());
            string              urlPath  = HttpUtils.AddUrlPath("/v3/{project_id}/operation-logs/{operation_log_id}", urlParam);
            SdkRequest          request  = HttpUtils.InitSdkRequest(urlPath, "application/json", showOpLogRequest);
            HttpResponseMessage response = DoHttpRequestSync("GET", request);

            return(JsonUtils.DeSerialize <ShowOpLogResponse>(response));
        }
        /// <summary>
        /// 查询单个云硬盘快照详细信息
        /// </summary>
        public ShowSnapshotResponse ShowSnapshot(ShowSnapshotRequest showSnapshotRequest)
        {
            Dictionary <string, string> urlParam = new Dictionary <string, string>();

            urlParam.Add("snapshot_id", showSnapshotRequest.SnapshotId.ToString());
            string              urlPath  = HttpUtils.AddUrlPath("/v2/{project_id}/cloudsnapshots/{snapshot_id}", urlParam);
            SdkRequest          request  = HttpUtils.InitSdkRequest(urlPath, showSnapshotRequest);
            HttpResponseMessage response = DoHttpRequestSync("GET", request);

            return(JsonUtils.DeSerialize <ShowSnapshotResponse>(response));
        }
Beispiel #23
0
        /// <summary>
        /// 查询存储库资源标签
        /// </summary>
        public ShowVaultTagResponse ShowVaultTag(ShowVaultTagRequest showVaultTagRequest)
        {
            Dictionary <string, string> urlParam = new Dictionary <string, string>();

            urlParam.Add("vault_id", showVaultTagRequest.VaultId.ToString());
            string              urlPath  = HttpUtils.AddUrlPath("/v3/{project_id}/vault/{vault_id}/tags", urlParam);
            SdkRequest          request  = HttpUtils.InitSdkRequest(urlPath, "application/json", showVaultTagRequest);
            HttpResponseMessage response = DoHttpRequestSync("GET", request);

            return(JsonUtils.DeSerialize <ShowVaultTagResponse>(response));
        }
        /// <summary>
        /// 查询云硬盘标签
        /// </summary>
        public ShowVolumeTagsResponse ShowVolumeTags(ShowVolumeTagsRequest showVolumeTagsRequest)
        {
            Dictionary <string, string> urlParam = new Dictionary <string, string>();

            urlParam.Add("volume_id", showVolumeTagsRequest.VolumeId.ToString());
            string              urlPath  = HttpUtils.AddUrlPath("/v2/{project_id}/cloudvolumes/{volume_id}/tags", urlParam);
            SdkRequest          request  = HttpUtils.InitSdkRequest(urlPath, showVolumeTagsRequest);
            HttpResponseMessage response = DoHttpRequestSync("GET", request);

            return(JsonUtils.DeSerialize <ShowVolumeTagsResponse>(response));
        }
Beispiel #25
0
        /// <summary>
        /// 复制备份
        /// </summary>
        public CopyBackupResponse CopyBackup(CopyBackupRequest copyBackupRequest)
        {
            Dictionary <string, string> urlParam = new Dictionary <string, string>();

            urlParam.Add("backup_id", copyBackupRequest.BackupId.ToString());
            string              urlPath  = HttpUtils.AddUrlPath("/v3/{project_id}/backups/{backup_id}/replicate", urlParam);
            SdkRequest          request  = HttpUtils.InitSdkRequest(urlPath, "application/json;charset=UTF-8", copyBackupRequest);
            HttpResponseMessage response = DoHttpRequestSync("POST", request);

            return(JsonUtils.DeSerialize <CopyBackupResponse>(response));
        }
        /// <summary>
        /// 将云硬盘导出为镜像
        /// </summary>
        public CinderExportToImageResponse CinderExportToImage(CinderExportToImageRequest cinderExportToImageRequest)
        {
            Dictionary <string, string> urlParam = new Dictionary <string, string>();

            urlParam.Add("volume_id", cinderExportToImageRequest.VolumeId.ToString());
            string              urlPath  = HttpUtils.AddUrlPath("/v2/{project_id}/volumes/{volume_id}/action", urlParam);
            SdkRequest          request  = HttpUtils.InitSdkRequest(urlPath, "application/json;charset=UTF-8", cinderExportToImageRequest);
            HttpResponseMessage response = DoHttpRequestSync("POST", request);

            return(JsonUtils.DeSerialize <CinderExportToImageResponse>(response));
        }
Beispiel #27
0
        /// <summary>
        /// 批量添加或删除标签
        /// </summary>
        public BatchCreateOrDeleteTagsResponse BatchCreateOrDeleteTags(BatchCreateOrDeleteTagsRequest batchCreateOrDeleteTagsRequest)
        {
            Dictionary <string, string> urlParam = new Dictionary <string, string>();

            urlParam.Add("instance_id", batchCreateOrDeleteTagsRequest.InstanceId.ToString());
            string              urlPath  = HttpUtils.AddUrlPath("/v2/{project_id}/dcs/{instance_id}/tags/action", urlParam);
            SdkRequest          request  = HttpUtils.InitSdkRequest(urlPath, "application/json;charset=UTF-8", batchCreateOrDeleteTagsRequest);
            HttpResponseMessage response = DoHttpRequestSync("POST", request);

            return(JsonUtils.DeSerializeNull <BatchCreateOrDeleteTagsResponse>(response));
        }
        /// <summary>
        /// 查询租户的详细配额
        /// </summary>
        public CinderListQuotasResponse CinderListQuotas(CinderListQuotasRequest cinderListQuotasRequest)
        {
            Dictionary <string, string> urlParam = new Dictionary <string, string>();

            urlParam.Add("target_project_id", cinderListQuotasRequest.TargetProjectId.ToString());
            string              urlPath  = HttpUtils.AddUrlPath("/v2/{project_id}/os-quota-sets/{target_project_id}", urlParam);
            SdkRequest          request  = HttpUtils.InitSdkRequest(urlPath, cinderListQuotasRequest);
            HttpResponseMessage response = DoHttpRequestSync("GET", request);

            return(JsonUtils.DeSerialize <CinderListQuotasResponse>(response));
        }
Beispiel #29
0
        /// <summary>
        /// 查询实例备份信息
        /// </summary>
        public ListBackupRecordsResponse ListBackupRecords(ListBackupRecordsRequest listBackupRecordsRequest)
        {
            Dictionary <string, string> urlParam = new Dictionary <string, string>();

            urlParam.Add("instance_id", listBackupRecordsRequest.InstanceId.ToString());
            string              urlPath  = HttpUtils.AddUrlPath("/v2/{project_id}/instances/{instance_id}/backups", urlParam);
            SdkRequest          request  = HttpUtils.InitSdkRequest(urlPath, "application/json", listBackupRecordsRequest);
            HttpResponseMessage response = DoHttpRequestSync("GET", request);

            return(JsonUtils.DeSerialize <ListBackupRecordsResponse>(response));
        }
        /// <summary>
        /// 上报事件
        /// </summary>
        public CreateEventsResponse CreateEvents(CreateEventsRequest createEventsRequest)
        {
            Dictionary <string, string> urlParam      = new Dictionary <string, string>();
            string               urlPath              = HttpUtils.AddUrlPath("/V1.0/{project_id}/events", urlParam);
            SdkRequest           request              = HttpUtils.InitSdkRequest(urlPath, "application/json;charset=UTF-8", createEventsRequest);
            HttpResponseMessage  response             = DoHttpRequestSync("POST", request);
            CreateEventsResponse createEventsResponse = JsonUtils.DeSerializeNull <CreateEventsResponse>(response);

            createEventsResponse.Body = JsonUtils.DeSerializeList <CreateEventsResponseBody>(response);
            return(createEventsResponse);
        }