def delete_jobexec(): url = "https://" + OtcConfig.DEFAULT_HOST + "/v1.1/" + OtcConfig.PROJECT_ID + "/job-executions/" + OtcConfig.JOBEXEC_ID ret = utils_http.delete(url) print(url) print(ret) sahara.otcOutputHandler().print_output(ret, mainkey="") return ret
def delete_subnet(): if OtcConfig.SUBNETNAME: ecs.convertSUBNETNameToId() url = "https://" + OtcConfig.DEFAULT_HOST+ "/v1/" + OtcConfig.PROJECT_ID + "/subnets" + OtcConfig.SUBNETID ret = utils_http.delete(url) return ret
def delete_job(): url = "https://" + OtcConfig.DEFAULT_HOST + "/v1.1/"+ OtcConfig.PROJECT_ID +"/job-executions/" + OtcConfig.JOB_EXEC_ID ret = utils_http.delete(url) print (url) print (ret) mrs.otcOutputHandler().print_output(ret, mainkey = "") return ret
def delete_namespace(): if OtcConfig.CLUSTER: cce.convertClusterNameToId() url = "https://" + OtcConfig.DEFAULT_HOST + "/api/v1/namespaces/" + OtcConfig.NAMESPACE ret = utils_http.delete(url) ecs.otcOutputHandler().print_output(ret, mainkey="") return ret
def delete_auto_scaling_group(): if not (OtcConfig.SCALINGGROUP_NAME is None): autoscaling.convertASNameToId() url = "https://" + OtcConfig.DEFAULT_HOST + "/autoscaling-api/v1/" + OtcConfig.PROJECT_ID + "/scaling_group/" + OtcConfig.SCALINGGROUP_ID ret = utils_http.delete(url) print(ret) return ret
def delete_cluster(): url = "https://" + OtcConfig.DEFAULT_HOST + "/v1.1/"+ OtcConfig.PROJECT_ID +"/clusters/" + OtcConfig.CLUSTER_ID ret = utils_http.delete(url) print (url) print (ret) mrs.otcOutputHandler().print_output(ret, mainkey = "") return ret
def delete_namespace(): if OtcConfig.CLUSTER: cce.convertClusterNameToId() url = "https://" + OtcConfig.DEFAULT_HOST + "/api/v1/namespaces/" + OtcConfig.NAMESPACE ret = utils_http.delete(url) cce.otcOutputHandler().print_output(ret,mainkey="") return ret
def delete_auto_scaling_configuration(): if not (OtcConfig.SCALING_CONFIGURATION_NAME is None): autoscaling.convertASConfigurationNameToId() url = "https://" + OtcConfig.DEFAULT_HOST + "/autoscaling-api/v1/" + OtcConfig.PROJECT_ID + "/scaling_configuration/"+ OtcConfig.SCALING_CONFIGURATION_ID ret = utils_http.delete(url) print(ret) return ret
def delete_volume(): if not OtcConfig.VOLUME_NAME is None: ecs.convertVOLUMENameToId() url = "https://" + OtcConfig.DEFAULT_HOST+ "/v2/" + OtcConfig.PROJECT_ID + "/cloudvolumes" + "/" + OtcConfig.VOLUME_ID ret = utils_http.delete(url) print(ret) return ret
def delete_volume(): if not OtcConfig.VOLUME_NAME is None: ecs.convertVOLUMENameToId() url = ecs.baseurl+ "/v2/" + OtcConfig.PROJECT_ID + "/cloudvolumes" + "/" + OtcConfig.VOLUME_ID ret = utils_http.delete(url) print(ret) return ret
def delete_cluster(): url = "https://" + OtcConfig.DEFAULT_HOST + "/v1.1/" + OtcConfig.PROJECT_ID + "/clusters/" + OtcConfig.CLUSTER_ID ret = utils_http.delete(url) print(url) print(ret) sahara.otcOutputHandler().print_output(ret, mainkey="") return ret
def delete_auto_scaling_instance_from_group(): if not OtcConfig.INSTANCE_NAME is None: getplugin("ecs").convertINSTANCENameToId() url = "https://" + OtcConfig.DEFAULT_HOST + "/autoscaling-api/v1/" + OtcConfig.PROJECT_ID + "/scaling_group_instance/" + OtcConfig.INSTANCE_ID ret = utils_http.delete(url) print(ret) return ret
def delete_policies(): if not (OtcConfig.SCALING_POLICY_NAME is None): autoscaling.convertASPolicyNameToId() url = "https://" + OtcConfig.DEFAULT_HOST + "/autoscaling-api/v1/" + OtcConfig.PROJECT_ID + "/scaling_policy/" + OtcConfig.SCALING_POLICY_ID ret = utils_http.delete(url) print(ret) return ret
def delete_rc(): if OtcConfig.CLUSTER: cce.convertClusterNameToId() url = "https://" + OtcConfig.DEFAULT_HOST + "/api/v1/namespaces/" + OtcConfig.NAMESPACE + "/replicationcontrollers/" + OtcConfig.RC_NAME ret = utils_http.delete(url) cce.otcOutputHandler().print_output(ret, mainkey="") return ret
def delete_load_balancers(): if not (OtcConfig.LOADBALANCER_NAME is None): elb.convertELBNameToId() url = "https://" + OtcConfig.DEFAULT_HOST + "/v1.0/" + OtcConfig.PROJECT_ID + "/elbaas/loadbalancers" + "/" + OtcConfig.LOADBALANCER_ID ret = utils_http.delete(url) print(ret) return ret
def delete_launch_configuration(): raise RuntimeError("NOT IMPLEMENTED!") if not (OtcConfig.PUBLICIP is None): autoscaling.convertPublicIpNameToId() url = autoscaling.baseurl+ "/v1/" + OtcConfig.PROJECT_ID + "/publicips" + \ "/" + OtcConfig.PUBLICIPID ret = utils_http.delete(url) print(ret)
def delete_jobbinary(): if not (OtcConfig.JOBBINARY is None): getplugin("sahara").convertJOBBINARYNameToId() url = "https://" + OtcConfig.DEFAULT_HOST + "/v1.1/" + OtcConfig.PROJECT_ID + "/job-binaries/" + OtcConfig.JOBBINARY_ID ret = utils_http.delete(url) sahara.otcOutputHandler().print_output(ret, mainkey="") return ret
def release_private_address(): if not (OtcConfig.PUBLICIP is None): ecs.convertPublicIpNameToId() url = ecs.baseurl+ "/v1/" + OtcConfig.PROJECT_ID + "/publicips" + \ "/" + OtcConfig.PUBLICIPID ret = utils_http.delete(url) print(ret) return ret
def delete_load_balancers(): if not (OtcConfig.LOADBALANCER_NAME is None): elb.convertELBNameToId() url = "https://" + OtcConfig.DEFAULT_HOST+ "/v1.0/" + OtcConfig.PROJECT_ID + "/elbaas/loadbalancers" + "/" + OtcConfig.LOADBALANCER_ID ret = utils_http.delete(url) print(ret) return ret
def release_private_address(): if not (OtcConfig.PUBLICIP is None): ecs.convertPublicIpNameToId() url = "https://" + OtcConfig.DEFAULT_HOST+ "/v1/" + OtcConfig.PROJECT_ID + "/publicips" + \ "/" + OtcConfig.PUBLICIPID ret = utils_http.delete(url) print(ret) return ret
def delete_vpc(): if not (OtcConfig.VPCNAME is None): ecs.convertVPCNameToId() url = "https://" + OtcConfig.DEFAULT_HOST+ "/v1/" + OtcConfig.PROJECT_ID + "/vpcs" + OtcConfig.VPCID ret = utils_http.delete(url) print(ret) return ret
def delete_cluster(): if OtcConfig.CLUSTER: cce.convertClusterNameToId() url = "https://cce.eu-de.otc.t-systems.com" + "/api/v1/clusters/" + OtcConfig.CLUSTER_ID ret = utils_http.delete(url) cce.otcOutputHandler().print_output(ret, mainkey="") return ret
def delete_jobbinary(): if not (OtcConfig.JOBBINARY is None): getplugin("sahara").convertJOBBINARYNameToId() url = "https://" + OtcConfig.DEFAULT_HOST + "/v1.1/"+ OtcConfig.PROJECT_ID +"/job-binaries/" + OtcConfig.JOBBINARY_ID ret = utils_http.delete(url) sahara.otcOutputHandler().print_output(ret, mainkey = "") return ret
def delete_cluster(): if OtcConfig.CLUSTER: cce.convertClusterNameToId() url = "https://cce.eu-de.otc.t-systems.com" + "/api/v1/clusters/" + OtcConfig.CLUSTER_ID ret = utils_http.delete(url) cce.otcOutputHandler().print_output(ret,mainkey="") return ret
def delete_instance(): url = "https://" + OtcConfig.DEFAULT_HOST + "/v1.0/" + OtcConfig.PROJECT_ID + "/instances" url = url.replace('iam', 'dcs') ret = utils_http.delete(url + '/' + OtcConfig.INSTANCE_ID ) #print (url) #print (ret) dcs.otcOutputHandler().print_output(ret, mainkey = "") return ret
def delete_instance(): url = "https://" + OtcConfig.DEFAULT_HOST + "/v1.0/" + OtcConfig.PROJECT_ID + "/instances" url = url.replace('iam', 'dcs') ret = utils_http.delete(url + '/' + OtcConfig.INSTANCE_ID) #print (url) #print (ret) dcs.otcOutputHandler().print_output(ret, mainkey="") return ret
def delete_listener(): if not (OtcConfig.LISTENER_NAME is None): elb.convertLISTENERNameToId() url = "https://" + OtcConfig.DEFAULT_HOST + "/v1.0/" + OtcConfig.PROJECT_ID + "/elbaas/listeners/" + OtcConfig.LISTENER_ID ret = utils_http.delete(url) print(ret) return ret
def delete_listener(): if not (OtcConfig.LISTENER_NAME is None): elb.convertLISTENERNameToId() url = "https://" + OtcConfig.DEFAULT_HOST+ "/v1.0/" + OtcConfig.PROJECT_ID + "/elbaas/listeners/" + OtcConfig.LISTENER_ID ret = utils_http.delete(url) print(ret) return ret
def delete_jobobject(): if not (OtcConfig.JOB is None): getplugin("sahara").convertJOBNameToId() url = "https://" + OtcConfig.DEFAULT_HOST + "/v1.1/" + OtcConfig.PROJECT_ID + "/jobs/" + OtcConfig.JOB_ID ret = utils_http.delete(url) print(url) print(ret) sahara.otcOutputHandler().print_output(ret, mainkey="") return ret
def delete_security_group(): if not (OtcConfig.VPCNAME is None): ecs.convertVPCNameToId() if not (OtcConfig.SECUGROUPNAME is None): ecs.convertSECUGROUPNameToId() url = ecs.baseurl+ "/v2.0/" + "/security-groups" + "/"+ OtcConfig.SECUGROUP ret = utils_http.delete(url) return ret
def delete_pod_templates(): if OtcConfig.CLUSTER: cce.convertClusterNameToId() if OtcConfig.POD: url = "https://" + OtcConfig.DEFAULT_HOST + "/api/v1/namespaces/" + OtcConfig.NAMESPACE + "/podtemplates/" + OtcConfig.POD ret = utils_http.delete(url) cce.otcOutputHandler().print_output(ret, mainkey="") return ret
def delete_security_group(): if not (OtcConfig.VPCNAME is None): ecs.convertVPCNameToId() if not (OtcConfig.SECUGROUPNAME is None): ecs.convertSECUGROUPNameToId() url = "https://" + OtcConfig.DEFAULT_HOST+ "/v2.0/" + "/security-groups" + "/"+ OtcConfig.SECUGROUP ret = utils_http.delete(url) return ret
def delete_jobobject(): if not (OtcConfig.JOB is None): getplugin("sahara").convertJOBNameToId() url = "https://" + OtcConfig.DEFAULT_HOST + "/v1.1/"+ OtcConfig.PROJECT_ID +"/jobs/" + OtcConfig.JOB_ID ret = utils_http.delete(url) print (url) print (ret) sahara.otcOutputHandler().print_output(ret, mainkey = "") return ret
def delete_datasource(): if not (OtcConfig.DATASOURCE is None): getplugin("sahara").convertDATASOURCENameToId() if OtcConfig.DATASOURCE_ID is None: raise RuntimeError("Not found!") url = "https://" + OtcConfig.DEFAULT_HOST + "/v1.1/" + OtcConfig.PROJECT_ID + "/data-sources/" + OtcConfig.DATASOURCE_ID ret = utils_http.delete(url) sahara.otcOutputHandler().print_output(ret, mainkey="") return ret
def delete_datasource(): if not (OtcConfig.DATASOURCE is None): getplugin("sahara").convertDATASOURCENameToId() if OtcConfig.DATASOURCE_ID is None: raise RuntimeError("Not found!") url = "https://" + OtcConfig.DEFAULT_HOST + "/v1.1/"+ OtcConfig.PROJECT_ID +"/data-sources/" + OtcConfig.DATASOURCE_ID ret = utils_http.delete(url) sahara.otcOutputHandler().print_output(ret, mainkey = "") return ret
def delete_health_check(): if not (OtcConfig.LOADBALANCER_NAME is None): elb.convertELBNameToId() if not (OtcConfig.HEALTHCHECK_ID is None): elb.convertLISTENERIdToHealthCheckId() url = "https://" + OtcConfig.DEFAULT_HOST+ "/v1.0/" + OtcConfig.PROJECT_ID + "/elbaas/healthcheck/" + OtcConfig.HEALTHCHECK_ID ret = utils_http.delete(url) print(ret) return ret
def delete_health_check(): if not (OtcConfig.LOADBALANCER_NAME is None): elb.convertELBNameToId() if not (OtcConfig.HEALTHCHECK_ID is None): elb.convertLISTENERIdToHealthCheckId() url = "https://" + OtcConfig.DEFAULT_HOST + "/v1.0/" + OtcConfig.PROJECT_ID + "/elbaas/healthcheck/" + OtcConfig.HEALTHCHECK_ID ret = utils_http.delete(url) print(ret) return ret
def delete_key_pair(): """ generated source for method KEYPAIRDelete """ url = ecs.baseurl+ "/v2/" + OtcConfig.PROJECT_ID + "/os-keypairs"+ "/" + OtcConfig.KEYNAME ret = utils_http.delete(url ) return ret
def detach_volume(): """ generated source for method DetachVolume """ url = ecs.baseurl+ "/v1/" + OtcConfig.PROJECT_ID + "/cloudservers/" + OtcConfig.INSTANCE_ID + "/detachvolume/" + OtcConfig.VOLUME_ID ret = utils_http.delete(url) print(ret) return ret
def detach_volume(): """ generated source for method DetachVolume """ url = "https://" + OtcConfig.DEFAULT_HOST+ "/v1/" + OtcConfig.PROJECT_ID + "/cloudservers/" + OtcConfig.INSTANCE_ID + "/detachvolume/" + OtcConfig.VOLUME_ID ret = utils_http.delete(url) print(ret) return ret
def delete_key_pair(): """ generated source for method KEYPAIRDelete """ url = "https://" + OtcConfig.DEFAULT_HOST+ "/v2/" + OtcConfig.PROJECT_ID + "/os-keypairs"+ "/" + OtcConfig.KEYNAME ret = utils_http.delete(url ) return ret
def release_private_address(): url = "https://" + OtcConfig.DEFAULT_HOST+ "/v1/" + OtcConfig.PROJECT_ID + "/privateips" + OtcConfig.PRIVATEIPID ret = utils_http.delete(url) print(ret) return ret